M1 Task 2: 配置 graphql-codegen 与 federation schema 预处理 - codegen.yml: schema 从 combined-schema.graphql 读取(federation 已剥离) - scripts/normalize-schema.ts: 把 7 个子图的 extend type Query 合并为 type Query - package.json: 新增 codegen/codegen:watch scripts + 4 个 codegen deps + tsx - .gitignore: 忽略 src/lib/api/__generated__/ - documents 配置暂注释,Task 3 创建 operations 文件后启用
31 lines
925 B
YAML
31 lines
925 B
YAML
# graphql-codegen configuration
|
|
#
|
|
# Schema source: combined-schema.graphql (generated by scripts/normalize-schema.ts
|
|
# from services subgraph SDL files, with federation `extend type Query` normalized).
|
|
#
|
|
# Subgraph list (7 with GraphQL): iam / config-service / core-edu / content /
|
|
# msg / data-ana / ai (classes has no GraphQL subgraph yet).
|
|
#
|
|
# Outputs:
|
|
# - __generated__/types.ts: all GraphQL schema types (always generated)
|
|
# - __generated__/operations.ts: TypedDocumentNode (enabled after Task 3 creates
|
|
# operations/*.graphql.ts files)
|
|
#
|
|
# Related: spec section 2.4
|
|
|
|
schema: src/lib/api/__generated__/combined-schema.graphql
|
|
|
|
# documents: src/lib/api/operations/**/*.graphql.ts
|
|
# (re-enabled in Task 3 after operations files exist)
|
|
|
|
generates:
|
|
src/lib/api/__generated__/types.ts:
|
|
plugins:
|
|
- typescript
|
|
|
|
config:
|
|
preResolveTypes: true
|
|
skipTypename: true
|
|
exportTypeKeyOnly: true
|
|
useTypeImports: true
|