forked from Xeonus/v3-info
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.yml
54 lines (45 loc) · 1.6 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
schema:
- 'https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks'
- 'https://api.thegraph.com/subgraphs/name/xeonus/balancer-v2-analytics'
documents:
- 'src/**/*.gql'
hooks:
afterAllFileWrite:
- 'prettier --write'
generates:
# Generates a full copy of the remote schema
src/apollo/generated/schema.graphql:
plugins:
- schema-ast
# Generates fragment metadata needed by apollo cache
src/apollo/generated/fragmentMetadata.json:
plugins:
- fragment-matcher
# Generates query and mutation documents
src/apollo/generated/operations.ts:
plugins:
- typescript-document-nodes
# Generates query and mutation types
src/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'