Is it possible to handle network connection issues...
# apollo-kotlin
n
Is it possible to handle network connection issues when using a
watch
? You said they watchers never throw here. Is it possible to emit network connection issues?
m
Not at the moment. Can you share more about the use case?
n
My understanding is a watch will perform a network request and also monitor the cache right? So in the case where neither network or cache is available I’d like to be able to handle that situation.
m
What I'd suggest is used some coroutines magic to emulate this:
Copy code
apolloClient.query(query).toFlow()
        .catch { 
          // Handle errors here
        }
        .onCompletion {
          emitAll(apolloClient.query(query).watch())
        }
n
thanks 🙂