CollectFields() not merging Fragment with custom addition
- 主要语言
- Go
- 星标
- 10.8k
- 派生
- 1.3k
- 平均合并
- 2 天 36 分钟
- 30 天内合并 PR
- 26
描述
### What happened?
```graphql
fragment House on House {
id,state{foobar}
}
query getHouses {
houses{...House,state{barfoo}}
}
```
When using `CollectFields(ctx)` you get only the fields collected from `fragment House`.
### What did you expect?
A merge of given fragment and additional fields.
### Minimal graphql.schema and models to reproduce
```graphql
type Query {
houses: [House!]
}
type House {
id: ID
state: HouseState
}
type HouseState {
foobar: String
barfoo: String
}
```
### versions
- `gqlgen version`? `v0.12.2-dev`
- `go version`? `go1.15 windows/amd64`
- dep or go modules? `go modules`
贡献指南
调研方向
问题出在 CollectFields() 函数中,可能位于代码生成或字段收集逻辑中。首先检查 gqlgen 中与字段收集相关的源代码,尤其是片段合并部分。查看测试套件中的类似案例,以了解预期行为。修复需要确保来自片段和内联选择的字段都能正确合并。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- go, graphql
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100