toFlow

fun toFlow(): Flow<ApolloResponse<D>>

Returns a cold Flow that produces ApolloResponses for this ApolloCall. Note that the execution happens when collecting the Flow. This method can be called several times to execute a call again.

Example:

apolloClient.subscription(NewOrders())
.toFlow()
.collect {
println("order received: ${it.data?.order?.id"})
}