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
committed by liyasthomas
parent 3809e9853e
commit 8d5bd051a1
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
}