Reload schema in eslint-server if file with schema was changed
See original GitHub issueIs your feature request related to a problem? Please describe.
We open monorepo in VSCode where installed eslint with graphql-eslint plugin. And open some graphql
file in client
folder with query operation and decide to refactor server schema. We change code in the server
folder and after that, some watcher replaces schema.graphql
file with new type definitions. But eslint-server still checks graphql
operation in the client
folder with old schema (loaded on vscode start up).
Describe the solution you’d like
It will be nice if Eslint-server in VSCode automatically reloads graphql schema and does not use stale information for validation rules.
Describe alternatives you’ve considered
Run manually “Restart ESLint Server” command when schema.graphql file was changed.
Additional context
Especially it works funny when we use some graphql plugin for vscode and graphql-eslint simultaneously. After schema changes developer gets a validation error from vscode plugin for old field name
, and from graphql-eslint for the new value name123
. Most developers will be confused and think that both field names are incorrect.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:14 (4 by maintainers)
Top GitHub Comments
Hi @nodkz @jonnyasmar @joshribakoff-sm @SimonSimCity @Axedyson, @matthew-valenti, @acidoxee and @jonnyasmar ! Future release with cache invalidation could be tested in the following alpha version
3.13.0-alpha-20221024000319-1089aa0
I just wanted to add that in #985 I describe that this also affects linting of the schema in the backend, not just the operations in the frontend. The issue is not specific to monorepos or frontend operations 😃