-
Notifications
You must be signed in to change notification settings - Fork 5
/
codegen.yml
39 lines (35 loc) · 928 Bytes
/
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
# Endpoint API, the following URL is a example
schema: https://countries-274616.ew.r.appspot.com/graphql/
overwrite: true
# Format files
hooks:
afterAllFileWrite:
- prettier --write
generates:
# Get schemas from server
src/queries/autogenerate/schemas.tsx:
documents: 'src/queries/**/**.gql'
plugins:
- typescript
# Create operations based on queries
src/queries/autogenerate/operations.tsx:
documents: 'src/queries/**/**.gql'
preset: import-types
presetConfig:
typesPath: ./schemas
plugins:
- typescript-operations
# 1. Export GraphQL documents
# 2. React interface
src/queries/autogenerate/hooks.tsx:
documents: 'src/queries/**/**.gql'
preset: import-types
presetConfig:
typesPath: ./operations
plugins:
- typescript-react-apollo
config:
# Optionals
withHOC: false
withComponent: false
withHooks: true