-
Notifications
You must be signed in to change notification settings - Fork 1
/
codegen.ts
54 lines (52 loc) · 1.2 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
48
49
50
51
52
53
54
import type { CodegenConfig } from "@graphql-codegen/cli"
import dotenv from "dotenv"
dotenv.config()
const config: CodegenConfig = {
emitLegacyCommonJSImports: false,
generates: {
"src/lib/hygraph/graphql-types.ts": {
schema: process.env.PUBLIC_CACHED_READ_HYGRAPH,
documents: [
"src/lib/hygraph/*.gql",
],
plugins: [
"typescript",
"typescript-operations",
"typed-document-node"
],
config: {
useTypeImports: true,
scalars: {
DateTime: "string",
Date: "string",
Hex: "string",
Json: "string",
Long: "number",
RGBAHue: "string",
RGBATransparency: "string",
RichTextAST: "any"
},
},
},
"src/lib/graphql/graphql-types.ts": {
schema: process.env.PUBLIC_GRAPH_ENDPOINT,
documents: [
"src/lib/graphql/*.gql"
],
plugins: [
"typescript",
"typescript-operations",
"typed-document-node"
],
config: {
useTypeImports: true,
scalars: {
UUID: "string",
DateTime: "string",
Void: "void"
}
}
}
}
}
export default config