-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
33 lines (31 loc) · 846 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 { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
schema: './assets/schema.json',
// this assumes that all your source files are in a top-level `src/` directory - you might need to adjust this to your file structure
documents: ['src/graphql/**/*.{ts,tsx}'],
generates: {
'./src/gql/': {
preset: 'client',
plugins: [],
presetConfig: {
gqlTagName: 'gql',
fragmentMasking: false,
},
config: {
enumsAsTypes: true,
avoidOptionals: {
field: true,
},
namingConvention: 'keep',
nonOptionalTypename: true,
declarationKind: 'interface',
arrayInputCoercion: false,
scalars: {
Long: 'number',
},
},
},
},
ignoreNoDocuments: true,
};
export default config;