-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
If you hover at the beginning of the query editor, it shows an error
Error: Expected Parser stream to be available
When I first filed the issue I thought this could be fixed in the GraphQLWorker file -> doHover function by changing to return early
const hover = this._languageService.getHover(uri, document, graphQLPosition);
if (!hover) return;
but a couple days after I filed this issue I realized it also occurs if I hover later in the first line and think it may be the same issue as #3168 from a few years ago.
I think it can be fixed by changing graphql-language-service -> interface -> getDiagnostics -> getRange
(let i = 0; i < location.line; i++) {
to
for (let i = 0; i <= location.line; i++) {
Expected Behavior
Should not throw Error: Expected Parser stream to be available in the UI console.
Steps To Reproduce
To reproduce go to the swapi or netlify demos from the graphiql docs, open the UI console, and hover at position 0.
Environment
- GraphiQL Version: 5.2.2
- OS: Mac Sequoia 15.7.3 (24G419)
- Browser: Chrome
- Bundler: tried with vite and esbuild and the demos
reactVersion: 16.12graphqlVersion: 18.2
Anything else?
No response