hello! Looking at <Apollo Kotlin 4 Migration helpe...
# apollo-kotlin
d
hello! Looking at Apollo Kotlin 4 Migration helpers, it says:
Because of the number of different options in version 3 and the complexity of error handling, these functions may not 100% match the version 3 behavior, especially in the advanced cases involving watchers. If you are in one of those cases, we strongly recommend using the version 4 functions that are easier to reason about.
Is there some specific documentation about the cases where there is a mismatch, particularly without using watchers? I am primarily interested to know if it can throw anything else than
ApolloException
as it's what we catch and what developers are expected to handle for
query
m
v4 doesn't throw anymore, instead you'll have exceptions in
ApolloResponse.exception
ApolloResponse.exception
is always an instance of
ApolloException
👌 1
It's like 99% the same exceptions but there are some edge cases
ApolloCompositeException
comes to mind
👍 1
d
I see that it extends
ApolloException
, so it should not crash after the migration to the helper methods
.executeV3()
and
.toFlowV3()
m
If you used to
catch(e: ApolloException)
around
.execute()
, you can remove that
d
the plan is to migrate first to the helper methods to adopt Apollo 4 and later migrate the operations separately
m
executeV3()
does throw though so you'll need the
catch(e: ApolloException)
if you use
executeV3()
d
to use the new more 'functional' approach
m
Makes sense
executeV3()
should behave mostly the same in terms of what it throws. Watchers is where it was super complex
👌 1
d
fortunately in the project we mostly have
execute()
with a few
.toFlow()
so hopefully the migration goes smoothly and we can start adopting the new approach
thanks for your help!
m
Of course, please let me know how that goes!
👌 1
d
it all worked smoothly, btw 🙂
🚀 1