-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
33 lines (31 loc) · 825 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
import type { CodegenConfig } from '@graphql-codegen/cli'
import { addTypenameSelectionDocumentTransform } from '@graphql-codegen/client-preset'
const config: CodegenConfig = {
schema: 'http://localhost:54321/graphql/v1',
documents: 'src/**/*.tsx',
overwrite: true,
ignoreNoDocuments: true,
generates: {
'src/gql/': {
preset: 'client',
documentTransforms: [addTypenameSelectionDocumentTransform],
plugins: [],
config: {
scalars: {
UUID: 'string',
Date: 'string',
Time: 'string',
Datetime: 'string',
JSON: 'string',
BigInt: 'string',
BigFloat: 'string',
Opaque: 'any',
},
},
},
},
hooks: {
afterAllFileWrite: ['npm run prettier'], // optional
},
}
export default config