Describe the bug
When i close the app and reopen it with the internet turned off, i get this error message in spite of using the CacheProvider : [Failed host lookup: --url-- : Undefined location]
To Reproduce
turn off internet and then open the application, wherever Query widgets are used, they return this error.
Expected behavior
Display the cached data instead of throwing an error.
Screenshots
As i proceeded to debug, the result.data will be null for the first call of the build function! and then the data will be returned by the subsequent calls.
@dopecoder To be honest the offline support is very experimental, but will have a look and see what's going on.
Any update on this? @HofmannZ Also, when do you expect to release v1?
This happens because on the creation of the widget query the state is loading no matter what.
This behavior is mostly appropriate, I think. I wouldn't mind having a sync respose with data from the cache on the first build, though.
Flutter-graphql return both the data and the errors. In my app I show the old data to the user and pop a snackbar telling him about the error.
This behavior is the best one to have IMO and together with the behavior I'm asking in #153 we can provide the user with the best information possible.
We can show the old data, put a loading indicator somewhere in the page to let them know the app is trying to update the old data and when/if it errors, show it to the user too.
This behavior is different from apollo-client but apollo-client was thought of for websites where you can expect the user to have internet most of the time. But this is for flutter and flutter is for mobile apps, and my mobile users (Brazil) maybe have internet on their phones half of the time they're using their phone, so I care about giving them the best offline experience as possible.
@micimize I see that you add this Queued for Work. Any particular design in mind yet? Should we instead discuss in #153 and implement different responseType?
Is this related to #290 as well?
@truongsinh it is - I'm actually closing this in favor of #290, #153, and the newly created #319.
As @lucasavila00 noted, it's expected behavior, it's just confusing and unclear to the user what the best way to handle it is
@truongsinh it is - I'm actually closing this in favor of #290, #153, and the newly created #319.
As @lucasavila00 noted, it's expected behavior, it's just confusing and unclear to the user what the best way to handle it is
So... What's the best way to handle it?