-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
42 lines (40 loc) · 1.12 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
import type { CodegenConfig } from "@graphql-codegen/cli";
import { loadEnvConfig } from "@next/env";
loadEnvConfig(process.cwd());
// Paths relative to project root
const config: CodegenConfig = {
overwrite: true,
schema: `https://gateway-arbitrum.network.thegraph.com/api/${process.env.SUBGRAPH_API_KEY!}/deployments/id/Qma9vGcUHz6pUeRTcHzU64yuS4i4dBxKh3TKKrXY3ckNas`, // Just used to get schema
// schema: `http://192.168.1.64:8000/subgraphs/name/papercliplabs/compound-v3-local`,
documents: "src/data/**",
generates: {
"src/data/graphql/generated/": {
preset: "client",
config: {
documentMode: "string",
scalars: {
BigDecimal: {
input: "string",
output: "string",
},
BigInt: {
input: "string",
output: "string",
},
Int8: {
input: "any",
output: "string",
},
Bytes: {
input: "any",
output: "string",
},
},
mappers: {
BigInt: "bigint",
},
},
},
},
};
export default config;