-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
33 lines (31 loc) · 789 Bytes
/
codegen.ts
File metadata and controls
33 lines (31 loc) · 789 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
import type { CodegenConfig } from '@graphql-codegen/cli'
import { printSchema } from 'graphql'
import { schema } from '@lib/graphql/schema'
const config: CodegenConfig = {
schema: printSchema(schema),
documents: ['{components,lib,pages}/**/*.{ts,tsx}'],
generates: {
'./generated/graphql/': {
preset: 'client',
plugins: [],
},
'./generated/schema.graphql': {
plugins: ['schema-ast'],
},
},
config: {
avoidOptionals: {
field: true,
inputValue: false,
object: true,
defaultValue: true,
},
scalars: {
UUID: 'string',
// Doesn't work properly due to https://github.com/apollographql/apollo-client/issues/8857
// DateTime: 'Date',
DateTime: 'string',
},
},
}
export default config