We're seeing that when "watching" a query using th...
# apollo-kotlin
c
We're seeing that when "watching" a query using the cache and network policy that we don't receive any sort of error/exception if we don't have a network connection. The cache will return properly, but we'll never receive any sort of emission or exception to catch for the network call. If we do just a network call without cache then everything works as expected, but we're obviously not "watching" at that point. What we're expecting is that if a device loses network connection that it would collect the cached value and then throw an exception when trying to pull fresh data from the network. Is that the intended behavior?
Do we just set
fetchThrows: Boolean = true
when calling
watch
?
m
You're most likely looking for
refetchThrows = true
There's a long history of backward compatibility there which make everything more awkward than it needs to be
c
Yeah that's what I was wondering. I see in v4 that those arguments will be gone. Will it be throwing exceptions by default in v4?
m
I was writing about this 🙂 . In v4, we're planning to emit all items, whether successful or errors. You can read more about it there: https://github.com/apollographql/apollo-kotlin/issues/4711
c
awesome. thanks!
m
You can also try with the snapshots
It should be a lot more flexible to handle errors at the call site. And callers that don't need to handle errors can easily ignore them
c
👍