-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodegen.ts
47 lines (44 loc) · 1.1 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
overwrite: true,
schema: "https://us-east-1.cdn.hygraph.com/content/cl8z8boma0tpz01ul4h162cir/master",
documents: "src/queries/**/*.{gql,graphql}",
emitLegacyCommonJSImports: false,
config: {
scalars: {
RichTextAST: "@graphcms/rich-text-types#RichTextContent",
DateTime: "string",
Date: "string",
Hex: "string",
Css: "string",
Long: "string",
Json: "string",
},
Test: "ConfigQuery.configuration",
},
generates: {
"src/types/schema.ts": {
plugins: [
"typescript",
"typescript-operations",
"fragment-matcher",
"typed-document-node",
"typescript-resolvers",
{
add: {
content: `/* eslint-disable */
// WARNING
//
// This file is automatically generated by GraphQL Code Generator
// If you modify it, your changes will be overwritten. So don't modify it.
// Or do, whatever. I'm not your mother.
//
// END OF WARNING
`,
},
},
],
},
},
};
export default config;