"Must be called from within _entities" on cyclic federated request
- Dominant language
- Go
- Stars
- 10.8k
- Forks
- 1.3k
- Avg merge
- 2d 36m
- Merged PRs (30d)
- 26
Description
## 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"
}
}
]
}
```
Contributor guide
Assessment
This issue has not been assessed yet.