Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
val repositoriesQuery = GithubRepositoriesQuery.builder()
.repositoriesCount(50)
.orderBy(RepositoryOrderField.UPDATED_AT)
.orderDirection(OrderDirection.DESC)
.build()
val callback = ApolloCallback.wrap(object : ApolloCall.Callback<GithubRepositoriesQuery.Data>() {
override fun onResponse(response: Response<GithubRepositoriesQuery.Data>) {
val repositories = mapResponseToRepositories(response)
repositoriesAdapter.setItems(repositories)
}
override fun onFailure(e: ApolloException) {
e.printStackTrace()
}
}, Handler(Looper.getMainLooper()))
apolloClient
.query(repositoriesQuery)
.httpCachePolicy(HttpCachePolicy.CACHE_FIRST)
.enqueue(callback)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.