feat(portal-shell): add graphql-codegen configuration
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 文件后启用
This commit is contained in:
30
apps/portal-shell/codegen.yml
Normal file
30
apps/portal-shell/codegen.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user