graphql-schema

Design GraphQL schemas with types, resolvers, DataLoader batching, and subscriptions.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill graphql-schema-kalilurrahman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: graphql-schema
Source: https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts/tree/main/08-api-integration/graphql-schema
Command: npx skills add https://github.com/kalilurrahman/kr-claudiator-skills-original-prompts --skill graphql-schema-kalilurrahman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building a production GraphQL API requires more than a basic schema — you need pagination, N+1 query prevention, field-level authorization, structured error handling, and real-time subscriptions, which are easy to get wrong without a proven blueprint. ## Core Features & Use Cases - Schema Definition (SDL): Generates object types, inputs, enums, custom scalars, and Relay-style cursor pagination connections. - Resolvers with N+1 Prevention: Provides TypeScript resolvers using DataLoader to batch and cache database queries per request. - Authorization & Error Handling: Implements field-level permissions, auth directives, and structured error responses with codes. - Use Case: When building a blog platform API, use this Skill to generate the full schema with User/Post/Comment types, paginated queries, mutations with validation errors, and comment subscriptions over WebSocket. ## Quick Start Ask the AI to design a GraphQL schema for your data model, including queries, mutations, DataLoader-based resolvers, and subscription support.

Frequently Asked Questions about graphql-schema

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

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

Use DataLoader to batch and cache database queries per request. Instead of querying posts for each user individually, DataLoader collects all author IDs and runs a single WHERE author_id IN (...) query, returning results in the requested order.

How to implement cursor-based pagination in GraphQL?

Follow the Relay Connection spec with edges, nodes, and PageInfo containing hasNextPage and endCursor. Resolvers fetch first+1 records using the cursor as a database offset, then slice the extra record to determine if more pages exist.

Does Apollo Server support GraphQL subscriptions over WebSocket?

Yes, subscriptions use PubSub from graphql-subscriptions to publish events from mutations and deliver them to subscribed clients. Resolvers return pubsub.asyncIterator for channels, and clients connect via WebSocket using Apollo Client's useSubscription hook.

How do I add field-level authorization in GraphQL?

Implement authorization in field resolvers by checking the context user before returning sensitive fields, or use schema directives like @auth(requires: ADMIN). Field-level checks let different users see different fields on the same object type.

Why should GraphQL APIs limit query depth and complexity?

Malicious or poorly written nested queries can overwhelm the server with exponential database load. Use graphql-depth-limit and complexity validation rules to reject queries exceeding thresholds like depth 5 or complexity 1000.