relay
relay copied to clipboard
[relay-lsp] Fails to start with incomplete executable document
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.
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!