graphql-api-design

Design GraphQL APIs with Apollo Server, Federation v2, and DataLoader patterns.

17|1|Updated Jun 8, 2025
One-click install
npx skills add https://github.com/williamzujkowski/standards --skill graphql-api-design
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql-api-design
Source: https://github.com/williamzujkowski/standards/tree/main/skills/api/graphql
Command: npx skills add https://github.com/williamzujkowski/standards --skill graphql-api-design

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides production-ready GraphQL API design patterns, including schema design, resolvers, federation, authentication/authorization, and performance considerations.

Core Features & Use Cases

  • Schema Design & Resolvers: Typed schemas, DataLoader patterns, and modular resolvers.
  • Federation & Subgraphs: Apollo Federation v2 with gateway and subgraph composition.
  • Security & Testing: Authorization guards, error handling, and testing strategies.

Quick Start

Start with a basic GraphQL schema and resolver setup, then progressively add federation and security layers.

Frequently Asked Questions about graphql-api-design

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

FAQPage Schema
How do I design a production-ready GraphQL API schema?

Design a production-ready GraphQL schema by defining typed schemas with modular resolvers, implementing DataLoader patterns for batching database queries, and adding authentication and authorization guards. This ensures performance optimization, security, and maintainability across Apollo Server and GraphQL Yoga implementations.

What is GraphQL federation and when should I use it?

GraphQL federation composes multiple GraphQL subgraphs into a single API via Apollo Federation v2, allowing teams to own separate schema domains while maintaining a unified gateway. Use federation when scaling across multiple services or teams requires independent schema deployment and composition.

How do I optimize GraphQL query performance in production?

Optimize GraphQL performance using DataLoader for query batching, implementing caching strategies, and monitoring query complexity. Add tracing and metrics integration with Apollo Studio and other observability tools to identify bottlenecks and track production deployment behavior.

Can I use GraphQL federation with Apollo Server and GraphQL Yoga together?

Yes, Apollo Federation v2 works with both Apollo Server and GraphQL Yoga as gateway and subgraph implementations. Both frameworks support federation-ready architectures, schema composition, and production deployment patterns outlined in Federation v2 specifications.

What testing and error handling strategies work best for GraphQL APIs?

Implement comprehensive testing strategies covering resolver logic, authorization guards, and error handling across schema validation and execution. Handle errors explicitly in resolvers and subscribe to observability events for production monitoring and debugging.

How do I set up authentication and authorization in a GraphQL API?

Set up authentication by validating tokens in resolver context, then enforce authorization using guards that check permissions before resolving fields. Integrate with subscriptions and federation subgraphs to ensure consistent access control across the entire API.