-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.yml
39 lines (36 loc) · 1.06 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
overwrite: true
schema:
"https://graphql.contentful.com/content/v1/spaces/${CONTENTFUL_SPACE_ID}":
headers:
Authorization: Bearer ${CONTENTFUL_TOKEN}
generates:
# Download the schema for GraphQL IDE plugins
schema.graphql:
plugins:
- schema-ast
# Global types
src/graphql/types.ts:
plugins:
- typescript
# Colocate Typescript types/interfaces with components
./:
documents:
- src/Components/**/*.gql
- src/utils/**/*.gql
preset: near-operation-file
presetConfig:
extension: .query.ts
baseTypesPath: src/graphql/types.ts
plugins:
- typescript-operations
- typescript-graphql-request
# For pages, we generate one Typescript file. This simplifies fetching, but also NextJS doesn't allow colocating the
# .query.ts files (it tries to build them, and there's no ignore option).
src/graphql/pageQueries.ts:
documents: "src/**/*.gql"
preset: import-types
presetConfig:
typesPath: ./types
plugins:
- typescript-operations
- typescript-graphql-request