graphql-architect

Design scalable GraphQL schemas for federated, multi-service APIs.

68|6|Updated Apr 16, 2020
One-click install
npx skills add https://github.com/zenobi-us/dotfiles --skill graphql-architect-zenobi-us
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql-architect
Source: https://github.com/zenobi-us/dotfiles/tree/main/ai/files/skills/experts/core-development/graphql-architect
Command: npx skills add https://github.com/zenobi-us/dotfiles --skill graphql-architect-zenobi-us

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill designs scalable GraphQL schemas and federation with a strong emphasis on type safety, performance, and developer experience.

Core Features & Use Cases

  • Domain-driven schema design and federation architecture
  • DataLoader integration, complexity analysis, and subscriptions
  • Tooling for code generation, schema inspection, and gateway configuration
  • Client-focused patterns: fragments, cache strategies, and error handling

Quick Start

Quick Start: Design a federated schema across multiple services and configure a gateway with query planning.

Frequently Asked Questions about graphql-architect

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

FAQPage Schema
How do I design a GraphQL schema for federated APIs across multiple services?

Federated GraphQL schemas use Apollo Federation to split your API across subgraphs, each owned by a team. Define entity types with @key directives, establish clear boundaries between services, and use a gateway to compose and route queries. This enables independent service development while maintaining a unified graph.

What's the best way to optimize GraphQL query performance at scale?

Query optimization combines DataLoader for batch loading, complexity analysis to prevent expensive queries, and subscription scalability patterns. DataLoader deduplicates and batches resolver calls, complexity analysis sets execution limits, and subscriptions use efficient pub/sub to handle real-time updates across federated services.

How do I configure a GraphQL gateway for multiple subgraphs?

A federation gateway composes subgraphs into a single schema using query planning and entity resolution. Configure composition rules, map entities across services via @key directives, set up query routing, and enable introspection. The gateway handles cross-service field resolution and error handling transparently to clients.

Can I use subscriptions in a federated GraphQL setup?

Yes, subscriptions work in federated architectures by routing subscription requests through the gateway to the appropriate subgraph. Implement subscriptions at the service level, configure the gateway's subscription transport, and use domain-driven patterns to ensure scalable pub/sub across teams and services.

What's the difference between schema-first and code-first GraphQL development?

Schema-first development defines the GraphQL schema explicitly, then generates code and types—enabling design review and federation contracts upfront. This approach supports type safety, automated code generation, and clear subgraph boundaries essential for federated multi-service APIs.

How do I prevent N+1 query problems in GraphQL resolvers?

DataLoader batches and caches resolver calls to eliminate N+1 queries. Register DataLoaders for each entity type, group database requests from multiple resolvers, and execute them in a single batch. This is critical for performance in federated setups where subgraphs may chain entity resolutions.