3 ms·
I'm curious how well Replicache composes together with web state management libraries such as Redux and Apollo GraphQL. My closest experience with something lik
by sizediterable 7y ago
I'm curious how well Replicache composes together with web state management libraries such as Redux and Apollo GraphQL. My closest experience with something like Replicache's offline view is optimistic responses in GraphQL[1]. Maybe some more web-specific examples can be added to the site?
[1] https://www.apollographql.com/docs/react/performance/optimistic-ui/ https://www.apollographql.com/docs/react/performance/optimis...
- aboodman 7y agoApollo'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!