Docs
Try Apollo Studio
You're viewing documentation for a previous version of this software. Switch to the latest stable version

Kotlin coroutines


The Apollo GraphQL client comes with coroutines support with the following extensions:

suspend fun <T> ApolloCall<T>.await()
fun <T> ApolloSubscriptionCall<T>.toFlow(): Flow<Response<T>>
fun <T> ApolloCall<T>.toFlow()
fun <T> ApolloQueryWatcher<T>.toFlow()
fun <T> ApolloSubscriptionCall<T>.toFlow(): Flow<Response<T>>
fun ApolloPrefetch.toJob(): Job

Including in your project

Add the following dependency:

implementation 'com.apollographql.apollo:apollo-coroutines-support:x.y.z'
Edit on GitHub
Previous
Client Awareness
Next
RxJava2