-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cached operations are not reset when source files change with eslint-plugin-webpack #1116
Comments
Hello, I would love to see this fixed and I'm happy that someone has created a PR for this already. I noticed that the PR was created on your fork instead of on this repo, maybe it would have a better chance of getting reviewed if the PR were submitted to this repo instead? |
Great call @dylanwulf, I've added a PR #1207 |
@ghmeier Thanks for your work, this issue is similar to #593 I see already an issue in your PR:
I plan to find a workaround to both problems in schema/operations in the current/next sprint |
Glad this is a priority in the next sprint. You're welcome to make modifications to my PR to fix those issues. I mostly put it up as a starting point and conversation starter.
Could you point to where you see that? From what I can see, the logic for handling files and adding them to the cache is the same as it is currently.
This is true, but perhaps a separate bug since that also already exists today?
I think unit tests would be pretty burdensome to write for this case. I marked that as complete because I outlined a repro case in this PR that fails without the change, but passes with it. |
Hi @ghmeier @dylanwulf ! Future release with cache invalidation could be tested in the following alpha version |
released in |
Issue workflow progress
Progress of the issue based on the Contributor Workflow
Describe the bug
When eslint is used to watch changes to files (like via
eslint-plugin-webpack
, or when usingcreate-react-app
), rules that rely on theoperationsCache
fail to update their status after the source file changes. This specifically affects fragments used in those files. For example, if a file looks like this:The rule will show a
require-id-when-available
error on the fragment initially, but if theid
field is added, the error will persist until the eslint process is restarted.To Reproduce
Steps to reproduce the behavior:
Here's a codesandbox set up to demonstrate the error: https://codesandbox.io/s/graphql-eslint-issue-6nskdj?file=/src/App.js
Running
yarn client
will initially show an error, but when that error is fixed, it doesn't go away.Expected behavior
The rules should handle changes to files during a single eslint process and resolve errors without requiring rerunning.
Environment:
@graphql-eslint/eslint-plugin
: 3.10.6Additional context
I've included a PR with a proposed fix for the issue: ghmeier#1
The text was updated successfully, but these errors were encountered: