Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending graphql request with empty string as operationName produce invalid response #4837

Open
IvanGoncharov opened this issue Mar 22, 2024 · 0 comments

Comments

@IvanGoncharov
Copy link
Member

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:

  1. Run following using starstuff:
    curl -H 'Content-Type: application/json' http://127.0.0.1:4000/ -d '{ "operationName": "", "query": "query { me { id } }" }'
  2. See {"data":null} as result

Expected behavior
It should be a response containing the error and without data.
image
https://spec.graphql.org/October2021/#GetOperation()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant