-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodegen.ts
More file actions
27 lines (25 loc) · 733 Bytes
/
codegen.ts
File metadata and controls
27 lines (25 loc) · 733 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
import {CodegenConfig} from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'shared/schema.graphql',
generates: {
'backend/src/graphql/resolvers.generated.ts': {
plugins: ['typescript', 'typescript-resolvers'],
config: {
avoidOptionals: true,
},
},
'frontend/src/graphql/graphql-types.generated.ts': {
plugins: ['typescript'],
},
'frontend/src/graphql': {
documents: 'frontend/src/graphql/**/*.graphql',
preset: 'near-operation-file',
plugins: ['typescript-operations', 'typescript-react-apollo'],
presetConfig: {
baseTypesPath: './graphql-types.generated.ts',
},
},
},
};
export default config;