apollo-federation

Author Apollo Federation 2.x subgraph schemas with entities and composition troubleshooting.

Updated Jan 21, 2026
One-click install
npx skills add https://github.com/HsnSaboor/open-engineer --skill apollo-federation
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: apollo-federation
Source: https://github.com/HsnSaboor/open-engineer/tree/main/src/skills/bundled/apollo-federation
Command: npx skills add https://github.com/HsnSaboor/open-engineer --skill apollo-federation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill assists developers in creating and managing subgraph schemas for Apollo Federation, ensuring seamless integration and composition within a larger supergraph.

Core Features & Use Cases

  • Subgraph Schema Creation: Define new subgraph schemas compatible with Federation 2.x.
  • Entity Management: Define and modify entities using @key, @external, and other federation directives.
  • Cross-Subgraph Communication: Implement patterns for sharing types and fields across subgraphs using @shareable and @provides.
  • Troubleshooting: Debug and resolve common schema composition errors.
  • Use Case: When building a new microservice that needs to contribute to an existing federated graph, use this skill to define its entities and fields correctly.

Quick Start

Use the apollo-federation skill to define a new Product entity with an 'id' field in your subgraph schema.

Frequently Asked Questions about apollo-federation

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

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

To define an entity in an Apollo Federation subgraph schema, you apply the @key directive to a type and specify its unique identifier fields. This establishes the type as a shared object across your federated graph.

What is the best way to share types across multiple subgraphs in Apollo Federation?▼

The best way to share types across subgraphs in Apollo Federation is by using the @shareable directive. This marks specific fields or types as resolvable by multiple subgraphs, ensuring seamless API composition within your supergraph.

How do I resolve schema composition errors in Apollo Federation 2.x?▼

To resolve schema composition errors in Apollo Federation 2.x, you must align conflicting directive usage and type definitions across subgraphs. Troubleshooting involves checking @external and @key implementations to ensure valid supergraph composition.

When do I need to use the @external directive in a GraphQL subgraph?▼

You need to use the @external directive in a GraphQL subgraph when you want to reference a field that is defined and owned by another subgraph. This allows your subgraph to access shared entity fields without redefining them.

Can I use Apollo Federation directives for microservice API composition?▼

Yes, you can use Apollo Federation directives for microservice API composition. By authoring subgraph schemas with directives like @provides and @key, you can seamlessly integrate multiple microservices into a single unified supergraph API.

Why does my subgraph schema fail when defining fields provided by another service?▼

Your subgraph schema fails when defining fields provided by another service because you likely omitted the @external directive. You must mark foreign-owned fields as external to prevent composition errors during supergraph schema merging.