-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathcodegen.ts
42 lines (40 loc) · 1.33 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
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'libs/dh/shared/data-access-graphql/schema.graphql',
config: { sort: false },
documents: 'libs/**/*.graphql',
generates: {
'libs/dh/shared/domain/src/lib/generated/graphql/types.ts': {
plugins: [
{ add: { content: '/* eslint-disable */' } },
'typescript',
'typescript-operations',
'typed-document-node',
'typescript-msw',
'@homebound/graphql-typescript-scalar-type-policies',
],
config: {
nonOptionalTypename: true,
scalars: {
UUID: 'string',
Date: 'Date',
DateRange: '{ start: Date, end: Date | null }',
DateTime: 'Date',
},
scalarTypePolicies: {
Date: 'libs/dh/shared/domain/src/lib/type-policies#dateTypePolicy',
DateTime: 'libs/dh/shared/domain/src/lib/type-policies#dateTypePolicy',
DateRange: 'libs/dh/shared/domain/src/lib/type-policies#dateRangeTypePolicy',
},
},
},
'libs/dh/shared/domain/src/lib/generated/graphql/data-source.ts': {
plugins: [
{ add: { content: '/* eslint-disable */' } },
'libs/dh/shared/feature-graphql-codegen/dist/apollo-data-source.js',
],
},
},
};
export default config;