99designs / 99designs/gqlgen

Federation with dataloader grouping

Đang mở
#3,224 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Go
Star
10.8k
Fork
1.3k
Merge trung bình
2 ngày 36 phút
Pull request đã merge (30 ngày)
26

Mô tả

### What happened?

I have multiple graphs that are federated with an Apollo Router. For example, I have a sample query of:

```
graph1field(id: "some-uuid") {
id
graph2field {
id
name
graph3field {
id
name
}
}
}
```

The results of graph3field are not grouped to the proper graph2field. Let's say there are many graph3fields that belong to the last graph2field result, the results are not grouped to where they should be. Sample response:

```
{
"data": {
"graph1field": {
graph2field {
id
name
graph3field: []
},
graph2field {
id
name
graph3field: [
id
name
]
},
graph2field {
id
name
graph3field: [
id
name
]
}
}
}
}
```

Most of the time the graph3field are mixed into the incorrect graph2field.

### What did you expect?

I expect the correct grouping to happen. When I remove the dataloder referenced in your examples: dataloadgen, everything is in the correct group. However, the n+1 problem comes back.

I expect the following response always:

```
{
"data": {
"graph1field": {
graph2field {
id
name
graph3field: []
},
graph2field {
id
name
graph3field: []
},
graph2field {
id
name
graph3field: [
{
id
name
},
{
id
name
}
]
}
}
}
}
```

### Minimal graphql.schema and models to reproduce

Unfortunately, I can't share the real schema.

### versions
- `go run github.com/99designs/gqlgen version`?
v0.17.49
- `go version`?
go version go1.22.0 windows/amd64

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.