Hi, is there any guide on how to implement apollo with mvvm architecture using coroutines?
Hi! You can take a look at this repo for an exemple of using Apollo Android with ViewModels: https://github.com/BoD/apollo-graphql-android-sample
Hi! You can take a look at this repo for an exemple of using Apollo Android with ViewModels: https://github.com/BoD/apollo-graphql-android-sample
I don't think that's what I am looking for.
There are a lot of tutorials to implement Rest api with Retrofit using Coroutines, Livedata and MVVM architecture with repository pattern but no tutorials for Apollo. Is there something similar for apollo?
I'm not aware of anything like this unfortunately. Apollo is a way access your API like Retrofit so swapping out the retrofit Service with an ApolloClient should be close enough to the end result.
Can you share a good tutorial for retrofit and I'll look into how that would work with Apollo?
I'm not aware of anything like this unfortunately. Apollo is a way access your API like Retrofit so swapping out the retrofit Service with an ApolloClient should be close enough to the end result.
Can you share a good tutorial for retrofit and I'll look into how that would work with Apollo?
Hi, here is a very good and perfect implementation of everything i talked about
https://blog.mindorks.com/using-retrofit-with-kotlin-coroutines-in-android
Thanks for your help.
Any update on this?
Apollo provides implementation for the networking layer for GraphQL API the same way as Retrofit provides implementation for networking layer for REST API. So technically if you replace anything related to the Retrofit with Apollo in the article you provided as a sample, you will get what you are looking for.
Apollo provides implementation for the networking layer for GraphQL API the same way as Retrofit provides implementation for networking layer for REST API. So technically if you replace anything related to the Retrofit with Apollo in the article you provided as a sample, you will get what you are looking for.
The implementation for retrofit and apollo is really different and I don't think you can just replace Retrofit stuff with Apollo with exact same structure
If you guys can provide an example that would be really helpful.
The major concern with respect to the article is the Interface that has been set up since Apollo doesn't use annotations for end points and queries how to set that up?
Thanks
Any help?
Note: I'm new to android development.
I made a data access layer for apollo in an android app based on work done by my colleague with setting up a Room database (we're replacing the room implementation with apollo), as well as the code samples hosted here: https://github.com/apollographql/apollo-android/tree/master/samples/kotlin-sample
the repository I linked has been a great resource, and they do have code examples for coroutines as well (I went with rxJava).
As for your specific question about interfaces, I'm guessing they are similar to android's Room db interfaces -- I replaced those with abstract classes for every model we're tracking. I needed to use abstract classes because I "plug in" the correct datasource in the viewModel on runtime, extending them from a base abstract class.
I hope that these are enough pointers to get you started.
Hi, I also would love the official apollo android guide to follow googles recommended design patterns. Is there any reason as to why the apollo guide is not using LiveData?