ApolloCall
An ApolloCall is a thin class that binds an ApolloRequest with its ApolloClient. It offers a fluent way to configure the ApolloRequest.
Contrary to an ApolloRequest, an ApolloCall doesn't have a request id and a new request id is allocated every time execute or toFlow is called.
call execute for simple cases that expect a single response:
val response = apolloClient.query(myQuery).fetchPolicy(CacheOnly).execute()
call toFlow for other cases that expect multiple ApolloResponse like subscriptions and
@defer
:
apolloClient.subscription(mySubscription).toFlow().collect { response ->
println(response.data)
}
See also
Properties
Functions
When conflateResponses is true, the fetch policy interceptors emit a single response and ignores the first cache or network error if a successful response is ultimately fetched. If no successful response can be emitted, a com.apollographql.apollo.exception.ApolloCompositeException error response is emitted.
Retrieves a single ApolloResponse from this ApolloCall.
A version of execute that restores 3.x behaviour:
Returns a cold Flow that produces ApolloResponses from this ApolloCall.
A version of execute that restores 3.x behaviour: