Kotlin coroutines


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

Kotlin
1suspend fun <T> ApolloCall<T>.await()
2fun <T> ApolloSubscriptionCall<T>.toFlow(): Flow<Response<T>>
3fun <T> ApolloCall<T>.toFlow()
4fun <T> ApolloQueryWatcher<T>.toFlow()
5fun <T> ApolloSubscriptionCall<T>.toFlow(): Flow<Response<T>>
6fun ApolloPrefetch.toJob(): Job

Including in your project

Add the following dependency:

Groovy
1implementation 'com.apollographql.apollo:apollo-coroutines-support:x.y.z'
Feedback

Edit on GitHub

Forums