2 ms·
Apollo's optimistic responses are similar Replicache's local writes. The difference is that Replicache's offline writes automatically refresh every affected sub
by aboodman 7y ago
Apollo's optimistic responses are similar Replicache's local writes. The difference is that Replicache's offline writes automatically refresh every affected subscription and ensures the entire UI is consistent with the latest changes. You don't need to manually modify affected queries: https://www.apollographql.com/docs/react/performance/optimistic-ui/#adding-to-a-list https://www.apollographql.com/docs/react/performance/optimis....
How Replicache composes with Apollo needs more thought. Off the top of my head, I think that Replicache replaces the need for Apollo's unified cache, but not with many of its other features. For example, it's easy to imagine Replicache being one of several data sources backing Apollo. In fact we have a customer who has done something like that already, and it's quite nice because the consuming code doesn't even need to know whether a GraphQL query is coming from offline data or the server. That can even change over the life of the product as more features in an application become offline-enabled.
- sizediterable 7y agoThanks for a thorough explanation!