insomnia icon indicating copy to clipboard operation
insomnia copied to clipboard

Unknown operation GraphQL error, when you alter a query name

Open narration-sd opened this issue 7 years ago • 7 comments

  1. Have a named query, introduced as shown, which will work fine if it's otherwise good (even on a hello-world for your GraphQL:
    query SomeName {
  1. Now change it a little, leaving the cursor where it ends up after typing:
    query SomeNamex {

Mouse Send, and you'll get an odd error, looking like it's GraphQL's:

{
  "errors": [
    {
      "message": "Unknown operation named \"SomeName\".",
      "category": "graphql"
    }
  ]
}
  1. But. now click to move the cursor somewhere else, like in your query, or in the query args Send again. Then your query works.

Insomnia versions: 7.0, also the one before that, where I first saw it Platform: Windows 10, very latest, updates to moment.

narration-sd avatar Oct 06 '19 21:10 narration-sd

👋 Thanks for opening your first issue! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. If you're requesting a feature 🎁, please provide real use cases that would benefit. 👪

To help make this a smooth process, please be sure you have first read the contributing guidelines.

welcome[bot] avatar Oct 06 '19 21:10 welcome[bot]

confirmed fix on 7.0.1

narration-sd avatar Oct 09 '19 23:10 narration-sd

We just encountered an issue exactly like this in version 2022.7.4, except with a query that omitted the operation name.

mpcarolin avatar Jan 17 '23 19:01 mpcarolin

Also just found my way here after running into this issue with an unnamed query operation, though I'm on version 2022.7.2 Confirmed that adding a name to query was the only thing that seemed to make it work. image

philfi avatar Jan 20 '23 20:01 philfi

Also on 2022.7.4, running into this intermittently, on queries with and without operation names.

Sometimes can be solved by adding or tweaking an operation name, sometimes not.

anandaroop avatar Jan 20 '23 21:01 anandaroop

Same here. Updated to 2022.7.5 and running into the same issue. Can't think of a stable way to reproduce tho: sometimes it just fails for me in one request tab, but continues to work for another, without any changes in any of the tabs.

Stepaladin avatar Feb 06 '23 16:02 Stepaladin

Same for me today with 2022.7.5. @anandaroop's solution worked, but in my case, the queries were already named, so, I deleted the name from query myQuery { and added it back.

royriver23 avatar Feb 18 '23 15:02 royriver23