-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathcodegen.ts
36 lines (34 loc) · 933 Bytes
/
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
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
overwrite: true,
generates: {
'src/data/dtsi/introspection.json': {
plugins: ['introspection'],
config: {
minify: true,
},
schema: 'src/data/dtsi/schema.graphql',
},
'src/data/dtsi/generated.ts': {
documents: 'src/data/dtsi/**/*.ts',
plugins: ['typescript', 'typescript-operations', 'typescript-resolvers'],
config: {
scalars: {
DateTime: 'string',
BigInt: 'number',
Bytes: 'unknown',
Decimal: 'number',
Json: 'unknown',
},
maybeValue: 'T | null | undefined',
avoidOptionals: true,
typesPrefix: 'DTSI_',
namingConvention: {
enumValues: 'change-case-all#upperCase',
},
},
schema: 'src/data/dtsi/schema.graphql',
},
},
}
export default config