This repository was archived by the owner on Apr 2, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcodegen.yml
More file actions
45 lines (43 loc) 路 1.21 KB
/
Copy pathcodegen.yml
File metadata and controls
45 lines (43 loc) 路 1.21 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
overwrite: true
schema:
- "https://graphql.contentful.com/content/v1/spaces/${NEXT_PUBLIC_CONTENTFUL_SPACE_ID}/environments/${NEXT_PUBLIC_CONTENTFUL_ENVIRONMENT}":
headers:
Authorization: "Bearer ${NEXT_PUBLIC_CONTENTFUL_ACCESS_TOKEN}"
generates:
./generated/types.ts:
config: &fullSharedConfig
avoidOptionals: true
nonOptionalTypename: true
immutableTypes: true
maybeValue: T
onlyOperationTypes: true
flattenGeneratedTypes: true
preResolveTypes: true
strictScalars: true
defaultScalarType: unknown
scalars:
DateTime: string
Dimension: number
HexColor: string
Quality: number
plugins:
- add:
content: "// noinspection JSUnusedGlobalSymbols\n"
- "typescript"
./:
documents: "**/*.graphql"
preset: near-operation-file
presetConfig:
baseTypesPath: ./generated/types.ts
config: *fullSharedConfig
plugins:
- add:
content: "// noinspection JSUnusedGlobalSymbols\n"
- "typescript-operations"
- "typescript-react-apollo"
./generated/possible-types.ts:
plugins:
- "fragment-matcher"
hooks:
afterOneFileWrite:
- prettier --write