1
votes

I'm new to GraphQL and Apollo clients. My situation is that I'm making an Android app, I want to use JetPack libraries and components, and the web service for the app is using GraphQL. I'm trying to decide whether to use the apollo-android client, or just use okhttp3 to make my queries directly to the server, and implement the usual MVVM stuff, making my own classes and caching them with Room. Are these approaches meant to be combined? Or are they simply different ways of doing things? I ask because all of the tutorials and examples of apollo-android I've seen are really simple and don't involve view-models with LiveData objects observing data.

1

1 Answers

1
votes

There's a pull request open to integrate apollo-android with LiveData: https://github.com/apollographql/apollo-android/pull/1320

You also have the option to use GraphQL just like you would use REST and map the apollo generated models to your own App models. GraphQL is then an api just like REST but with added type safety and all the tooling GraphQL brings.