-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcodegen.yml
42 lines (42 loc) · 1.23 KB
/
codegen.yml
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
overwrite: true
generates:
src/shared/__generated__/schema.graphql:
schema:
- ./src/resolvers/**/*.graphql
# - ./src/shared/directive/*.graphql
plugins:
- schema-ast
config:
includeDirectives: true
src/shared/__generated__/types.ts:
schema:
- ./src/resolvers/**/*.graphql
# - ./src/shared/directive/*.graphql
plugins:
- add:
content: |
/* eslint-disable */
type FirstTypeResolveFnParams<T> = T extends TypeResolveFn<infer U, infer V, infer W> ? U : never;
export type NodeResolveType = FirstTypeResolveFnParams<NodeResolvers['__resolveType']>;
- 'typescript'
- 'typescript-resolvers'
config:
contextType: ../types#ApolloContext
noNamespaces: true
mappers:
User: ~/shared/entity/user.entity#UserEntity
Article: ~/shared/entity/article.entity#ArticleEntity
src/shared/__generated__/typeDefs.ts:
schema:
- ./src/resolvers/**/*.graphql
# - ./src/shared/directive/*.graphql
plugins:
- add:
content: |
const typeDefs = `
- schema-ast
- add:
placement: 'append'
content: |
`
export default typeDefs