Skip to content
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

Improvements for cache.modify: details.storage and details.INVALIDATE #6991

Merged
merged 10 commits into from Sep 8, 2020

Conversation

benjamn
Copy link
Member

@benjamn benjamn commented Sep 8, 2020

This PR brings the options.storage object from read and merge functions to cache.modify functions, improving consistency between those APIs.

Also, cache.modify modifier functions can now return details.INVALIDATE (similar to details.DELETE) to invalidate the current field, causing affected queries to rerun, even if the field's value is unchanged. Previously, changing or deleting the field's value was the only way to invalidate the field.

Copy link
Member

@hwillson hwillson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @benjamn! One more small documentation suggestion - adding INVALIDATE to https://www.apollographql.com/docs/react/api/cache/InMemoryCache/#modifier-functions would also be helpful. Thanks!

@benjamn benjamn changed the title Improvements for cache.modify: options.storage and field invalidation Improvements for cache.modify: details.storage and details.INVALIDATE Sep 8, 2020
@benjamn benjamn merged commit 6e3c999 into release-3.2 Sep 8, 2020
@benjamn benjamn deleted the cache.modify-invalidation branch September 8, 2020 22:04
@benjamn benjamn mentioned this pull request Sep 10, 2020
11 tasks
@StephenBarlow
Copy link
Contributor

This happened while I was on vacation last week but just chiming in to say the changes are great! 🎉

@ab-pm
Copy link

ab-pm commented Mar 18, 2021

adding INVALIDATE to https://www.apollographql.com/docs/react/api/cache/InMemoryCache/#modifier-functions would also be helpful

Was 2c15bb4 lost somehow? I can't see it on the linked page.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants