-
Notifications
You must be signed in to change notification settings - Fork 394
Expand file tree
/
Copy pathgraphql-codegen.ts
More file actions
46 lines (43 loc) · 1.21 KB
/
graphql-codegen.ts
File metadata and controls
46 lines (43 loc) · 1.21 KB
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
// Copyright 2020-2025 SubQuery Pte Ltd authors & contributors
// SPDX-License-Identifier: GPL-3.0
import type {CodegenConfig} from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'https://gateway.subquery.network/query/QmQqqmwwaBben8ncfHo3DMnDxyWFk5QcEdTmbevzKj7DBd',
documents: 'src/controller/network/queries/*.graphql',
config: {
namingConvention: {
enumValues: 'keep',
},
preResolveTypes: true,
avoidOptionals: true,
nonOptionalTypename: true,
skipTypeNameForRoot: true,
immutableTypes: true,
scalars: {
Date: 'Date',
Datetime: 'Date',
BigFloat: 'string',
BigInt: 'string',
Cursor: 'string',
},
},
generates: {
'src/controller/network/__graphql__/base-types.ts': {
plugins: ['typescript', 'typescript-operations'],
},
src: {
preset: 'near-operation-file',
config: {
importOperationTypesFrom: 'Types',
},
presetConfig: {
folder: '../__graphql__/network',
extensions: '.generated.ts',
baseTypesPath: 'controller/network/__graphql__/base-types.ts',
},
plugins: ['typescript-document-nodes'],
},
},
};
export default config;