https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
c

Chris Fillmore

08/05/2022, 5:43 PM
Apologies if I missed this somewhere. I’m migrating from version 2 -> 3.
ApolloSubscriptionCall.Callback
had
onFailure
and
onTerminated
. How are these exposed in Apollo 3.x? Can I
.catch
?
Copy code
subscriptionCall.toFlow()
  .catch { ... }
  .collect { ... }
For that matter is
onConnected
behaviour still exposed?
s

Stylianos Gakis

08/05/2022, 6:05 PM
Since it's now a flow, would the flow extensions like
.onStart {}
fit your use case? Also yeah you can definitely use the .catch operator there for anything that may be thrown. I'd guess this should have similar functionality to what old "onFailure" was, but I'd definitely read the docs about what old onFailure was.
c

Chris Fillmore

08/05/2022, 6:07 PM
I haven’t checked recently but I thought onFailure mapped to OkHttp websocket listener’s equivalent callback
Thanks for responding
I haven’t yet used
onStart
, let me take a look
3 Views