-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
34 lines (32 loc) · 817 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
import { CodegenConfig } from "@graphql-codegen/cli"
import { schema } from "./src/graphql/schema"
import { printSchema } from "graphql"
const config: CodegenConfig = {
overwrite: true,
schema: printSchema(schema),
documents: ["src/**/*.tsx", "src/**/*.ts", "*.graphql"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"generated/": {
preset: "client",
presetConfig: {
fragmentMasking: { unmaskFunctionName: "getFragmentData" },
},
},
"generated/schema.graphql": {
plugins: ["schema-ast"],
},
},
hooks: {
afterOneFileWrite: ["prettier --write"],
},
config: {
useTypeImports: true,
dedupeFragments: true,
scalars: {
DateTime: "string",
Json: "unknown",
},
},
}
export default config