apollo-federation

Author Apollo Federation subgraph schemas with federation directives and entity definitions.

102|12|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/apollographql/skills --skill apollo-federation-apollographql
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: apollo-federation
Source: https://github.com/apollographql/skills/tree/main/skills/apollo-federation
Command: npx skills add https://github.com/apollographql/skills --skill apollo-federation-apollographql

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation and management of Apollo Federation subgraph schemas, ensuring seamless integration and composition within a larger GraphQL supergraph.

Core Features & Use Cases

  • Subgraph Schema Authoring: Define entities, share types, and manage federation directives.
  • Composition Error Debugging: Troubleshoot and resolve issues during schema composition.
  • Use Case: You are building a new subgraph for user profiles in a federated system. Use this Skill to define the User entity with a @key directive, specify its fields, and ensure it correctly extends existing types from other subgraphs.

Quick Start

Use the apollo-federation skill to define a new Product entity with an ID key and a name field.

Frequently Asked Questions about apollo-federation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I define entities in an Apollo Federation subgraph schema?

To define entities in an Apollo Federation subgraph schema, use the @key directive to specify a type's unique identifier fields, enabling it to be referenced and resolved across multiple subgraphs within a supergraph.

What is the @shareable directive used for in GraphQL federation?

The @shareable directive in GraphQL federation indicates that a field can be resolved by multiple subgraphs, allowing you to safely share type fields across different services without causing composition conflicts.

How do I use @requires and @provides directives in a federated schema?

Use the @requires directive to compute a federated field based on @external fields from another subgraph, and use @provides to indicate a subgraph can resolve a field locally when querying an entity reference.

Why does my GraphQL schema composition fail with an @external field error?

GraphQL schema composition fails with @external field errors when a subgraph marks a field as external but does not properly reference it using directives like @requires, or when the field is not actually defined in the owning subgraph.

What is the best way to troubleshoot Apollo Federation composition errors?

The best way to troubleshoot Apollo Federation composition errors is to validate subgraph schemas for correct directive usage, ensuring entities, shared fields, and external references are properly defined before composing the supergraph.