Communitygithub.com

apollographql/apollo-federation

编写 Apollo Federation 子图模式指南。适用于以下场景:创建联合超级图的子图模式、使用 @key 定义或修改实体、通过 @shareable 共享类型/字段、处理 Federation 指令、排查组合错误以及架构设计模式。

apollo-federation 是什么?

该技能是 Apollo Federation 子图模式创作的权威指南。它支持在分布式联合超级图架构中,定义和扩展子图模式,并利用 @key、@shareable、@external、@requires、@provides、@override 和 @inaccessible 等核心指令来管理实体、共享类型与字段,以及处理跨子图的依赖关系。它详尽解释了组合错误的原因和排查方法,并提供了与 Federation v2 兼容的最佳实践。适用于任何需要设计或演进联合图模式的开发场景,并且与常用的 AI 编码助手(如 Claude Code 和 Cursor)无缝配合。通过该技能,开发者能够快速创建正确、高性能且易于维护的子图模式,确保超级图在组合后无冲突且运行稳定。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/apollographql/skills/tree/main/skills/apollo-federation

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

apollo-federation 是做什么的?

编写 Apollo Federation 子图模式的指南。在以下情况下使用本技能:

  1. 为联合超级图创建新的子图模式
  2. 使用 @key 定义或修改实体
  3. 使用 @shareable 跨子图共享类型/字段
  4. 处理 Federation 指令(@external、@requires、@provides、@override、@inaccessible)
  5. 排查组合错误
  6. 涉及 Federation 模式设计模式的任何任务

Individual skills in this repo

This repo contains 9 individual skills — each has its own dedicated page.

apollographql/apollo-client

Guide for building React applications with Apollo Client 4.x. Use this skill when: (1) setting up Apollo Client in a React project, (2) writing GraphQL queries or mutations with hooks, (3) configuring caching or cache policies, (4) managing local state with reactive variables, (5) troubleshooting Apollo Client errors or performance issues.

apollographql/apollo-connectors

Guide for integrating REST APIs into GraphQL supergraphs using Apollo Connectors with @source and @connect directives. Use this skill when the user: (1) mentions "connectors", "Apollo Connectors", or "REST Connector", (2) wants to integrate a REST API into GraphQL, (3) references @source or @connect directives, (4) works with files containing "# Note to AI Friends: This is an Apollo Connectors schema".

apollographql/apollo-mcp-server

Guide for using Apollo MCP Server to connect AI agents with GraphQL APIs. Use this skill when: (1) setting up or configuring Apollo MCP Server, (2) defining MCP tools from GraphQL operations, (3) using introspection tools (introspect, search, validate, execute), (4) troubleshooting MCP server connectivity or tool execution issues.

apollographql/apollo-router

Version-aware guide for configuring and running Apollo Router for federated GraphQL supergraphs. Generates correct YAML for both Router v1.x and v2.x. Use this skill when: (1) setting up Apollo Router to run a supergraph, (2) configuring routing, headers, or CORS, (3) implementing custom plugins (Rhai scripts or coprocessors), (4) configuring telemetry (tracing, metrics, logging), (5) troubleshooting Router performance or connectivity issues.

apollographql/apollo-server

Guide for building GraphQL servers with Apollo Server 5.x. Use this skill when: (1) setting up a new Apollo Server project, (2) writing resolvers or defining GraphQL schemas, (3) implementing authentication or authorization, (4) creating plugins or custom data sources, (5) troubleshooting Apollo Server errors or performance issues.

apollographql/graphql-operations

Guide for writing GraphQL operations (queries, mutations, fragments) following best practices. Use this skill when: (1) writing GraphQL queries or mutations, (2) organizing operations with fragments, (3) optimizing data fetching patterns, (4) setting up type generation or linting, (5) reviewing operations for efficiency.

apollographql/graphql-schema

Guide for designing GraphQL schemas following industry best practices. Use this skill when: (1) designing a new GraphQL schema or API, (2) reviewing existing schema for improvements, (3) deciding on type structures or nullability, (4) implementing pagination or error patterns, (5) ensuring security in schema design.

apollographql/rover

Guide for using Apollo Rover CLI to manage GraphQL schemas and federation. Use this skill when: (1) publishing or fetching subgraph/graph schemas, (2) composing supergraph schemas locally or via GraphOS, (3) running local supergraph development with rover dev, (4) validating schemas with check and lint commands, (5) configuring Rover authentication and environment, (6) exploring or searching a graph's schema for agent-driven discovery (rover schema describe / rover schema search).

apollographql/rust-best-practices

Guide for writing idiomatic Rust code based on Apollo GraphQL's best practices handbook. Use this skill when: (1) writing new Rust code or functions, (2) reviewing or refactoring existing Rust code, (3) deciding between borrowing vs cloning or ownership patterns, (4) implementing error handling with Result types, (5) optimizing Rust code for performance, (6) writing tests or documentation for Rust projects.

相关技能