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

[lsp-server] 🐞 VSCode validation error Unknown fragment in v0.11.0 #3620

Open
1 task done
minami-minami opened this issue Jun 6, 2024 · 5 comments
Open
1 task done
Labels
bug lsp-server graphql-language-service-server

Comments

@minami-minami
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I get errors after updating “GraphQL: Language Feature Support” to v0.11.0.

image

  • FooFragment is defined another file.
  • No errors if defined in the same file.

Expected Behavior

No errors when using fragments from another files.

Steps To Reproduce

  1. define fragment
  2. define query or fragment in another file.
  3. use fragment defined in step 1

Environment

  • LSP Server Version: latest
  • OS: macOS 13.5.1
  • LSP Client: VSCode v1.89.1
  • graphql: v16.8.1

Anything else?

No response

@minami-minami minami-minami added bug lsp-server graphql-language-service-server labels Jun 6, 2024
@sbiallas
Copy link

sbiallas commented Jun 14, 2024

I have the same problem. I use GraphQl-Codegen with the client preset, which works as expected. I get syntax highlighting and autocomplete options inside the gql tags. But when I use fragments from other files their are not recognized. I had these fragments also working, also with the fragment names showing up as autocomplete options, but I can't reproduce it. When I rename the generated gql tag to e.g. graphql and adjust the imports suddenly the errors disappear and I get also the right autocomplete options, but after next reload of vscode the errors are there again and autocomplete stops working. I got error messages inside the LSP output for I guess every file which contains a gql tag:
image

@jordanweaver
Copy link

jordanweaver commented Jun 14, 2024

I also noticed this behavior and it was even more subtle in my case... all I had to do was simply open the file containing the fragment and then the error disappeared in the file/query where the fragment was spread. But it would come back with any reload or edit.

Not sure how recommended it is, but I opted to manually downgrade through VS Code's extension manager, where it seems 0.9.3 was the last version prior to 0.11.0:

@sbiallas
Copy link

I also noticed this behavior and it was even more subtle in my case... all I had to do was simply open the file containing the fragment and then the error disappeared in the file/query where the fragment was spread. But it would come back with any reload or edit.

Not sure how recommended it is, but I opted to manually downgrade through VS Code's extension manager, where it seems 0.9.3 was the last version prior to 0.11.0:

Did the same and worked for me!

@VinceBT-BG
Copy link

This is kind of a breaking bug, all fragments have broken in my project as well

@pronovaso
Copy link

Confirm same bugs as mentioned here.

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

No branches or pull requests

5 participants