graphiql icon indicating copy to clipboard operation
graphiql copied to clipboard

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

Open hayes opened this issue 2 years ago • 3 comments

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

hayes avatar Dec 04 '23 18:12 hayes

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

acao avatar Dec 05 '23 02:12 acao

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

ThisMeansMore avatar Mar 04 '24 11:03 ThisMeansMore

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 avatar Mar 04 '24 13:03 acao