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] 🐞 Fragment names are cached and not updated #3469

Open
1 task done
hayes opened this issue Dec 4, 2023 · 3 comments
Open
1 task done

[lsp-server] 🐞 Fragment names are cached and not updated #3469

hayes opened this issue Dec 4, 2023 · 3 comments
Labels
bug lsp-server graphql-language-service-server

Comments

@hayes
Copy link

hayes commented Dec 4, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When new tagged template literals with fragments are added, or the name of a fragment changes, you can't reference the new fragment name in a query until the lsp is restarted.

Queries referencing a removed, or changed fragment name are also not marked as invalid until the lsp is restarted

Expected Behavior

When fragment names change queries referencing those fragments should be marked as invalid, and when new fragments are added, they should be usable without a validation error without restarting the lsp

Steps To Reproduce

Close https://github.com/hayes/graphql-lsp-fragment-bug
Open it in vscode or other editor with graphql lsp
Edit a file the fragment name in index.js and see that the query doesn't become invalid
update the query to match the new name, and see that the new fragment name is unknown

Environment

  • LSP Server Version: 2.11.6
  • OS: macOs 14.1.2
  • LSP Client: vscode plugon :GraphQL: Language Feature Support v0.8.20

Anything else?

No response

@hayes hayes added bug lsp-server graphql-language-service-server labels Dec 4, 2023
@acao
Copy link
Member

acao commented Dec 5, 2023

I will link this one with all the existing duplicates tickets next week

@cesek-navisys
Copy link

As a workaround you can VSCode GraphQL: Manually Restart to reload the changes.

@acao
Copy link
Member

acao commented Mar 4, 2024

Yes this is what users do when they find this bug usually

@cesek-navisys please try the pre-release in #3521 to see if that fixes your issue, you should not need to manually restart after installing this soon-to-be-released version. we have tests that confirm this will work in 0.10.0

@acao acao mentioned this issue May 28, 2024
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

3 participants