-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.yml
65 lines (64 loc) 路 2.3 KB
/
codegen.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
overwrite: true
schema: "./src/graphql/schema.graphql"
documents: "./src/queries/**/*.graphql"
generates:
src/generated/schema.ts:
plugins:
- "typescript"
- "typescript-resolvers"
config:
# avoidOptionals: true
# maybeValue: 'T extends PromiseLike<infer U> ? Promise<U | null> : T | null'
maybeValue: 'T | null | undefined'
skipTypename: true
useIndexSignature: true
nonOptionalTypename: true
avoidOptionals: true
noSchemaStitching: true
# resolverTypeWrapperSignature: |
# Promisable<T extends { __typename: string } ? { [K in keyof T]: DeepLazy<T[K]> } : T>;
# export type DeepLazy<T> = T extends { __typename: string } | Array<{ __typename: string }>
# ? { [K in keyof T]: DeepLazy<T[K]> } | undefined
# : T extends Scalars[keyof Scalars]
# ? T
# : T extends { [K in string | number]: any }
# ? { [K in keyof T]: DeepLazy<T[K]> }
# : T;
# export type Promisable<T> = Promise<T> | T
# customResolverFn: |
# (parent: UnwrapPromise<ResolverTypeWrapper<TParent>>, args: TArgs, context: TContext, info: GraphQLResolveInfo) => Promisable<TResult>;
# export type UnwrapPromise<T> = T extends Promise<infer U> ? U : T
mappers:
User: "@prisma/client#User as UserRecord"
TeamUserRole: "@prisma/client#TeamUserRole as TeamUserRoleRecord"
Team: "@prisma/client#Team as TeamRecord"
Project: "@prisma/client#Project as ProjectRecord"
./graphql.schema.json:
plugins:
- "introspection"
src/generated/graphql.tsx:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
config:
reactApolloVersion: 3
withHooks: false
withHOC: false
withComponent: false
exportFragmentSpreadSubTypes: true
documentMode: graphQLTag
src/generated/page.tsx:
config:
documentMode: external
importDocumentNodeExternallyFrom: ./graphql
reactApolloVersion: 3
withHooks: true
apolloClientInstanceImport: '../hoc/withApollo'
contextType: 'ApolloClientContext'
contextTypeRequired: true
preset: import-types
presetConfig:
typesPath: ./graphql
plugins:
- "@anglinb/graphql-codegen-apollo-next-ssr"