[~chrisfoley] [~wtrocki] [~stephencoady] should this issue be fixed before tech preview? It basically happens when some changes are made while offline, then when app is restarted and device is still offline, changes are not visible in app.
The possible solution I posted in previous comment requires developer of app to provide update functions when initializing client. (These functions are usually passed to mutate functions) User would not be forced to provide them, but if he wants the changes to be visible after app restart, this would be required.
Another thing is that if user provides these update functions, it might be redundant for him to pass them again to mutate functions. What we could do is to wrap apollo client and override mutate function, so that we can pass the update function for him. He would still be allowed to pass custom function if necessary. This approach slightly changes way developer usually works with apollo client, but I don't see other option. (this approach is also recommended here [1]).
This change should be quite small, but requires also small change in docs and in example app.
POC for this approach is here [2].
[1] https://medium.com/twostoryrobot/a-recipe-for-offline-support-in-react-apollo-571ad7e6f7f4 [2] https://github.com/jhellar/aerogear-js-sdk/pull/3 |
|