skills.vishalvoidskills/vishalvoid
Technical & DevelopmentIntermediate

apollo-federation

Write Apollo Federation 2 subgraph schemas and compose them into a ...

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/apollographql/skills --skill apollo-federation

Overview

What This Skill Does

Write Apollo Federation 2 subgraph schemas and compose them into a supergraph

Application

When to use this Skill

Documentation

Show Skills.md file

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:

extend schema
  @link(url: "https://specs.apollo.dev/federation/v2.12",
        import: ["@key", "@shareable", "@external", "@requires", "@provides"])

Import only the directives your subgraph uses.

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")
Lines 1 - 25 of 103

Recommendations

Explore other random skills

All skillsMy patterns