Skip to main content
skill CX Codex

apollo-kotlin — Claude Code skill: GraphQL client for Kotlin

A skill that walks the agent through Apollo Kotlin setup in a Gradle project: schema, codegen, an ApolloClient with auth and cache, plus operations.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add apollographql/skills --skill apollo-kotlin -a claude-code
Open on GitHub

What apollo-kotlin does

Apollo Kotlin generates strongly typed Kotlin models from your GraphQL operations and schema. The skill covers the whole path: it first confirms target platforms (Android, JVM or KMP) and endpoint addresses, then configures Gradle and code generation including custom scalars, then builds a shared ApolloClient with auth, logging and caching. Operations and test validation come last.

Four reference files sit inside. references/setup.md handles the Gradle plugin, schema download and client config, references/operations.md covers queries, mutations and subscriptions, references/caching.md explains the normalized cache, and references/migrating-from-4.md is for moving off Apollo Kotlin 4. Two scripts list available versions of the library and of the normalized cache library, which helps when you cannot recall the current number.

You need JVM 8+, Kotlin 1.9+ and Gradle 8+. The skill insists on Apollo Kotlin v5 and above and tells you not to use v3 or older, so an old project has to update the client first. It also asks you to keep schema and operations in source control, otherwise builds stop being reproducible.

What it helps with

  • wire Apollo Kotlin into a Gradle project for Android, JVM or KMP
  • set up schema download and Kotlin model generation
  • add auth, interceptors and logging to ApolloClient
  • turn on the normalized cache and understand how it behaves
  • migrate a project from Apollo Kotlin 4 to v5

Example prompts for the agent

  • Set up Apollo Kotlin in this Gradle project: the schema is in src/main/graphql, the endpoint in local.properties
  • Add an auth token interceptor to ApolloClient and enable the normalized cache
  • Help me migrate this project from Apollo Kotlin 4 to v5 using references/migrating-from-4.md

How to install apollo-kotlin

1Skills CLI (Vercel)

npx skills add apollographql/skills --skill apollo-kotlin -a claude-code

2Manually: put the files in place

~/.claude/skills/apollo-kotlin/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/apollo-kotlin/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about apollo-kotlin

How do I install apollo-kotlin in Claude?

Run npx skills add apollographql/skills --skill apollo-kotlin -a claude-code. The skill lands in ~/.claude/skills/apollo-kotlin/SKILL.md.

What does the apollo-kotlin skill do?

It guides the agent through Apollo Kotlin setup: Gradle and codegen, ApolloClient configuration, operations, caching and the migration from version 4.

Which Apollo Kotlin versions are supported?

The skill recommends v5 and above and says not to use v3 or older. The list-apollo-kotlin-versions.sh script lists available library versions.

Source text

SKILL.md · MIT
---
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.

© apollographql · MIT · apollographql/skills

Similar skills

Everything for Mobile →

From the same set11

graphql-schema Guides GraphQL SDL schema design following Apollo best practices. Useful when creating schema.graphql, adding mutations, or setting up pagination. CX Codex +1 4,000installs graphql-operations A skill that keeps your agent writing GraphQL queries, mutations and fragments against the real schema. Useful when it starts inventing field names. CX Codex +1 3,600installs apollo-server Guides AI agents in building GraphQL APIs with Apollo Server 5.x. Useful when setting up schemas, writing resolvers, and configuring authentication. CX Codex +1 2,800installs apollo-connectors Walks an agent through wiring a REST API into a GraphQL supergraph with @source and @connect. Best for quick edits to an existing Connectors schema. CX Codex +1 2,200installs apollo-federation Guides an agent through Apollo Federation subgraph schemas: directives, entities with @key, composition errors. Handy when a supergraph spans several GraphQL services. CX Codex +1 1,900installs apollo-router A skill that writes version-correct router.yaml for Apollo Router v1.x and v2.x and flags the sections where the two schemas diverge. CX Codex +1 1,800installs apollo-router-plugin-creator Helps build native Rust plugins for Apollo Router. It assists with request lifecycle hooks and modifying existing router extensions. CX Codex +1 1,600installs apollo-ios Walks your agent through adding Apollo iOS to a Swift project: codegen config, client setup, queries, subscriptions and mock-based tests. CX Codex +1 1,100installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor