-
Notifications
You must be signed in to change notification settings - Fork 20
/
codegen.yml
56 lines (47 loc) · 1.72 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
schema: ${NEXT_PUBLIC_BACKEND_URL_V3}
documents:
- 'pages/**/*.gql'
- 'components/**/*.gql'
- 'modules/**/*.gql'
- 'lib/**/*.gql'
hooks:
afterAllFileWrite:
- 'prettier --write'
generates:
# Generates a full copy of the remote schema
apollo/generated/schema.graphql:
plugins:
- schema-ast
# Generates fragment metadata needed by apollo cache
apollo/generated/fragmentMetadata.json:
plugins:
- fragment-matcher
# Generates query and mutation documents
apollo/generated/operations.ts:
plugins:
- typescript-document-nodes
# Generates query and mutation types
apollo/generated/graphql-codegen-generated.ts:
plugins:
- add:
content: '/* tslint:disable */'
- typescript
- typescript-operations
- typescript-react-apollo
config:
# Use interfaces where possible, instead of type aliases
declarationKind: 'interface'
# Generate nullable fields as Maybe<T> (instead of { field?: Maybe<T> })
#avoidOptionals: true
# Use string literal types instead of enums, for compatibility with omni types
enumsAsTypes: true
# __typename is always fetched, so don’t mark it as optional in generated types
nonOptionalTypename: true
# Inline field selections in generated types, instead of using Pick<>
preResolveTypes: true
# Give scalars definite types, rather than 'any'
scalars:
BigInt: 'string'
BigDecimal: 'string'
Bytes: 'string'
AmountHumanReadable: 'string'