-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcodegen.ts
59 lines (56 loc) · 1.85 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
55
56
57
58
59
import { CodegenConfig } from "@graphql-codegen/cli";
import { getBondsSubgraphUrl, getPriceSnapshotSubgraphUrl, getRbsSubgraphUrl } from "./src/constants";
const config: CodegenConfig = {
generates: {
"src/graphql/bondMarket.ts": {
schema: getBondsSubgraphUrl(),
documents: "src/graphql/bondMarket.graphql",
plugins: ["typescript", "typescript-operations", "typed-document-node"],
config: {
preResolveTypes: true,
scalars: {
BigDecimal: "string",
BigInt: "string",
Bytes: "Uint8Array", // https://thegraph.com/docs/en/developing/assemblyscript-api/#bytes
},
},
hooks: {
afterOneFileWrite: ["yarn lint:fix", "patch -p0 < src/graphql/bondMarket.patch"],
},
},
"src/graphql/rangeSnapshot.ts": {
schema: getRbsSubgraphUrl(),
documents: "src/graphql/rangeSnapshot.graphql",
plugins: ["typescript", "typescript-operations", "typed-document-node"],
config: {
preResolveTypes: true,
scalars: {
BigDecimal: "string",
BigInt: "string",
Bytes: "Uint8Array", // https://thegraph.com/docs/en/developing/assemblyscript-api/#bytes
},
},
hooks: {
afterOneFileWrite: ["yarn lint:fix"],
},
},
"src/graphql/priceSnapshot.ts": {
schema: getPriceSnapshotSubgraphUrl(),
documents: "src/graphql/priceSnapshot.graphql",
plugins: ["typescript", "typescript-operations", "typed-document-node"],
config: {
preResolveTypes: true,
scalars: {
BigDecimal: "string",
BigInt: "string",
Bytes: "Uint8Array", // https://thegraph.com/docs/en/developing/assemblyscript-api/#bytes
},
},
hooks: {
afterOneFileWrite: ["yarn lint:fix"],
},
},
},
overwrite: true,
};
export default config;