forked from base-org/onchainsummer.xyz
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
36 lines (33 loc) · 881 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
import type { CodegenConfig } from '@graphql-codegen/cli'
import { loadEnvConfig } from '@next/env'
const { combinedEnv } = loadEnvConfig('.')
const config: CodegenConfig = {
overwrite: true,
schema: combinedEnv.NEXT_PUBLIC_AARWEAVE_API_URL,
documents: ['src/graphql/**/*.gql'],
generates: {
'src/graphql/_generated/types.ts': {
plugins: ['typescript', 'typescript-operations'],
config: {
avoidOptionals: {
field: true,
inputValue: false,
object: true,
defaultValue: true,
},
declarationKind: 'interface',
},
},
'src/graphql/_generated/sdk.ts': {
preset: 'import-types',
presetConfig: {
typesPath: './types',
},
plugins: ['typescript-graphql-request'],
config: {
avoidOptionals: true,
},
},
},
}
export default config