-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcodegen.ts
More file actions
35 lines (32 loc) · 780 Bytes
/
codegen.ts
File metadata and controls
35 lines (32 loc) · 780 Bytes
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
import type { CodegenConfig } from '@graphql-codegen/cli'
import * as dotenv from 'dotenv'
dotenv.config()
const config: CodegenConfig = {
overwrite: true,
schema: {
'https://api.nms-ev.org/graphql': {
headers: {
Authorization: `Bearer ${process.env.API_TOKEN}`,
},
},
},
documents: ['./src/**/*.gql'],
generates: {
'src/lib/graphql/gen.ts': {
plugins: ['typescript', 'typescript-operations', 'typescript-graphql-request'],
config: {
useTypeImports: true,
immutableTypes: true,
dedupeFragments: true,
defaultScalarType: 'unknown',
scalars: {
Date: 'string',
},
},
},
'.schema.gql': {
plugins: ['schema-ast'],
},
},
}
export default config