Join us from October 8-10 in New York City to learn the latest tips, trends, and news about GraphQL Federation and API platform engineering.Join us for GraphQL Summit 2024 in NYC
Start for Free

1. Configure your project

In this step, you'll import the starter project and add the SDK to it.

Clone the starter project

git clone
cd apollo-kotlin-tutorial/compose

The starter project is in the start folder.

At any time, if you want to view a completed version of the project, open the project in the final folder.

Open the 'start' project in Android Studio

Android Studio will take some time to index the contents of the project. Take some time to look around. You should see 3 files:

  • LaunchList.kt is the first screen. You will display a list of there.
  • LaunchDetails.kt will display details about a and give you the opportunity to book a seat.
  • Login.kt will allow you to log in before booking the seat.

Now build and run the project.

You should see a list with static placeholder data:

The initial state of the project!

Now let's add Apollo Kotlin to the project.

Get the latest version of Apollo Kotlin

You can find the latest version of Apollo Kotlin from the GitHub releases page. It is also displayed at the top of the apollo-kotlin repo.

This tutorial uses 3.8.5 because it is the latest version at the time of writing. Feel free to use a more recent version if one is available.

Apply the plugin

Apply the Apollo plugin in app/build.gradle.kts. There are two build.gradle.kts in the project. Make sure to use the one in the app directory this time. The Apollo plugin ID is com.apollographql.apollo3.

plugins {
// ...

The plugin contains the compiler that will generate models from your queries when you build your project.

Configure the Apollo Gradle plugin

Configure the Apollo plugin to specify the package in which the Kotlin files will be generated. Put this at the end of app/build.gradle.kts:

apollo {
service("service") {

Notice the service block: Apollo Kotlin supports configuring several services, which is useful if you have several endpoints. In this tutorial there is only one, so you can name it anything you want (here we call it "service").

Add dependencies

Now add apollo-runtime to the list of dependencies. This is the code that executes queries and parses responses.

dependencies {
// ...

Android Studio will display a yellow banner, A project sync may be necessary for the IDE to work properly. Don't click it just yet as Apollo Kotlin requires a schema to sync correctly.

In the next step, you will add the GraphQL schema to the project.

0. Introduction
2. Add the GraphQL schema
Rate articleRateEdit on GitHubEditForumsDiscord

© 2024 Apollo Graph Inc., d/b/a Apollo GraphQL.

Privacy Policy