react-relay-offline
react-relay-offline copied to clipboard
Offline Sync Query (DeltaSync)
Hey,
Just looking at the redux persist/hydrate store, and feel as though the naming is a little off here, take a look at the following screenshot.
![Screen Shot 2019-05-19 at 22 42 03](https://user-images.githubusercontent.com/567579/57988547-8b6f1f80-7a87-11e9-99ad-889311ad782c.png)
I would expect that AppQuery.{....}
should contain the root operation, such as AppQuery. allCinemaDetails{ ... }
.
I have chosen the key nomenclature to better manage the garbage collector. For which use case would you like to have the root operation information?
The use case for the root operation would be to be able to pre-emptily execute so that we can have an offline sync scenario.
Example being
- Open Application
- The following query is executed
query OfflineSyncQUery {
cinemas(param: 1, param: 2) {
...CinimaView_cinima
...CinimaContact_infomation
}
}
- Once the sync is complete, navigating to the view CinimaView would call the QueryRenderer that will attempt to find
cinemas(param: 1, param: 2)
in the root operations, if it exists then it will be served without going to the network.
Do you mean a scenario similar to "https://docs.aws.amazon.com/en_us/appsync/latest/devguide/tutorial-delta-sync.html"?
This is a theme that I am placing myself in the "https://github.com/morrys/react-relay-appsync" repository and at the moment the best hypothesis is its implementation in the refetchContainer (DeltaSyncContainer or QueryRendererSync).
Hey, is it possible for us to connect on a slack channel somewhere I can send you some documents I wrote on the internal ideas we had for how we thought this solution would play out?
There is the channel https://graphql.slack.com and you can write me a DM
we can discuss these on #relay channel there
I think more people want to collaborate on this
maybe this could help with delta sync
https://github.com/zth/relay-utils#createmissingfieldshandler
missingFieldHandlers