Skip to content

fix(apollo-forest-run): fix cache.modify within optimistic transaction #561

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

vladar
Copy link
Contributor

@vladar vladar commented May 30, 2025

Currently cache.modify issued within optimistic transaction doesn't work properly if modified node does not exist in the optimistic layer of the current optimistic transaction.

Apollo InMemoryCache doesn't have this problem because it can store individual fields in the layers. So cache.modify reads from layers below, but stores modified fields (only) in the same layer.

TODO: ForestRun doesn't store individual fields, so in order to properly mimic Apollo behavior we need to either copy chunks from lower layers, or create "fake" chunk in the optimistic layer with only modified fields.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant