-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathcodegen.ts
More file actions
28 lines (26 loc) · 1.03 KB
/
codegen.ts
File metadata and controls
28 lines (26 loc) · 1.03 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
import type { CodegenConfig } from "@graphql-codegen/cli";
import "dotenv/config";
import { DEFAULT_CHAIN_ID, INFO_GRAPH_URL, LIMIT_ORDERS_GRAPH_URL, FARMING_GRAPH_URL, BLOCKS_GRAPH_URL } from "./config";
const config: CodegenConfig = {
overwrite: true,
schema: [INFO_GRAPH_URL[DEFAULT_CHAIN_ID], LIMIT_ORDERS_GRAPH_URL[DEFAULT_CHAIN_ID], FARMING_GRAPH_URL[DEFAULT_CHAIN_ID], BLOCKS_GRAPH_URL[DEFAULT_CHAIN_ID]],
documents: "src/graphql/queries/!(*.d).{ts,tsx}",
generates: {
"src/graphql/generated/graphql.tsx": {
plugins: ["typescript", "typescript-operations", "typescript-react-apollo"],
config: {
withHooks: true,
withResultType: true,
scalars: {
BigInt: "string",
BigDecimal: "string",
Bytes: "string",
Int8: "number",
Int: "number",
Timestamp: "number",
},
},
},
},
};
export default config;