# apollo-kotlin

Guide for Android, JVM and Kotlin Multiplatform apps using the Apollo Kotlin GraphQL client, from Gradle setup to operations.

Skill by Apollo GraphQL. Category: Web and browsers.

## Install

Project (for this project only):

```sh
npx skills add apollographql/skills --skill apollo-kotlin
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add apollographql/skills --skill apollo-kotlin -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.
- Runs shell commands: Its steps run shell commands in your terminal.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass
- Runlayer: Fail
- ZeroLeaks: Pass

Installs: 1624. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/apollographql/skills/apollo-kotlin)

## Source

[Open the source](https://github.com/apollographql/skills/tree/HEAD/skills/apollo-kotlin). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: apollo-kotlin
description: >
  Guide for building applications with Apollo Kotlin, the GraphQL client library for Android and Kotlin. Use this skill when:
  (1) setting up Apollo Kotlin in a Gradle project for Android, Kotlin/JVM, or KMP,
  (2) configuring schema download and codegen for GraphQL services,
  (3) configuring an `ApolloClient` with auth, interceptors, and caching,
  (4) writing queries, mutations, or subscriptions,
license: MIT
compatibility: JVM 8+, Kotlin 1.9+, Gradle 8+, Android/JVM/Kotlin Multiplatform projects.
metadata:
  author: apollographql
  version: "1.0.3"
allowed-tools: Bash(./gradlew:*) Bash(gradle:*) Bash(curl:*) Read Write Edit Glob Grep WebFetch
---

# Apollo Kotlin Guide

Apollo Kotlin is a strongly typed GraphQL client that generates Kotlin models from your GraphQL operations and schema, that can be used in Android, JVM, and Kotlin Multiplatform projects.

## Process

Follow this process when adding or working with Apollo Kotlin:

- [ ] Confirm target platforms (Android, JVM, KMP), GraphQL endpoint(s), and how schemas are sourced.
- [ ] Configure Gradle and code generation, including custom scalars
- [ ] Create a shared `ApolloClient` with auth, logging, and caching.
- [ ] Implement operations.
- [ ] Validate behavior with tests and error handling.


## Reference Files

- [Setup](references/setup.md) - Gradle plugin, schema download, codegen config (including scalars), client configuration (auth, logging, interceptors)
- [Operations](references/operations.md) - Queries, mutations, subscriptions, and how to execute them
- [Caching](references/caching.md) - Setup and use the normalized cache
- [Migration Guide](references/migrating-from-4.md) - Migrate from Apollo Kotlin 4

## Scripts

- [list-apollo-kotlin-versions.sh](scripts/list-apollo-kotlin-versions.sh) - List versions of Apollo Kotlin
- [list-apollo-kotlin-normalized-cache-versions.sh](scripts/list-apollo-kotlin-normalized-cache-versions.sh) - List versions of the Apollo Kotlin Normalized Cache library

## Key Rules

- Prefer Apollo Kotlin v5+. Do not use v3 or older versions.
- Keep schema and operations in source control to make builds reproducible.
````

- Previous: [apollo-router](https://syn4pse.dev/terminal/apollo-router.md)
- Next: [apollo-router-plugin-creator](https://syn4pse.dev/terminal/apollo-router-plugin-creator.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
