question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reload schema in eslint-server if file with schema was changed

See original GitHub issue

Is 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.

Screen Shot 2021-08-23 at 23 15 11 Screen Shot 2021-08-23 at 23 14 58

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
B2o5Tcommented, Oct 30, 2022

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

3reactions
joshribakoff-smcommented, Mar 8, 2022

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 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reload schema in eslint-server if file with schema was changed
We open monorepo in VSCode where installed eslint with graphql-eslint plugin. And open some graphql file in client folder with query operation and...
Read more >
All of my .json files have problems loading reference/schema ...
I just turned off checkbox schema download and error gone. Press F1 and follow open user settings/user/extentions/JSON.
Read more >
Working with Rules - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
ESLint | WebStorm Documentation - JetBrains
To configure ESLint automatically in the current project, open the Settings/Preferences dialog ( Ctrl+Alt+S ), go to Languages & Frameworks | ...
Read more >
Multi-root Workspaces in Visual Studio Code
Settings like files.exclude are supported for each root folder if configured, and across all ... The schema of .code-workspace is fairly straightforward.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found