-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.ts
31 lines (29 loc) · 999 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
import type { CodegenConfig } from "@graphql-codegen/cli"
import * as dotenv from "dotenv"
dotenv.config()
const config: CodegenConfig = {
overwrite: true,
ignoreNoDocuments: true,
documents: ["src/queries/graphql"],
schema: `https://graphql.contentful.com/content/v1/spaces/z41luxcckja5/environments/master?access_token=${process.env.ACCESS_TOKEN}`,
generates: {
"./schema/index.ts": {
plugins: ["typescript", "typescript-operations"],
config: {
flattenGeneratedTypes: true,
ignoreEnumValuesFromSchema: true,
flattenGeneratedTypesIncludeFragments: true,
skipTypename: false,
dedupeFragments: true,
maybeValue: "T",
},
hooks: {
afterOneFileWrite: ["prettier --write"],
},
presetConfig: {
fragmentMasking: false,
},
},
},
}
export default config