diff --git a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/ApolloCall.kt b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/ApolloCall.kt index b01d162cbcb..a439e46f126 100644 --- a/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/ApolloCall.kt +++ b/libraries/apollo-runtime/src/commonMain/kotlin/com/apollographql/apollo/ApolloCall.kt @@ -156,8 +156,8 @@ class ApolloCall internal constructor( * * [execute] calls [toFlow] and filters out cache or network errors to return a single success [ApolloResponse]. * - * [execute] throws if more than one success [ApolloResponse] is returned, for an example, if [operation] is a subscription or a `@defer` query. - * In those cases use [toFlow] instead. + * If more than one success [ApolloResponse] is emitted, for an example, if [operation] is a subscription or a `@defer` query, the first one is returned. + * Prefer [toFlow] for those cases to handle all the responses. * * [execute] may fail due to an I/O error, a cache miss or other reasons. In that case, check [ApolloResponse.exception]: * ``` @@ -208,8 +208,7 @@ class ApolloCall internal constructor( } } - 1 -> successResponses.first() - else -> throw DefaultApolloException("The operation returned multiple items, use .toFlow() instead of .execute()") + else -> successResponses.first() } } }