relay icon indicating copy to clipboard operation
relay copied to clipboard

[relay-lsp] Fails to start with incomplete executable document

Open tobias-tengler opened this issue 9 months ago • 1 comments

If your code contains some invalid graphql tagged literal like:

const query = graphql`query`

And you restart the Relay LSP, you always get the following LSP error on hover, complete, etc.

get_schema: schema is missing (or not ready, yet) for the default project

Once you remove or properly write out the offending graphql tagged literal everything works again.

I would expect the LSP to just skip over such incomplete definitions at startup instead of just failing.

tobias-tengler avatar Sep 21 '23 19:09 tobias-tengler

This actually happens if there are any errors in executable documents when starting the LSP. We got multiple reports from product engineers that autocompletion is no longer working, because they were working on some unfinished query like

query TestQuery {
  linkedField {
    # no selections
  }
}

and restarted their editor, causing the LSP to not start correctly.

This feels like a major usability problem!

tobias-tengler avatar Jan 16 '24 10:01 tobias-tengler