-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcodegen.ts
41 lines (39 loc) · 951 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
39
40
41
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'schema.ts',
generates: {
'generated/server.ts': {
config: {
contextType: '../server/lib/context#ApolloContext',
mappers: {
User: '.prisma/client#User as UserType',
Post: '.prisma/client#Post as PostType',
Comment: '.prisma/client#Comment as CommentType',
},
scalars: {
DateTime: 'Date',
},
},
plugins: [
'typescript',
'typescript-resolvers',
'typescript-document-nodes',
],
},
'generated/client.ts': {
documents: './web/graphql/**/*.graphql',
plugins: [
'typescript',
'typescript-operations',
'typescript-react-apollo',
],
config: {
scalars: {
DateTime: 'Date',
},
},
},
},
};
export default config;