graphql / graphql/graphiql

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

Open
#3,469 3 comments 0 reactions 0 assignees View on GitHub
bug lsp-server
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.