{"id":"0e8df322-b065-4504-ae56-aff47215faa8","shortId":"F2EKKz","kind":"skill","title":"apollo-federation","tagline":"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 directiv","description":"# Apollo Federation Schema Authoring\n\nApollo Federation enables composing multiple GraphQL APIs (subgraphs) into a unified supergraph.\n\n## Federation 2 Schema Setup\n\nEvery Federation 2 subgraph must opt-in via `@link`:\n\n```graphql\nextend schema\n  @link(url: \"https://specs.apollo.dev/federation/v2.12\",\n        import: [\"@key\", \"@shareable\", \"@external\", \"@requires\", \"@provides\"])\n```\n\nImport only the directives your subgraph uses.\n\n## Core Directives Quick Reference\n\n| Directive | Purpose | Example |\n|-----------|---------|---------|\n| `@key` | Define entity with unique key | `type Product @key(fields: \"id\")` |\n| `@shareable` | Allow multiple subgraphs to resolve field | `type Position @shareable { x: Int! }` |\n| `@external` | Reference field from another subgraph | `weight: Int @external` |\n| `@requires` | Computed field depending on external fields | `shippingCost: Int @requires(fields: \"weight\")` |\n| `@provides` | Conditionally resolve external field | `@provides(fields: \"name\")` |\n| `@override` | Migrate field to this subgraph | `@override(from: \"Products\")` |\n| `@inaccessible` | Hide from API schema | `internalId: ID! @inaccessible` |\n| `@interfaceObject` | Add fields to entity interface | `type Media @interfaceObject` |\n\n## Reference Files\n\nDetailed documentation for specific topics:\n\n- [Directives](references/directives.md) - All federation directives with syntax, examples, and rules\n- [Schema Patterns](references/schema-patterns.md) - Multi-subgraph patterns and recipes\n- [Composition](references/composition.md) - Composition rules, error codes, and debugging\n\n## Key Patterns\n\n### Entity Definition\n\n```graphql\ntype Product @key(fields: \"id\") {\n  id: ID!\n  name: String!\n  price: Int\n}\n```\n\n### Entity Contributions Across Subgraphs\n\n```graphql\n# Products subgraph\ntype Product @key(fields: \"id\") {\n  id: ID!\n  name: String!\n  price: Int\n}\n\n# Reviews subgraph\ntype Product @key(fields: \"id\") {\n  id: ID!\n  reviews: [Review!]!\n  averageRating: Float\n}\n```\n\n### Computed Fields with @requires\n\n```graphql\ntype Product @key(fields: \"id\") {\n  id: ID!\n  size: Int @external\n  weight: Int @external\n  shippingEstimate: String @requires(fields: \"size weight\")\n}\n```\n\n### Value Types with @shareable\n\n```graphql\ntype Money @shareable {\n  amount: Int!\n  currency: String!\n}\n```\n\n### Entity Stub (Reference Without Contributing)\n\n```graphql\ntype Product @key(fields: \"id\", resolvable: false) {\n  id: ID!\n}\n```\n\n## Ground Rules\n\n- ALWAYS use Federation 2.x syntax with `@link` directive\n- ALWAYS import only the directives your subgraph uses\n- NEVER use `@shareable` without ensuring all subgraphs return identical values for that field\n- PREFER `@key` with single ID field for simple entity identification\n- USE `rover supergraph compose` to validate composition locally\n- USE `rover subgraph check` to validate against production supergraph","tags":["apollo","federation","skills","apollographql","agent-skills","graphql"],"capabilities":["skill","source-apollographql","skill-apollo-federation","topic-agent-skills","topic-apollo","topic-graphql"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/apollographql/skills/apollo-federation","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add apollographql/skills","source_repo":"https://github.com/apollographql/skills","install_from":"skills.sh"}},"qualityScore":"0.726","qualityRationale":"deterministic score 0.73 from registry signals: · indexed on github topic:agent-skills · official publisher · 52 github stars · SKILL.md body (2,865 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:14.899Z","embedding":null,"createdAt":"2026-04-18T22:17:21.576Z","updatedAt":"2026-04-22T00:56:14.899Z","lastSeenAt":"2026-04-22T00:56:14.899Z","tsv":"'/federation/v2.12':80 '1':15 '2':24,60,65,316 '3':31 '4':38 'across':34,231 'add':171 'allow':113 'alway':313,322 'amount':292 'anoth':128 'api':53,165 'apollo':2,7,43,47 'apollo-feder':1 'author':6,46 'averager':258 'check':364 'code':210 'compos':50,356 'composit':205,207,359 'comput':134,260 'condit':146 'contribut':230,300 'core':94 'creat':16 'currenc':294 'debug':212 'defin':25,102 'definit':216 'depend':136 'detail':181 'direct':90,95,98,186,190,321,326 'directiv':42 'document':182 'enabl':49 'ensur':334 'entiti':28,103,174,215,229,296,351 'error':209 'everi':63 'exampl':100,193 'extend':74 'extern':84,124,132,138,148,274,277 'fals':308 'feder':3,8,22,41,44,48,59,64,189,315 'field':110,118,126,135,139,143,149,151,155,172,221,239,252,261,268,281,305,342,348 'file':180 'float':259 'graphql':52,73,217,233,264,288,301 'ground':311 'guid':4 'hide':163 'id':111,168,222,223,224,240,241,242,253,254,255,269,270,271,306,309,310,347 'ident':338 'identif':352 'import':81,87,323 'inaccess':162,169 'int':123,131,141,228,246,273,276,293 'interfac':175 'interfaceobject':170,178 'internalid':167 'key':30,82,101,106,109,213,220,238,251,267,304,344 'link':72,76,320 'local':360 'media':177 'migrat':154 'modifi':27 'money':290 'multi':200 'multi-subgraph':199 'multipl':51,114 'must':67 'name':152,225,243 'never':330 'new':17 'opt':69 'opt-in':68 'overrid':153,159 'pattern':197,202,214 'posit':120 'prefer':343 'price':227,245 'product':108,161,219,234,237,250,266,303,368 'provid':86,145,150 'purpos':99 'quick':96 'recip':204 'refer':97,125,179,298 'references/composition.md':206 'references/directives.md':187 'references/schema-patterns.md':198 'requir':85,133,142,263,280 'resolv':117,147,307 'return':337 'review':247,256,257 'rover':354,362 'rule':195,208,312 'schema':10,19,45,61,75,166,196 'setup':62 'share':32 'shareabl':37,83,112,121,287,291,332 'shippingcost':140 'shippingestim':278 'simpl':350 'singl':346 'size':272,282 'skill':13 'skill-apollo-federation' 'source-apollographql' 'specif':184 'specs.apollo.dev':79 'specs.apollo.dev/federation/v2.12':78 'string':226,244,279,295 'stub':297 'subgraph':9,18,35,54,66,92,115,129,158,201,232,235,248,328,336,363 'supergraph':23,58,355,369 'syntax':192,318 'topic':185 'topic-agent-skills' 'topic-apollo' 'topic-graphql' 'type':107,119,176,218,236,249,265,285,289,302 'types/fields':33 'unifi':57 'uniqu':105 'url':77 'use':11,93,314,329,331,353,361 'valid':358,366 'valu':284,339 'via':71 'weight':130,144,275,283 'without':299,333 'work':39 'x':122,317","prices":[{"id":"4f474037-33a6-404b-9187-1059b73db830","listingId":"0e8df322-b065-4504-ae56-aff47215faa8","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"apollographql","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:17:21.576Z"}],"sources":[{"listingId":"0e8df322-b065-4504-ae56-aff47215faa8","source":"github","sourceId":"apollographql/skills/apollo-federation","sourceUrl":"https://github.com/apollographql/skills/tree/main/skills/apollo-federation","isPrimary":false,"firstSeenAt":"2026-04-18T22:17:21.576Z","lastSeenAt":"2026-04-22T00:56:14.899Z"}],"details":{"listingId":"0e8df322-b065-4504-ae56-aff47215faa8","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"apollographql","slug":"apollo-federation","github":{"repo":"apollographql/skills","stars":52,"topics":["agent-skills","apollo","graphql"],"license":"mit","html_url":"https://github.com/apollographql/skills","pushed_at":"2026-04-16T16:01:23Z","description":"Apollo GraphQL Agent Skills","skill_md_sha":"1175f46d30ebef650f5b6674ed84ab85bb4da08c","skill_md_path":"skills/apollo-federation/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/apollographql/skills/tree/main/skills/apollo-federation"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"apollo-federation","license":"MIT","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.","compatibility":"Works with any Federation 2.x compatible subgraph library (Apollo Server, GraphQL Yoga, etc.)"},"skills_sh_url":"https://skills.sh/apollographql/skills/apollo-federation"},"updatedAt":"2026-04-22T00:56:14.899Z"}}