-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
If you're using options.storage in your custom read or merge functions, it can be useful to have access to it when using cache.modify as well.
There was a problem hiding this 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!
This happened while I was on vacation last week but just chiming in to say the changes are great! 🎉 |
Was 2c15bb4 lost somehow? I can't see it on the linked page. |
This PR brings the
options.storage
object fromread
andmerge
functions tocache.modify
functions, improving consistency between those APIs.Also,
cache.modify
modifier functions can now returndetails.INVALIDATE
(similar todetails.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.