-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathcodegen.ts
More file actions
43 lines (41 loc) · 1.05 KB
/
codegen.ts
File metadata and controls
43 lines (41 loc) · 1.05 KB
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
import type { CodegenConfig } from "@graphql-codegen/cli";
const config: CodegenConfig = {
schema: "./lib/graphql/schema.graphql",
documents: [
"lib/graphql/operations/**/*.graphql",
"lib/graphql/operations/**/*.ts",
"lib/graphql/operations/**/*.tsx",
],
ignoreNoDocuments: true,
generates: {
"./lib/graphql/generated.ts": {
plugins: [
{
add: {
content: [
'export { TypedDocumentString } from "./typed-document-string";',
'import { TypedDocumentString } from "./typed-document-string";',
].join("\n"),
},
},
"typescript",
"typescript-operations",
"typescript-react-query",
],
config: {
fetcher: {
func: "./client#fetcher",
isReactHook: false,
},
exposeQueryKeys: true,
reactQueryVersion: 5,
documentMode: "string",
scalars: {
DateTime: "string",
JSON: "Record<string, any>",
},
},
},
},
};
export default config;