-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
46 lines (43 loc) · 958 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
37
38
39
40
41
42
43
44
45
46
import dotenv from 'dotenv';
import { CodegenConfig } from '@graphql-codegen/cli';
dotenv.config();
const config: CodegenConfig = {
schema:
process.env.BACKEND_GRAPHQL_ENDPOINT || 'http://localhost:3333/graphql',
documents: ['./src/**/*.{ts,tsx,js,jsx}'],
generates: {
'./src/api/gql/schema.graphql': {
plugins: ['schema-ast'],
},
'./src/api/gql/schema.graphql.json': {
plugins: ['introspection'],
config: {
minify: true,
},
},
'./src/api/gql/': {
preset: 'client',
plugins: [],
presetConfig: {
gqlTagName: 'gql',
fragmentMasking: false,
},
config: {
namingConvention: 'keep',
scalars: {
BigInt: 'bigint',
},
},
},
/*
'./src/@types/api.d.ts': {
plugins: ['typescript'],
config: {
noExport: true
}
},
*/
},
ignoreNoDocuments: true,
};
export default config;