Describe the bug
Router returns INTERNAL_SERVER_ERROR with “empty query plan” when all planned fields are excluded via @include(false) and only __typename remains.
To Reproduce
Steps to reproduce the behavior:
- Submit a request like (an operation where):
mutation UpdateRoom($input: RoomUpdateDto!) { updateRoom(input: $input) @include(if: false){ id name } __typename }
- See error response:
{ "errors": [
{
"message": "value retrieval failed: empty query plan. This behavior is unexpected and we suggest opening an issue to apollographql/router with a reproduction.",
"extensions": {
"code": "INTERNAL_SERVER_ERROR"
}
}
]
}
Expected behavior
A valid data response without internal error, with __typename resolved. e.g. {"data": {"__typename": "Mutation"}}
Environment:
Router version: v1.59.1
Federation/supergraph
Additional context
I also reproduced it with the query GraphQL requests, not only the mutation. e.g.
query GetRoomsForUser {
Room @include(if: false) {
getRoomsForUser {
edges {
node { id }
}
}
}
__typename
}
If I change @include(if: false) to true, the request works as expected.
Tried Apollo-Expose-Query-Plan: true, but the environment doesn’t return extensions.queryPlan even for successful requests (which suggests the plugin might be disabled).
Can be related to #6154
Describe the bug
Router returns INTERNAL_SERVER_ERROR with “empty query plan” when all planned fields are excluded via @include(false) and only __typename remains.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A valid data response without internal error, with __typename resolved. e.g. {"data": {"__typename": "Mutation"}}
Environment:
Router version: v1.59.1
Federation/supergraph
Additional context
I also reproduced it with the query GraphQL requests, not only the mutation. e.g.
If I change @include(if: false) to true, the request works as expected.
Tried Apollo-Expose-Query-Plan: true, but the environment doesn’t return extensions.queryPlan even for successful requests (which suggests the plugin might be disabled).
Can be related to #6154