graphql

Design GraphQL schemas, resolvers, and clients with N+1 prevention and query depth limiting.

1|Updated Aug 17, 2025
One-click install
npx skills add https://github.com/ratnesh-maurya/mdconverter --skill graphql-ratnesh-maurya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql
Source: https://github.com/ratnesh-maurya/mdconverter/tree/main/.claude/skills/graphql
Command: npx skills add https://github.com/ratnesh-maurya/mdconverter --skill graphql-ratnesh-maurya

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? GraphQL APIs frequently suffer from N+1 query problems, unbounded nested queries that can DoS servers, and authorization gaps that expose sensitive data. This Skill provides hard-won patterns for building GraphQL APIs that avoid these production failures. ## Core Features & Use Cases - Schema Design: Build type-safe schemas with intentional nullability so errors are distinguishable from empty data. - N+1 Prevention: Apply DataLoader batching and caching so resolvers stop making one database query per field. - Security Hardening: Enforce query depth limits, query cost analysis, field-level authorization, and disable introspection in production. - Use Case: When building an Apollo Server API backed by Postgres, use this Skill to wire DataLoader into resolvers, add depth limiting, and configure Apollo Client's normalized cache with type policies. ## Quick Start Use the graphql skill to review my schema and resolvers for N+1 queries, missing depth limits, and authorization gaps.

Frequently Asked Questions about graphql

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

FAQPage Schema
How do I fix N+1 queries in GraphQL resolvers?

Use DataLoader to batch and cache database queries across resolvers within a single request. Without it, each resolver fires its own query, so a list of 100 users triggers 100 separate database calls.

How do I prevent deeply nested GraphQL queries from overloading my server?

Enforce query depth limiting and query cost analysis on the server. Deeply nested queries can act as a denial-of-service vector, so reject queries exceeding a configured depth or complexity budget.

Should GraphQL authorization live in schema directives or resolvers?

Authorize in resolvers, not only in schema directives. Schema-level rules alone miss field-level access control, so enforce authorization per field inside resolver logic where data is actually fetched.

Should I disable GraphQL introspection in production?

Yes, disable introspection in production to avoid exposing your full schema to attackers. Keep it enabled in development for tooling, and rely on persisted queries or schema registries for client needs.

Apollo Client vs urql for GraphQL caching?

Apollo Client provides a normalized cache with type policies for fine-grained cache control, while urql offers a lighter-weight alternative with a plugin-based exchange architecture. Choose based on how much cache customization your app requires.

Why does a non-null field error nullify my entire GraphQL response?

In GraphQL, a failed non-null field propagates null upward to the nearest nullable parent, potentially wiping out large parts of the response. Design nullability intentionally so errors do not cascade into unrelated data.