Is there an existing issue for this?
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
react Version: 16.12
graphql Version: 18.2
Anything else?
No response
Is there an existing issue for this?
Current Behavior
If you hover at the beginning of the query editor, it shows an error
Error: Expected Parser stream to be availableWhen I first filed the issue I thought this could be fixed in the GraphQLWorker file -> doHover function by changing to return early
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 availablein 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
reactVersion: 16.12graphqlVersion: 18.2Anything else?
No response