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

fix: hover log #1481

Closed
wants to merge 1 commit into from
Closed

fix: hover log #1481

wants to merge 1 commit into from

Conversation

divyenduz
Copy link
Contributor

If there was an error in schema parsing, the hover handler silently
fails.

The aim of this PR is to raise the issue, the fix might be added at
another level (and maybe even needed at other places).

For this PR, we re-throw the error.

After this PR, invalid schema yields:
CleanShot 2020-04-11 at 03 14 10@2x

P.S. the tests are much faster now! All of them took like 18s on my machine 🙌

If there was an error in schema parsing, the hover handler silently
fails.

The aim of this PR is to raise the issue, the fix might be added at
another level (and maybe even needed at other places).

For this PR, we re-throw the error.

Co-authored-by: huv1k <[email protected]>
@acao
Copy link
Member

acao commented Apr 11, 2020

@divyenduz we should wrap all the errors at the top, then!

the schema error being trapped was there from before so I kept it, assumed there was a reason it would make so much sense to remove, but i noticed it during a refactor, so I wasn't able to remove it then.

this is why i added a try/catch to startServer() but i removed it. let's remove the try/catch from hover, and bubble it up to where this function is called, so we can trap all the errors from LSP methods in one place.

How is the behavior without a graphql config? Does this throw lots of errors?

@acao
Copy link
Member

acao commented Apr 11, 2020

@divyenduz thanks for opening this and showing more initiative on this! this approach should work across the board:
https://github.com/graphql/graphiql/pull/1482/files

@acao
Copy link
Member

acao commented Apr 11, 2020

closing for #1482! confirmed it fixes this bug and many others. thanks @divyenduz !

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

Successfully merging this pull request may close these issues.

2 participants