Skip to content
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

[graphiql] Unknown operation named 'xyz' #3632

Open
1 task done
justinsumida opened this issue Jun 26, 2024 · 2 comments
Open
1 task done

[graphiql] Unknown operation named 'xyz' #3632

justinsumida opened this issue Jun 26, 2024 · 2 comments

Comments

@justinsumida
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Using the latest of GraphiQL from CDN, having multiple queries works on initial page load. Refreshing the browser ignores other queries/mutations and runs the first query.
I am unable to select any other query/mutation on the play button:

image As you can see, I have two different queries. When pressing the play button (or Control + Enter) I get the error. The query 'search' was originally the first query on the editor, but I removed it.

Expected Behavior

Whatever queries are on the editor should appear as options on the play button.

Steps To Reproduce

  1. Using latest GraphiQL version, create multiple queries. Refresh the page and attempt to run any other query other than the first one on the page.

Environment

  • GraphiQL Version: latest
  • OS: MacOS
  • Browser: Chrome
  • Bundler:
  • react Version: 16.8.3
  • graphql Version: GraphQL Java 21.3

Anything else?

No response

@justinsumida
Copy link
Author

This can also be reproduced on https://graphql.github.io/swapi-graphql

How I set it up:
Create two queries something like this:
image
Refresh the page...
I am unable to run "anotherOne"...all I can do is run "allFilms"
image
Better yet... if I remove "allFilms" I see this...
image

@justinsumida
Copy link
Author

Taking a look at what GraphQL receives:
image
image
The operation name does not match what is happening. So I see a couple of problems:

  1. The editor sometimes "forgets" or loses that there are multiple operations in the tab
  2. The operation name does not change when attempting to run an operation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant