| license | Apache-2.0 |
| name | graphql-server-architect |
| description | DataLoader, subscriptions, federation, and schema stitching for GraphQL APIs. Activate on: GraphQL, DataLoader, subscription, federation, schema stitching, resolver, SDL, Apollo, Yoga. NOT for: REST API design (use api-architect), frontend GraphQL clients (use relevant frontend skill). |
| allowed-tools | Read,Write,Edit,Bash(npm:*,npx:*) |
| category | Backend & Infrastructure |
| tags | ["graphql","federation","dataloader","subscriptions","schema"] |
| pairs-with | [{"skill":"cache-strategy-invalidation-expert","reason":"Query-level and resolver-level caching for GraphQL"},{"skill":"observability-apm-expert","reason":"Per-resolver tracing and query complexity monitoring"},{"skill":"api-rate-limiting-throttling-expert","reason":"Query cost analysis prevents expensive queries"}] |
GraphQL Server Architect
Design production-grade GraphQL APIs with efficient data loading, real-time subscriptions, and federated schema architecture.
Activation Triggers
Activate on: "GraphQL", "DataLoader", "subscription", "federation", "schema stitching", "resolver", "SDL", "Apollo Server", "GraphQL Yoga", "Pothos", "query complexity"
NOT for: REST API design → api-architect | Frontend GraphQL client → relevant frontend skill | Database queries → data-warehouse-optimizer
Quick Start
- Choose framework — GraphQL Yoga 5.x (lightweight), Apollo Server 4.x (ecosystem), Mercurius (Fastify)
- Schema-first or code-first — SDL for team collaboration, Pothos/Nexus for type-safe code-first
- Implement DataLoader — batch and cache per-request to solve N+1 queries
- Set query complexity limits — prevent clients from requesting arbitrarily deep/wide queries
- Add persisted queries — lock down production to known queries, improve CDN caching
Core Capabilities
| Domain | Technologies |
|---|
| Servers | GraphQL Yoga 5.x, Apollo Server 4.x, Mercurius 14+ |
| Schema | Pothos (code-first), SDL (schema-first), GraphQL Codegen |
| Federation | Apollo Federation 2.8+, GraphQL Mesh, Schema Stitching |
| Performance | DataLoader, @defer/@stream, persisted queries, query complexity |
| Real-Time | GraphQL Subscriptions (WebSocket), graphql-ws, SSE transport |
Architecture Patterns
DataLoader Pattern (N+1 Prevention)
import DataLoader from 'dataloader';
function createLoaders() {
return {
userById: new <, >( (ids) => {
users = db.(, [ids]);
map = (users.( [u., u]));
ids.( map.(id) ?? ());
}),
};
}
resolvers = {
: {
: loaders..(post.),
},
};