apollo-federation
This skill guides agents in authoring Apollo Federation subgraph schemas using Federation 2.x directives like @key, @shareable, @external, and @requires.
Identity proven by a skills index on apollographql.com
- Agents
- Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
- License
- MIT (permissive)
- Pin
- 5f02fcfpinned Oct 9, 2026
- Context cost
- about 830 tokenswhen the skill loads
- GitHub stars
- 117on apollographql/skills
- Scripts
- None found
What it does
“Guide for authoring Apollo Federation subgraph schemas. Use this skill when: (1) creating new subgraph schemas for a federated supergraph, (2) defining or modifying entities with @key, (3) sharing types/fields across subgraphs with @shareable, (4) working with federation directives (@external, @requires, @provides, @override, @inaccessible), (5) troubleshooting composition errors, (6) any task involving federation schema design patterns.”
Generated summary from the skill's own text
This skill guides agents in authoring Apollo Federation subgraph schemas using Federation 2.x directives like @key, @shareable, @external, and @requires. The agent can design entities, share types across subgraphs, resolve composition errors, and validate schemas locally with rover commands.
When to use it
- Creating new subgraph schemas for a federated GraphQL supergraph
- Defining entities and their unique keys across multiple subgraphs
- Sharing types and fields between subgraphs using @shareable
- Troubleshooting federation composition errors or validation issues
When not to
- Building a monolithic GraphQL schema without federation
- Working with Federation 1.x syntax or non-Apollo GraphQL servers
- Designing schemas that do not need type composition across services
Install
These commands install from the publisher's repository and need no account.
skills CLI
npx skills add apollographql/skills --skill apollo-federationInstalls from the repository's default branch, which may have changed since the commit we checked.
GitHub CLI 2.90 or later
gh skill install apollographql/skills apollo-federation@5f02fcfcebec678e2e55777b639e32346622a963Installs the commit we checked (5f02fcf).
Copy by hand
Download the folder at 5f02fcf and put it in .claude/skills/apollo-federation for Claude Code and in .agents/skills/apollo-federation for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.
Claude Code plugin
/plugin install apollo-skills@claude-plugins-officialThe publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.
Copy for your agent
A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.
Prompt
Install the agent skill "apollo-federation" by Apollo GraphQL. Source, pinned to commit 5f02fcfcebec678e2e55777b639e32346622a963: https://github.com/apollographql/skills/tree/5f02fcfcebec678e2e55777b639e32346622a963/skills/apollo-federation 1. Download that folder at exactly this commit. Do not use the default branch. 2. Copy every file unchanged, keeping the folder structure, into .claude/skills/apollo-federation/ for Claude Code and .agents/skills/apollo-federation/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist. 3. Do not edit the files, and do not run any script in the folder unless I ask you to. 4. When you are done, list the files you copied and where you put them. Listing and checks: https://www.agentnative.dev/skills/apollo-graphql/apollo-federation
SKILL.md at the pin
---
name: apollo-federation
description: >
Guide for authoring Apollo Federation subgraph schemas. Use this skill when:
(1) creating new subgraph schemas for a federated supergraph,
(2) defining or modifying entities with @key,
(3) sharing types/fields across subgraphs with @shareable,
(4) working with federation directives (@external, @requires, @provides, @override, @inaccessible),
(5) troubleshooting composition errors,
(6) any task involving federation schema design patterns.
license: MIT
compatibility: Works with any Federation 2.x compatible subgraph library (Apollo Server, GraphQL Yoga, etc.)
metadata:
author: apollographql
version: "1.0.2"
allowed-tools: Bash(rover:*) Read Write Edit Glob Grep
---
# Apollo Federation Schema Authoring
Apollo Federation enables composing multiple GraphQL APIs (subgraphs) into a unified supergraph.
## Federation 2 Schema Setup
Every Federation 2 subgraph must opt-in via `@link`:
```graphql
extend schema
@link(url: "https://specs.apollo.dev/federation/v2.12",
import: ["@key", "@shareable", "@external", "@requires", "@provides"])
```
Import only the directives your subgraph uses. The version shown (`v2.12`) is
illustrative — check the [Federation changelog](https://www.apollographql.com/docs/graphos/schema-design/federated-schemas/reference/versions)
for currently supported versions before copying it verbatim.
> A subgraph's `@link` version is a floor, not the composition version — see
> [Federation versions](references/composition.md#federation-versions-floor-vs-composition)
> for the full explanation.
## Core Directives Quick Reference
| Directive | Purpose | Example |
|-----------|---------|---------|
| `@key` | Define entity with unique key | `type Product @key(fields: "id")` |
| `@shareable` | Allow multiple subgraphs to resolve field | `type Position @shareable { x: Int! }` |
| `@external` | Reference field from another subgraph | `weight: Int @external` |
| `@requires` | Computed field depending on external fields | `shippingCost: Int @requires(fields: "weight")` |
| `@provides` | Conditionally resolve external field | `@provides(fields: "name")` |
| `@override` | Migrate field to this subgraph | `@override(from: "Products")` |
| `@inaccessible` | Hide from API schema | `internalId: ID! @inaccessible` |
| `@interfaceObject` | Add fields to entity interface | `type Media @interfaceObject` |
## Reference Files
Detailed documentation for specific topics:
- [Directives](references/directives.md) - All federation directives with syntax, examples, and rules
- [Schema Patterns](references/schema-patterns.md) - Multi-subgraph patterns and recipes
- [Composition](references/composition.md) - Composition rules, error codes, and debugging
## Key Patterns
### Entity Definition
```graphql
type Product @key(fields: "id") {
id: ID!
name: String!
price: Int
}
```
### Entity Contributions Across Subgraphs
```graphql
# Products subgraph
type Product @key(fields: "id") {
id: ID!
name: String!
price: Int
}
# Reviews subgraph
type Product @key(fields: "id") {
id: ID!
reviews: [Review!]!
averageRating: Float
}
```
### Computed Fields with @requires
```graphql
type Product @key(fields: "id") {
id: ID!
size: Int @external
weight: Int @external
shippingEstimate: String @requires(fields: "size weight")
}
```
### Value Types with @shareable
```graphql
type Money @shareable {
amount: Int!
currency: String!
}
```
### Entity Stub (Reference Without Contributing)
```graphql
type Product @key(fields: "id", resolvable: false) {
id: ID!
}
```
## Ground Rules
- ALWAYS use Federation 2.x syntax with `@link` directive
- ALWAYS import only the directives your subgraph uses
- NEVER use `@shareable` without ensuring all subgraphs return identical values for that field
- PREFER `@key` with single ID field for simple entity identification
- USE `rover supergraph compose` to validate composition locally
- USE `rover subgraph check` to validate against production supergraph
From apollographql/skills at 5f02fcf, shown as plain text under its license: MIT (permissive). The license text is in skills/apollo-federation/SKILL.md.
View SKILL.md on GitHub at 5f02fcfFiles
- SKILL.md4.0 KB · 3c54892777b0
- references/
- composition.md7.9 KB · 2f4600864093
- directives.md20 KB · 56cdbf6b9a7f
- schema-patterns.md7.2 KB · b915736cf1e0
4 files, 39 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.
Skill folder on GitHub at 5f02fcfMore from Apollo GraphQL
apollo-client
This skill guides building React applications with Apollo Client 4.x for managing GraphQL queries, mutations, and state.
Claude Code, Codex, Cursor +4 · about 1.7K tokens · pinned 7 days ago
apollo-connectors
This skill helps integrate REST APIs into GraphQL supergraphs using Apollo Connectors with @source and @connect directives.
Claude Code, Codex, Cursor +4 · about 1.6K tokens · pinned 7 days ago
apollo-ios
This skill guides building GraphQL-powered Apple apps with Apollo iOS, a strongly-typed Swift client.
Contains scripts
Claude Code · about 1.8K tokens · pinned 7 days ago
apollo-kotlin
This skill guides building GraphQL applications with Apollo Kotlin, a strongly typed client library for Android, JVM, and Kotlin Multiplatform projects.
Contains scripts
Claude Code, Codex, Cursor +3 · about 370 tokens · pinned 7 days ago
apollo-router
Generates version-correct Apollo Router configuration (v1.x or v2.x) for federated GraphQL supergraphs.
Claude Code, Codex, Cursor +4 · about 5.1K tokens · pinned 7 days ago
apollo-router-plugin-creator
This skill guides creating native Rust plugins for Apollo Router.
Claude Code, Codex, Cursor +4 · about 3.9K tokens · pinned 7 days ago
Related in Backend and APIs
nvflare-orient
Routes NVFLARE requests to appropriate downstream skills based on user intent and preliminary source inspection findings.
by NVIDIAOfficial publisher
Claude Code, Codex, Cursor +4 · about 600 tokens · pinned 7 days ago
cloudflare-email-service
This skill enables agents to send transactional emails and route incoming emails using Cloudflare's Email Service platform.
by CloudflareOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.6K tokens · pinned 7 days ago
durable-objects
Build and debug Cloudflare Durable Objects applications for stateful coordination and persistent storage on the edge.
by CloudflareOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 7 days ago
workers-best-practices
This skill guides code review and development of Cloudflare Workers by applying best practices for production readiness.
by CloudflareOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.3K tokens · pinned 7 days ago
supabase
This skill enables the agent to work with Supabase products including Database, Auth, Edge Functions, Realtime, Storage, and Vectors.
by SupabaseOfficial publisher
Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 7 days ago
apple
This skill emulates Apple's OAuth and OIDC services for local development and testing.
by VercelOfficial publisher
Claude Code, Codex, Cursor +4 · about 1.9K tokens · pinned 7 days ago