refactor: extract cache info to separate files and add more mutations

This commit is contained in:
Andrew Bastin
2021-10-06 19:31:16 +05:30
parent f73c8a45d9
commit a5fd39adf8
5 changed files with 268 additions and 86 deletions

View File

@@ -0,0 +1,13 @@
import { OptimisticMutationConfig } from "@urql/exchange-graphcache"
export const optimisticDefs: OptimisticMutationConfig = {
deleteTeam: () => true,
leaveTeam: () => true,
renameTeam: ({ teamID, newName }) => ({
__typename: "Team",
id: teamID,
name: newName,
}),
removeTeamMember: () => true,
// TODO: updateTeamMemberRole
}