router
router copied to clipboard
Sending graphql request with empty string as operationName produce invalid response
Describe the bug Issue was reported by @bonnici in Slack: https://apollograph.slack.com/archives/C02UX05LF4K/p1710991184963719 Here is example of requests producing invalid responses:
{
"operationName": "",
"query": "query ExampleQuery { me { id } }"
}
Router responses with:
{"data":null}
To Reproduce Steps to reproduce the behavior:
- Run following using starstuff:
curl -H 'Content-Type: application/json' http://127.0.0.1:4000/ -d '{ "operationName": "", "query": "query { me { id } }" }' - See
{"data":null}as result
Expected behavior
It should be a response containing the error and without data.
https://spec.graphql.org/October2021/#GetOperation()