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
GraphQL request are adding field "operationName" which results in a failed call. #5698
Comments
We are seeing this same issue in |
In versions after {
user {
name
}
} Insomnia is passing the query with operationName as an empty string like: {"query":"{\n\tuser {\n\t\tname\n\t}\n}","operationName":""} Whereas in version {"query":"{\n\tuser {\n\t\tname\n\t}\n}","variables":null,"operationName":null} The GraphQL spec outlines how GraphQL servers should handle the operationName and specifically calls out the cases as either being null or an operation name defined in the document. So for an anonymous operation definition, I think operationName should either not be passed, or specifically set to null. |
Hi folks, this should be fixed on latest 2022.7.5 |
I'm still getting this issue. Version: Insomnia 2022.7.5 Request in Insomnia:
Actual request sent:
|
Same here. Please reopen this issue ! |
Same. It won't work. For some reason, newly created requests are not functioning while existing requests are working properly. |
Just started experiencing this issue after and update:
Returns on GQL queries are: {
"errors": [
{
"errorType": "BadRequestException",
"message": "No operation matches the provided operation name ."
}
]
} |
I can confirm it still happened to me in 2022.7.5. But restarting Insomnia helped eventually... |
Creating a new request (NOT duplicating a bugged one) and copying the query/mutation seems to be a workaround |
+1. Running 2022.7.5, when duplicating a query, I get the extra |
I second this. This seems to have fixed it. |
I wasted time looking for a problem somewhere else, until I realized that it was Insomnia setting this field to I can't tell for sure whether this happens only to queries created by duplicating another (although this seems to be the case), but I found a simpler workaround than recreating from scratch or going through curl: Notice the "Operations" label below? That's the Edit: Your query has to have a name for the name to be pre-populated, like |
Version |
It also worked for me. Thanks! Would like to summarise.. One need to select a blank field from empty dropdown. If not |
It also prevent the schema from being fetched as the introspection query contains |
Also seeing this in @filfreire Can we re-open this or would you like a new issue? |
@xarses if possible please create a new issue. If you have any screenshots or recordings of this issue happening that would be helpful. Thank you in advance! |
This is still happening and can be easily reproduced, could be an edge case left over. First, send a GraphQL query with an operation name (can be anything), the query will succeed as the I'm testing with the most recent 8.6.0 version. cc: @filfreire |
This caused me a lot of trouble. I'm on v8.6.1. bump edit: Don't quite have the time to look into the bug report here and all the comments, but my experience has been:
Apologies if this is considered a separate issue, please consider looking into this. It basically makes GraphQL unusable in Insomnia, which I think should be treating GQL as a first class citizen. In fairness of not opening a new issue, the "Operations" default string is still lingering. cc @filfreire |
Expected Behavior
The query string should not have the field "operationName" added.
Eg. Supplied query string:
should results in:
Actual Behavior
Insomnia adds the field "operationName" to the query string, which causes the request to fail.
Eg. Supplied query string:
results in:
Reproduction Steps
Just create a new GraphQL request. Normally this does not happen. But it some point insomnia will start to add this field. And ones it does it keeps adding it all the time.
I do not see anyway to get it to work again, besides deleting the whole request entry and create it completely from scratch.
Is there an existing issue for this?
Additional Information
No response
Insomnia Version
2022.7.4
What operating system are you using?
macOS
Operating System Version
13.0.1
Installation method
download
Last Known Working Insomnia version
No response
The text was updated successfully, but these errors were encountered: