-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.yml
45 lines (41 loc) · 1 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
schema: https://api.thegraph.com/subgraphs/id/QmaP6yn6v1G2W6XiPA8c2wrrss1wyaHU8kg5oZq9PZuyS9
overwrite: true
# Format files
hooks:
afterAllFileWrite:
- prettier --write
generates:
# Get schemas from server
example/schemas.ts:
documents: './gql/**/*.gql'
plugins:
- typescript
# Create operations based on queries
example/operations.ts:
documents: './gql/**/*.gql'
preset: import-types
presetConfig:
typesPath: ./schemas
plugins:
- typescript-operations
# 1. Export GraphQL documents
# 2. React interface
example/react-hooks.ts:
documents: './gql/**/*.gql'
preset: import-types
presetConfig:
typesPath: ./operations
plugins:
- typescript-react-apollo
config:
withHooks: true
withHOC: false
withComponent: false
example/server-sdk.ts:
documents: './gql/**/*.gql'
preset: import-types
presetConfig:
typesPath: ./schemas
plugins:
- typescript-operations
- typescript-generic-sdk