GraphQL Cursor Rules
Cursor rules for GraphQL: schema design, resolver patterns, DataLoader, and security best practices.
- Use DataLoader for all N+1-prone resolver fields; never query inside resolvers in loops - Design mutations to return the mutated resource; avoid void mutations - Use input types for all mutation arguments; never use raw scalars for complex mutations - Implement cursor-based pagination (Relay spec) over offset pagination - Depth-limit and complexity-limit all public schemas; add query cost analysis - Use @deprecated directive before removing fields; document reason and replacement - Never expose internal errors to clients; use generic messages in production - Use code-first schema generation to keep types and resolvers in sync
How to use with Cursor
Create a `.cursorrules` file in your project root and paste these rules. Cursor reads this automatically on every AI interaction.
Related Rules
Python Cursor Rules
Best Cursor AI coding rules for Python development. Enforce type hints, PEP 8, Pythonic patterns, and modern Python best practices in your .cursorrules file.
TypeScript Cursor Rules
Cursor rules for TypeScript: enforce strict mode, eliminate any types, and write type-safe code with these .cursorrules configurations.
React Cursor Rules
Cursor rules for React: component patterns, hooks best practices, performance optimization, and clean state management conventions.
Next.js Cursor Rules
Cursor rules for Next.js App Router: server components, data fetching, routing, and deployment best practices.