graphitation icon indicating copy to clipboard operation
graphitation copied to clipboard

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

Open vladar opened this issue 9 months ago • 0 comments

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.

vladar avatar May 30 '25 21:05 vladar