[lsp-server] 🐞 Fragment names are cached and not updated
Is there an existing issue for this?
- [X] 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
I will link this one with all the existing duplicates tickets next week
As a workaround you can VSCode GraphQL: Manually Restart to reload the changes.
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