forked from saleor/nextjs-commerce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.graphqlrc.ts
40 lines (37 loc) · 1009 Bytes
/
.graphqlrc.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
import type { CodegenConfig } from '@graphql-codegen/cli';
import { loadEnvConfig } from '@next/env';
loadEnvConfig(process.cwd());
const config: CodegenConfig = {
overwrite: true,
schema: process.env.SALEOR_INSTANCE_URL,
documents: 'lib/**/*.graphql',
ignoreNoDocuments: true,
generates: {
'lib/saleor/generated/': {
preset: 'client',
presetConfig: {
fragmentMasking: false,
dedupeFragments: true,
},
config: {
useTypeImports: true,
defaultScalarType: 'unknown',
skipTypename: true,
documentMode: 'string',
exportFragmentSpreadSubTypes: true,
dedupeFragments: true,
scalars: {
Date: 'string',
DateTime: 'string',
Decimal: 'number',
JSONString: 'string',
Metadata: 'Record<string, string>',
PositiveDecimal: 'number',
UUID: 'string',
WeightScalar: 'number',
},
},
},
},
};
export default config;