-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcodegen.ts
34 lines (32 loc) · 937 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
import type { CodegenConfig } from '@graphql-codegen/cli';
import { ARBITRUM_SUBGRAPH } from './src/constants';
const config: CodegenConfig = {
schema: ARBITRUM_SUBGRAPH,
documents: ['src/**/!(*.d).{ts,tsx}'],
ignoreNoDocuments: true,
generates: {
'./src/lib/subgraph/codegen/': {
preset: 'client',
config: {
strictScalars: true,
scalars: {
ID: {
input: 'string | number | bigint | `0x${string}`',
output: 'string | `0x${string}`',
},
BigInt: { input: 'bigint', output: 'string' },
BigDecimal: { input: 'bigint', output: 'string' },
Bytes: '`0x${string}`',
Int8: 'number',
},
useTypeImports: true,
skipTypename: true,
enumAsTypes: true,
dedupeFragments: true,
avoidOptionals: true,
arrayInputCoercion: true,
},
},
},
};
export default config;