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.
npx skills add apollographql/skills --skill apollo-kotlin -a claude-codeWhat 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 inlocal.properties - Add an auth token interceptor to
ApolloClientand 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-code2Manually: put the files in place
~/.claude/skills/apollo-kotlin/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/apollo-kotlin/
1Skills CLI (Vercel)
npx skills add apollographql/skills --skill apollo-kotlin -a codex2Manually: put the files in place
.agents/skills/apollo-kotlin/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add apollographql/skills --skill apollo-kotlin -a cursor2Manually: put the files in place
.cursor/skills/apollo-kotlin/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install apollographql/skills apollo-kotlin2Manually: put the files in place
.github/skills/apollo-kotlin/SKILL.md1Skills CLI (Vercel)
npx skills add apollographql/skills --skill apollo-kotlin -a gemini-cli2Platform CLI
gemini skills install https://github.com/apollographql/skills --path skills/apollo-kotlinManually: put the files in place
.devin/skills/apollo-kotlin/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add apollographql/skills --skill apollo-kotlin -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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