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

Language server unknown fragment inconsistency #1963

Closed
p-szm opened this issue Oct 4, 2021 · 2 comments · Fixed by #1964
Closed

Language server unknown fragment inconsistency #1963

p-szm opened this issue Oct 4, 2021 · 2 comments · Fixed by #1964
Assignees
Labels
bug lsp-server graphql-language-service-server

Comments

@p-szm
Copy link
Contributor

p-szm commented Oct 4, 2021

When using a fragment that's not defined, the language server correctly reports the error:

Screenshot 2021-10-04 at 18 25 58

however, after saving the file, the error disappears:

Screenshot 2021-10-04 at 18 26 05

This seems to be due to the fact that when a file is modified, we call getDiagnostics with only two arguments (and isRelayCompatMode defaults to false):

const results = await this._languageService.getDiagnostics(query, uri);

while when a file is saved, we call getDiagnostics with three arguments, and for some reason we invert the value of isRelayCompatMode:

const results = await this._languageService.getDiagnostics(
query,
uri,
this._isRelayCompatMode(query) ? false : true,
);

@p-szm
Copy link
Contributor Author

p-szm commented Oct 4, 2021

I opened a PR that I believe is a fix for this #1964

@ebsangam
Copy link

It is happening again.

@thomasheyenbrock thomasheyenbrock added the lsp-server graphql-language-service-server label Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug lsp-server graphql-language-service-server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants