| Update: Apollo-cache-persist is just a temporary solution. To apply all the patterns we need to have the custom cache as actual cache interface need to change to support:
- saving optimistic responses
- optimization in what we are saving (filtering of the data before it is actually applied to the whole cache object).
During investigation, I found it hard to do it without having a custom cache. Our cache can simply extend InMemoryCache and add additional features we need. I have made couple PR's. I have made PR to apollo-client to make us work without forking https://github.com/apollographql/apollo-client/pull/4916 From discussion with Apollo team it looks like Apollo 3.0 will come with different cache solution so we might just provide our extensions on top of their current solution or fork it rather than trying to work around the problem. What I'm trying now is to minimize our dependency on Apollo cache. For the size of the codebase (just 2 files) it will make sense to build our own custom cache same as AWS and other teams done. Wei Li Stephen Coady Dara Hayes |