[Feature Request] Support multiple operations by letting user choose operationName
See original GitHub issue- Insomnia Version: 5.12.4 (5.12.4.1752)
- Operating System: macOS Sierra 10.12.6
Details
When using another GraphQL client such as GraphiQL, if you have a body like:
query First {
thing
}
query Second {
thing
}
and you try to send the query, a drop-down menu will let you choose between First and Second. When using Insomnia, there is no prompt and the server may respond with an error message (ie: “Must provide operation name if query contains multiple operations.”).
Without this feature, queries that work in GraphiQL do not necessarily work in Insomnia since you are unable to send an operationName to the server without switching the request body to JSON.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (5 by maintainers)
Top Results From Across the Web
[Feature Request] Support multiple operations by letting user ...
Just wanted to clarify quickly that Insomnia does send operationName but it defaults to the first operation defined. A (horrible) workaround ...
Read more >How to Use GraphQL Operation Names and Variables - Shopify
In this tutorial, we explore GraphQL operation names and variables for Shopify app development.
Read more >How can I alias specific GraphQL requests in Cypress?
Here, I'm trying to use it to identify my specific graphQL query, which obviously won't work. Which leads me to my question: How...
Read more >Executing multiple queries concurrently
The multiple queries are executed in the same requested order. ... and then use that result to perform another operation), we can execute...
Read more >Configuring CORS - Apollo GraphQL Docs
For example, if you use a GraphQL client that performs GET requests without sending Content-Type , X-Apollo-Operation-Name , or Apollo-Require-Preflight headers ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I agree that this would be a great enhancement to the app.
Just wanted to clarify quickly that Insomnia does send
operationNamebut it defaults to the first operation defined. A (horrible) workaround would be to reorder the queries based on the one you want to send.Letting the user choose would definitely be a much better way to do it 👍
Hi, someone here know how to write a operations’s query in Multipart using Insomnia for testing single file Upload? I write my own but did not work and I received : { “timestamp”: 1602774721435, “status”: 422, “error”: “Unprocessable Entity”, “message”: “”, “path”: “/graphql” `} hier is my query : { “query”: “mutation ($numberPlate: String, $country: $String, $file: Upload) {createTicket(numberPlate: $numberPlate, country: $country, file: $file)}{ id, timestamp}”, “variables”: { “numberPlate”: “33333”, “country”: “xyz”, “file”: null } } Thk you in advance!