-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
42 lines (35 loc) · 893 Bytes
/
codegen.ts
File metadata and controls
42 lines (35 loc) · 893 Bytes
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
import type { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
// Point to your GraphQL API
schema: './apps/api/src/schema.gql',
// Find all GraphQL queries/mutations in your frontend
documents: [
'apps/web/src/**/*.tsx',
'apps/web/src/**/*.ts',
'apps/web/src/**/*.graphql',
],
// Generate types
generates: {
'./apps/web/src/generated/': {
preset: 'client',
presetConfig: {
fragmentMasking: false,
gqlTagName: 'gql',
},
config: {
useTypeImports: true,
skipTypename: false,
enumsAsTypes: true,
dedupeFragments: true,
avoidOptionals: false,
},
},
},
// Watch mode for development
watch: false,
// Show errors clearly
verbose: true,
// Don't exit on errors during development
ignoreNoDocuments: true,
};
export default config;