-
Notifications
You must be signed in to change notification settings - Fork 740
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatic connectivity refetch for query watcher #3463
Comments
There isn't any way to do this baked in to |
Do you have any feedback for the maintainers? Please tell us by taking a one-minute survey. Your responses will help us understand Apollo iOS usage and allow us to serve you better. |
Maybe it would be good idea to introduce this in future versions? In android (kotlin) apollo client, you can simply toggle retryOnNetworkError interceptor flag and this behavior is handled automatically. For me it simply seems like a no-brainer, to be able to automatically load data that failed due to lack of network connectivity. For general usecases like loading list of entities you want to display the data to the user as much as possible, also you already have the stream publisher -> view pipeline that requires to be implemented in a reactive way, so Its just a matter of calling refetch on specific network error code and NWPath value observation. |
I lean toward this being something better left to users to implement themselves right now. Not everyone wants this behavior, and will likely want it to function a little differently. Maybe at some point in the future we could introduce this, but I don't anticipate us investing in supporting this in the SDK in the near future. |
Question
Hello, is there a built in mechanism that would allow query watcher to automatically refetch data when network error occured in previous call + network connectivity was restored (NWPath went from unsatisfied to satisfied).
I have built my own extension that does call refetch() on both watcher and pager (from apollo-ios-paging extension), but I think there may be more “native” approach using interceptors? Only thing I am not sure, is how to force interceptor to “stream” new data to the query watcher.
The text was updated successfully, but these errors were encountered: