refactor: add graphcache codegen and update types

This commit is contained in:
Andrew Bastin
2021-10-15 18:00:18 +05:30
parent 02d5f0fdf3
commit 39de34f083
7 changed files with 107 additions and 39 deletions

View File

@@ -1,14 +1,14 @@
import { ResolverConfig } from "@urql/exchange-graphcache"
import { GraphCacheResolvers } from "../graphql"
export const resolversDef: ResolverConfig = {
export const resolversDef: GraphCacheResolvers = {
Query: {
team: (_parent, { teamID }, _cache, _info) => ({
__typename: "Team",
id: teamID as any,
id: teamID,
}),
user: (_parent, { uid }, _cache, _info) => ({
__typename: "User",
uid: uid as any,
uid: uid,
}),
},
}