refactor: add graphcache codegen and update types

This commit is contained in:
Andrew Bastin
2021-10-15 18:00:18 +05:30
committed by liyasthomas
parent 9f0956556f
commit a12315d81a
7 changed files with 141 additions and 87 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,
}),
},
}