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.
I agree that this would be a great enhancement to the app.
Just wanted to clarify quickly that Insomnia _does_ send operationName but 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 ๐
It would be nice also to decide which operation to run based on the position of the text cursor:
If a user press cmd+enter maybe it is possible to know the position of the cursor inside the GraphQL query, and then automatically choose the operation in which the cursor is blinking.
This is a default behaviour for the GraphiQL IDE
This is done now!

Thanks @bwlt for the awesome work ๐ ๐
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!