-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcodegen.yml
More file actions
45 lines (41 loc) · 1.07 KB
/
codegen.yml
File metadata and controls
45 lines (41 loc) · 1.07 KB
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
# more config option https://www.graphql-code-generator.com/docs/generated-config/typescript
# Endpoint API, the following URL is a example
schema: ${NEXT_PUBLIC_GRAPHQL_API_ENDPOINT}
overwrite: true
generates:
# Get schemas from server
src/graphql/schemas.ts:
documents: "src/**/**.gql"
plugins:
- typescript
# Create operations based on queries
src/graphql/operations.ts:
documents: "src/**/**.gql"
preset: import-types
presetConfig:
typesPath: ./schemas
plugins:
- typescript-operations
# 1. Export GraphQL documents
# 2. React interface
src/graphql/hooks.ts:
documents: "src/**/**.gql"
preset: import-types
presetConfig:
typesPath: ./operations
plugins:
- typescript-react-apollo
config:
# Optionals
withHOC: false
withComponent: false
withHooks: true
reactApolloVersion: 3
useImplementingTypes: true
disableDescriptions: true
maybeValue: T | null | undefined
enumsAsTypes: true
# Format files
hooks:
afterAllFileWrite:
- prettier --write