-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcodegen.ts
More file actions
26 lines (24 loc) · 760 Bytes
/
codegen.ts
File metadata and controls
26 lines (24 loc) · 760 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
import type { CodegenConfig } from '@graphql-codegen/cli'
const config: CodegenConfig = {
schema: 'src/graphql/schema/**/*.graphql',
generates: {
'src/graphql/__generated__/resolvers-types.ts': {
plugins: ['typescript', 'typescript-resolvers'],
config: {
useTypeImports: true,
contextType: '../context.js#GraphQLContext',
defaultMapper: 'unknown',
maybeValue: 'T | null',
scalars: {
ID: 'string',
},
mappers: {
Book: '../../generated/prisma/models/Book.js#BookModel',
Poem: '../../services/poetry/poetry-client.js#PoemRecord',
Poet: '../../services/poetry/poetry-client.js#PoetRecord',
},
},
},
},
}
export default config