graphitation
graphitation copied to clipboard
fix(apollo-forest-run): fix cache.modify within optimistic transaction
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.