About apollo-kotlin
A skill guide for using Apollo Kotlin, a typed GraphQL client that generates Kotlin models from schemas and operations. It covers setup through testing for Android, JVM, and Kotlin Multiplatform projects.
Key features
- 01Gradle and code generation setup
- 02ApolloClient configuration
- 03Queries, mutations, and subscriptions
- 04Normalized cache guidance
- 05Migration guidance from Apollo Kotlin 4
Use cases
- 01Adding GraphQL support to a Kotlin project
- 02Configuring authentication, logging, and caching
- 03Implementing and testing GraphQL operations
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ apollographql/ skills --skill apollo-kotlinAfter installing, type/apollo-kotlinin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
references/caching.mdmigrating-from-4.mdoperations.mdsetup.mdscripts/list-apollo-kotlin-normalized-cache-versions.shlist-apollo-kotlin-versions.shDetails
From the project READMEApollo 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
ApolloClientwith auth, logging, and caching. - Implement operations.
- Validate behavior with tests and error handling.
Reference Files
- Setup - Gradle plugin, schema download, codegen config (including scalars), client configuration (auth, logging, interceptors)
- Operations - Queries, mutations, subscriptions, and how to execute them
- Caching - Setup and use the normalized cache
- Migration Guide - Migrate from Apollo Kotlin 4
Scripts
- list-apollo-kotlin-versions.sh - List versions of Apollo Kotlin
- 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.
Comments
Markdown supported