-
Notifications
You must be signed in to change notification settings - Fork 0
/
codegen.ts
36 lines (33 loc) · 958 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'
require('dotenv').config({ path: '.env.local' })
const config: CodegenConfig = {
overwrite: true,
schema: [
{
[process.env.NEXT_PUBLIC_HASURA_PROJECT_ENDPOINT!]: {
headers: {
'x-hasura-admin-secret': process.env.NEXT_PUBLIC_HASURA_ADMIN_SECRET!,
},
},
},
],
// schema: 'schema.graphql',
documents: [
'repositories/get*Data.ts',
'graphqls/**/*.graphql',
'pages/**/*.tsx',
'components/**/*.tsx',
], // пример, как можно с отрицанием: ['src/**/*.tsx', '!src/gql/**/*'],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
'generated/': {
preset: 'client',
plugins: [],
},
// если хочется выгрузить интроспекцию
// './schema.json': {
// plugins: ['introspection'],
// },
},
}
export default config