-
Notifications
You must be signed in to change notification settings - Fork 56
/
codegen.ts
51 lines (49 loc) · 1.56 KB
/
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
47
48
49
50
51
import type { CodegenConfig } from '@graphql-codegen/cli';
const clientConfig = {
preset: 'client',
presetConfig: {
fragmentMasking: false,
},
} as const;
const config: CodegenConfig = {
overwrite: true,
config: {
strict: true,
namingConvention: {
typeNames: 'change-case-all#pascalCase',
enumValues: 'keep',
},
scalars: {
ID: 'string',
Money: 'number',
DateTime: { input: 'Date', output: 'string' },
},
maybeValue: 'T',
},
generates: {
'src/plugins/reviews/generated-admin-types.ts': {
schema: 'http://localhost:3000/admin-api',
plugins: ['typescript'],
},
'src/plugins/reviews/generated-shop-types.ts': {
schema: 'http://localhost:3000/shop-api',
plugins: ['typescript'],
},
'src/plugins/reviews/e2e/types/shop/': {
schema: 'http://localhost:3000/shop-api',
documents: 'src/plugins/reviews/e2e/graphql/shop-e2e-definitions.graphql.ts',
...clientConfig,
},
'src/plugins/reviews/e2e/types/admin/': {
schema: 'http://localhost:3000/admin-api',
documents: 'src/plugins/reviews/e2e/graphql/admin-e2e-definitions.graphql.ts',
...clientConfig,
},
'src/plugins/reviews/ui/gql/': {
schema: 'http://localhost:3000/admin-api',
documents: 'src/plugins/reviews/ui/**/*.ts',
...clientConfig,
},
},
};
export default config;