-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcodegen.ts
39 lines (36 loc) · 1018 Bytes
/
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
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
schema: 'https://api.studio.thegraph.com/query/71118/ssv-network-ethereum/version/latest',
documents: ['src/**/*.graphql'],
ignoreNoDocuments: true,
generates: {
'./src/graphql/': {
preset: 'client',
config: {
scalars: {
BigInt: 'string', // or 'string' if you prefer string representation
BigDecimal: 'string',
Bytes: 'Address',
Account: 'Address',
},
additionalImports: ['import { type Address } from "viem"'],
skipTypename: true,
},
plugins: [
{
add: {
content: "import { type Address } from 'viem';",
},
},
],
// plugins: ['typescript', 'typescript-operations', 'typescript-graphql-request'],
},
'./schema.graphql': {
plugins: ['schema-ast'],
config: {
includeDirectives: true,
},
},
},
}
export default config