Skip to content

myofficework000/GraphQLDemo

Repository files navigation

Apollo Client

GraphQL Integration in Android with Kotlin and Apollo

Overview

This repository demonstrates how to integrate GraphQL into an Android application using Kotlin and the Apollo GraphQL client. The example app fetches country names from a GraphQL API and displays them in a RecyclerView.

Screenshot

App Screenshot

Learn More

For a detailed guide on integrating GraphQL into Android using Apollo, check out the Medium article.

Features

  • GraphQL Integration: Fetch only the data you need with GraphQL.
  • Apollo Client: Efficiently handles GraphQL queries and responses.
  • Dependency Injection: Configured with Dagger Hilt.
  • Modern UI: Simple and responsive interface using RecyclerView.

Setup

1. Add Dependencies

Update your build.gradle.kts (app level):

plugins {
    id("com.apollographql.apollo") version "version.number"
    id("kotlin-kapt")
    id("com.google.dagger.hilt.android")
}

dependencies {
    implementation("com.apollographql.apollo:apollo-runtime:version.number")
    implementation("com.squareup.okhttp3:okhttp:version.number")
    implementation("com.squareup.okhttp3:logging-interceptor:version.number")
    implementation("com.google.dagger:hilt-android:version.number")
    kapt("com.google.dagger:hilt-compiler:version.number")
    implementation("androidx.fragment:fragment-ktx:version.number")
}



About

GraphQL integration with appollo client

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages