graphql / graphql/graphiql

[graphiql] Unknown operation named 'xyz'

Open
#3,632 4 comments 4 reactions 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### Is there an existing issue for this?

- [X] 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.