-
Notifications
You must be signed in to change notification settings - Fork 1
/
codegen.js
31 lines (29 loc) · 847 Bytes
/
codegen.js
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
// eslint-disable-next-line @typescript-eslint/no-var-requires,import/no-extraneous-dependencies
const { loadEnvConfig } = require('@next/env')
loadEnvConfig(process.cwd())
const codeGenOutDir = process.env.CODEGEN_OUTPUT_FILE || 'types/generated/queries.ts'
module.exports = {
overwrite: true,
schema: [
// process.env.NEXT_PUBLIC_GRAPH_ENDPOINT_MAINNET,
process.env.NEXT_PUBLIC_GRAPH_ENDPOINT_OPTIMISM,
// process.env.NEXT_PUBLIC_GRAPH_ENDPOINT_GOERLI,
],
documents: 'src/queries/**/*.ts',
generates: {
[codeGenOutDir]: {
plugins: [
'typescript',
'typescript-operations',
'typescript-graphql-request',
'plugin-typescript-swr',
],
},
},
config: {
rawRequest: false,
// excludeQueries:
// useSWRInfinite: ['poolsCreated'],
autogenSWRKey: true,
},
}