# GRAPHQL

> Use when: design or review GraphQL schemas and resolvers with safe, efficient data access.

- Skill: `kimtth/graphql` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kimtth/graphql`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kimtth/graphql/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: kimtth (https://skillmd.com/u/kimtth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kimtth/graphql

---


Goal: a typed GraphQL schema that is expressive and not abusable.

Use for:
- designing schemas, types, and mutations
- reviewing resolver efficiency and security
- fixing N+1 queries and over-fetching risks

Workflow:
1. Design the schema from the client's data needs.
2. Model nullability and types precisely.
3. Batch and cache resolver data with a dataloader pattern.
4. Limit query depth and complexity to prevent abuse.
5. Handle errors as typed results where it aids clients.
6. Verify with schema tests and performance checks.

Patterns:
- dataloaders to batch and dedupe per request
- pagination via connections/edges
- input types for mutations
- persisted queries for trusted clients

Rules:
- prevent N+1 with batching, not eager joins everywhere
- cap query depth and complexity on public APIs
- never expose internal errors raw to clients
- evolve the schema additively; deprecate before removing

