question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
gschiercommented, Jan 30, 2018

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 👍

1reaction
rogeraimecommented, Oct 16, 2020

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!

att1 att2

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found