-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcodegen.ts
More file actions
66 lines (64 loc) · 1.87 KB
/
codegen.ts
File metadata and controls
66 lines (64 loc) · 1.87 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
overwrite: true,
schema: process.env.GRAPHQL_SCHEMA_URL || 'https://v3.dscrs.site/graphql',
documents: [
'src/graphql/queries/**/*.ts',
'src/**/*.{ts,tsx}',
'!src/graphql/generated/**',
'!src/graphql/mutation/chat/**',
'!src/graphql/query/chat/**',
'!src/graphql/mutation/notifier/**',
'!src/graphql/query/notifier/**',
// Исключаем все документы из inbox для избежания конфликтов
'!src/graphql/mutation/inbox/**',
'!src/graphql/query/inbox/**'
],
generates: {
'./src/graphql/generated/introspection.json': {
plugins: ['introspection'],
config: {
minify: true
}
},
'./src/graphql/generated/schema.graphql': {
plugins: ['schema-ast'],
config: {
includeDirectives: false
}
},
'./src/graphql/generated/': {
preset: 'client',
plugins: [],
presetConfig: {
gqlTagName: 'gql',
fragmentMasking: false
},
config: {
scalars: {
DateTime: 'string',
JSON: 'Record<string, any>'
},
// Настройки для правильной работы
skipTypename: false,
useTypeImports: true,
dedupeOperationSuffix: true,
dedupeFragments: true,
// Избегаем конфликтов при объединении
avoidOptionals: false,
enumsAsTypes: false
}
}
},
// Глобальные настройки для правильной работы
config: {
skipTypename: false,
useTypeImports: true,
dedupeOperationSuffix: true,
dedupeFragments: true,
// Настройки для объединения схем
avoidOptionals: false,
enumsAsTypes: false
}
}
export default config