-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
33 lines (31 loc) · 1.01 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
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
schema: "./api/src/**/*.gql",
documents: "./client/src/**/*.gql",
generates: {
"./api/src/generated/graphql.ts": {
config: {
mappers: {
Asset: "@prisma/client#Asset",
AssetConnection: "@prisma/client#AssetConnection",
AssetType: "../model/asset/lib/asset-type#AssetType",
Organization: "@prisma/client#Organization",
},
mapperTypeSuffix: "Model",
enumValues: {},
useIndexSignature: true,
contextType: "../middleware/graphql#GraphQLContext",
maybeValue: "T | undefined | null",
},
plugins: ["typescript", "typescript-resolvers"],
},
"./api/src/generated/typed-defs.ts": {
plugins: ["bin/codegen-typedefs.cjs"],
},
"./client/src/generated/graphql.ts": {
plugins: ["typescript", "typescript-operations", "typescript-react-apollo"],
},
},
};
export default config;