Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ class ApolloCall<D : Operation.Data> 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]:
* ```
Expand Down Expand Up @@ -208,8 +208,7 @@ class ApolloCall<D : Operation.Data> internal constructor(
}
}

1 -> successResponses.first()
else -> throw DefaultApolloException("The operation returned multiple items, use .toFlow() instead of .execute()")
else -> successResponses.first()
}
}
}
Loading