/GraphQL-Android

A project for showing use of apollo-android for consuming github graphQL API

Primary LanguageKotlin

GraphQL Android

The project has to applications:

  • First is ApolloGraphQLExample which uses apollo-android to auto generate the necessary JAVA models for graphQL queries.
  • Second is GraphQL which uses retrofit by just posting up raw queries with appropriate headers on the URL and getting results.

The first method is most recommended because it auto generates the code for models according to your queries. The advantage is that it decouples the graphql queries from the code which makes easier to code.

Medium: https://medium.com/@droid_singh/what-is-graphql-and-using-it-on-android-ab8e493abdd7

Query used
query {
  repository(owner:"jakewharton", name:"butterknife") {
    name
    description
    forkCount
    url
  }
}

query {
  repository(owner:"amanjeetsingh150", name:"ubercaranimation") {
    name
    description
    forkCount
    url
  }
}

The result of the above query is shown below:

Screenshots: