-
Notifications
You must be signed in to change notification settings - Fork 2
/
codegen.yml
56 lines (54 loc) · 1.56 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
overwrite: true
schema:
- ./schema.graphql
- ./client/app/apollo/typedefs.ts
documents:
- '**/*.{ts,tsx}'
# Ignore test files and dependencies
- '!**/*.test.ts'
- '!node_modules/**/*.ts'
generates:
./client/shared/types.ts:
documents:
- client/**/*.{ts,tsx}
config:
scalars:
BigInt: number
Date: Date
DateTime: Date
strictScalars: true # Throws an error if a custom scalar is missing from this config
preResolveTypes: true # Simplifies the generated types
namingConvention:
typeNames: keep
enumValues: keep
avoidOptionals: # Avoids optionals on the level of the field
field: true
nonOptionalTypename: true # Forces `__typename` on all selection sets
skipTypeNameForRoot: true # Don't generate __typename for root types
dedupeFragments: true
dedupeOperationSuffix: true
omitOperationSuffix: true
enumsAsConst: true
maybeValue: T | null
useIndexSignature: true
withHooks: true
flattenGeneratedTypes: true
inputMaybeValue: T | null | undefined
plugins:
- typescript
- typescript-resolvers
- typescript-operations
- typescript-apollo-client-helpers
- add:
content: '/* eslint-disable */'
./graphql/__generated__/resolvers-types.ts:
config:
useIndexSignature: true
enumsAsConst: true
mappers:
Loan: '@prisma/client#Loan as LoanModel'
plugins:
- add:
content: '/* eslint-disable */'
- typescript
- typescript-resolvers