From fa619d6516aa494dd3c456ff5e542b44f9d93bc7 Mon Sep 17 00:00:00 2001 From: Robin Munn Date: Fri, 31 May 2024 10:25:25 +0700 Subject: [PATCH] Remove deleted draft project from GraphQL cache --- frontend/src/lib/gql/gql-client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/gql/gql-client.ts b/frontend/src/lib/gql/gql-client.ts index 124743f60..3ba9ee085 100644 --- a/frontend/src/lib/gql/gql-client.ts +++ b/frontend/src/lib/gql/gql-client.ts @@ -26,6 +26,7 @@ import { LexGqlError, type SoftDeleteProjectMutationVariables, type BulkAddProjectMembersMutationVariables, + type DeleteDraftProjectMutationVariables, } from './types'; import type {Readable, Unsubscriber} from 'svelte/store'; import {derived} from 'svelte/store'; @@ -53,7 +54,9 @@ function createGqlClient(_gqlEndpoint?: string): Client { Mutation: { softDeleteProject: (result, args: SoftDeleteProjectMutationVariables, cache, _info) => { cache.invalidate({__typename: 'Project', id: args.input.projectId}); - cache.invalidate({__typename: 'DraftProject', id: args.input.projectId}); + }, + deleteDraftProject: (result, args: DeleteDraftProjectMutationVariables, cache, _info) => { + cache.invalidate({__typename: 'DraftProject', id: args.input.draftProjectId}); }, deleteUserByAdminOrSelf: (result, args: DeleteUserByAdminOrSelfMutationVariables, cache, _info) => { cache.invalidate({__typename: 'User', id: args.input.userId});