mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(graphql): generate types from graphql files (#2014)
Co-authored-by: forehalo <forehalo@gmail.com> Co-authored-by: Himself65 <himself65@outlook.com>
This commit is contained in:
31
packages/graphql/codegen.yml
Normal file
31
packages/graphql/codegen.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
hooks:
|
||||
afterOneFileWrite:
|
||||
- prettier --write
|
||||
config:
|
||||
strict: true
|
||||
maybeValue: T | null
|
||||
declarationKind: interface
|
||||
avoidOptionals: true
|
||||
preResolveTypes: true
|
||||
onlyOperationTypes: true
|
||||
namingConvention:
|
||||
enumValues: keep
|
||||
scalars:
|
||||
DateTime: string
|
||||
Date: string
|
||||
Decimal: number
|
||||
UUID: string
|
||||
ID: string
|
||||
JSON: any
|
||||
overwrite: true
|
||||
schema: ../../apps/server/src/schema.gql
|
||||
documents: ./src/**/*.gql
|
||||
generates:
|
||||
./src/schema.ts:
|
||||
plugins:
|
||||
- typescript
|
||||
- typescript-operations
|
||||
- add:
|
||||
content: '/* eslint-disable */'
|
||||
- ./export-gql-plugin.cjs:
|
||||
output: ./src/graphql/index.ts
|
||||
Reference in New Issue
Block a user