From 3d708ae7ebed126aef8eb43e76f1357441e2a4f3 Mon Sep 17 00:00:00 2001 From: Riccardo Balbo Date: Wed, 30 Oct 2024 18:42:30 +0100 Subject: [PATCH] Prevent UPDATE_COMMENT from invalidating the cache of child comments --- fragments/paidAction.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/fragments/paidAction.js b/fragments/paidAction.js index 4deae625..c47fa700 100644 --- a/fragments/paidAction.js +++ b/fragments/paidAction.js @@ -29,6 +29,18 @@ const ITEM_PAID_ACTION_FIELDS = gql` } }` +const ITEM_PAID_ACTION_FIELDS_NO_CHILD_COMMENTS = gql` + ${COMMENTS} + fragment ItemPaidActionFieldsNoChildComments on ItemPaidAction { + result { + id + deleteScheduledAt + reminderScheduledAt + ...CommentFields + } + } +` + const ITEM_ACT_PAID_ACTION_FIELDS = gql` fragment ItemActPaidActionFields on ItemActPaidAction { result { @@ -226,11 +238,11 @@ export const CREATE_COMMENT = gql` }` export const UPDATE_COMMENT = gql` - ${ITEM_PAID_ACTION_FIELDS} + ${ITEM_PAID_ACTION_FIELDS_NO_CHILD_COMMENTS} ${PAID_ACTION} mutation upsertComment($id: ID!, $text: String!, $boost: Int, ${HASH_HMAC_INPUT_1}) { upsertComment(id: $id, text: $text, boost: $boost, ${HASH_HMAC_INPUT_2}) { - ...ItemPaidActionFields + ...ItemPaidActionFieldsNoChildComments ...PaidActionFields } }`