executeAsFlow

fun <D : Operation.Data> executeAsFlow(apolloRequest: ApolloRequest<D>): Flow<ApolloResponse<D>>

Low level API to execute the given apolloRequest and return a Flow.

Prefer query, mutation or subscription when possible.

For simple queries, the returned Flow contains only one element. For more advanced use cases like watchers or subscriptions, it may contain any number of elements and never finish. You can cancel the corresponding coroutine to terminate the Flow in this case.

See also