Skip to content

Commit

Permalink
Only invalidate the projects list for orgs
Browse files Browse the repository at this point in the history
This may avoid unnecessary data returning from GraphQL queries that need
to refresh the list of projects.
  • Loading branch information
rmunn committed Jul 23, 2024
1 parent 1d70785 commit 3db96a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/lib/gql/gql-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function createGqlClient(_gqlEndpoint?: string): Client {
Mutation: {
createProject: (result, args: CreateProjectMutationVariables, cache, _info) => {
if (args.input.orgId) {
cache.invalidate({__typename: 'OrgById', id: args.input.orgId});
cache.invalidate({__typename: 'OrgById', id: args.input.orgId}, 'projects');
}
},
softDeleteProject: (result, args: SoftDeleteProjectMutationVariables, cache, _info) => {
Expand Down Expand Up @@ -93,7 +93,7 @@ function createGqlClient(_gqlEndpoint?: string): Client {
},
addProjectToOrg: (result, args: MutationAddProjectToOrgArgs, cache, _info) => {
cache.invalidate({__typename: 'Project', id: args.input.projectId});
cache.invalidate({__typename: 'OrgById', id: args.input.orgId});
cache.invalidate({__typename: 'OrgById', id: args.input.orgId}, 'projects');
}
}
}
Expand Down

0 comments on commit 3db96a6

Please sign in to comment.