-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
46 lines (45 loc) · 1.06 KB
/
codegen.ts
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
46
import { CodegenConfig } from '@graphql-codegen/cli'
import dotenv from 'dotenv'
dotenv.config()
const config: CodegenConfig = {
overwrite: true,
schema: [
{
'https://graphql.datocms.com': {
headers: {
Authorization: `${process.env['DATO_TOKEN']}`,
},
},
},
],
documents: ['./src/api/schemas/**/*.graphql'],
hooks: {
afterOneFileWrite: ['prettier --write'],
},
generates: {
'src/types/_generated/graphql-types.ts': {
plugins: [
// {
// add: {
// content:
// '// eslint-disable-next-line @typescript-eslint/ban-ts-comment',
// },
// },
// { add: { content: '// @ts-nocheck' } },
'typescript',
'typescript-operations',
'typed-document-node',
],
config: {
dedupeFragments: true,
},
},
'src/types/_generated/graphql-schema.json': {
plugins: ['introspection'],
},
'src/types/_generated/fragment-types.ts': {
plugins: ['fragment-matcher'],
},
},
}
export default config