-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
38 lines (36 loc) · 830 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
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
overwrite: true,
schema: 'pages/api/graphql/schema/root.graphql',
documents: 'graphql/query/*.graphql',
generates: {
'pages/api/graphql/types/graphql.ts': {
plugins: [
'typescript',
'typescript-resolvers',
{ add: { content: '/* eslint-disable */' } },
],
config: {
mappers: {
PrismaUser: '@prisma/client/index.d#User',
},
scalars: {
Date: 'Date',
},
},
},
'graphql/types/client.ts': {
plugins: [
'typescript',
'typescript-operations',
'typescript-react-apollo',
],
config: {
scalars: {
Date: 'number',
},
},
},
},
}
export default config