mcpField
A
apollo-kotlin

apollo-kotlin

github.com/apollographqlDevelopment1211.7k installsUpdated 1d ago
Repository

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

  1. 01Gradle and code generation setup
  2. 02ApolloClient configuration
  3. 03Queries, mutations, and subscriptions
  4. 04Normalized cache guidance
  5. 05Migration guidance from Apollo Kotlin 4

Use cases

  1. 01Adding GraphQL support to a Kotlin project
  2. 02Configuring authentication, logging, and caching
  3. 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-kotlin

After installing, type/apollo-kotlinin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
caching.md
migrating-from-4.md
operations.md
setup.md
scripts/
list-apollo-kotlin-normalized-cache-versions.sh
list-apollo-kotlin-versions.sh

Details

From the project README

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 - 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

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