"Must be called from within _entities" on cyclic federated request
- 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ả
## The Config
`gqlgen.yml`:
```
federation:
filename: graph/federation.go
package: graph
version: 2
options:
computed_requires: true
call_argument_directives_with_null: true
```
## The Schemas
`serviceA.graphqls`:
```
type Query {
entityA(entityAId: String!): EntityA
}
type EntityA @key(fields: "entityAId") {
entityAId: String!
entityB: EntityB @provides(fields: "entityBId")
}
type EntityB @key(fields: "entityBId") @extends {
entityBId: String! @external
entityA: EntityA @requires(fields: "entityBId")
}
```
`serviceB.graphqls`:
```
type Query {
entityB(entityBId: String!): EntityB
}
type EntityB @key(fields: "entityBId") {
entityBId: String!
}
```
## The Test
Request through Apollo Router:
```
query Query {
entityA(entityAId: "EntityAId") {
entityAId
entityB {
entityBId
entityA {
entityAId
}
}
}
}
```
Response:
```
{
"data": {
"entityA": {
"entityAId": "EntityAId",
"entityB": {
"entityBId": "EntityBId",
"entityA": null
}
}
},
"errors": [
{
"message": "must be called from within _entities",
"path": [
"entityA",
"entityB",
"entityA"
],
"extensions": {
"service": "serviceA"
}
}
]
}
```
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.