graphql — Claude Code skill: what it does, how to install
This skill guides GraphQL schema, query, mutation, and client work. Use it when an API needs typed patterns and query-performance checks.
npx skills add Mindrally/skills --skill graphql -a claude-codeWhat graphql does
The skill covers GraphQL schema design with clear types, naming, input validation, enums, and room for future changes. It also guides atomic mutations, affected-data responses, and early error handling. Schema descriptions and API versioning are part of the recommended workflow.
For queries, it favors selecting only required fields and reusing fragments. Large result sets should use pagination, while DataLoader handles batching and caching to avoid N+1 problems. Generated clients such as Genql are recommended for typed API access. Gatsby projects get separate guidance for useStaticQuery and use-prefixed query files.
Security guidance includes authentication, authorization, query-complexity checks, input validation and sanitization, and rate limiting. If an API serves large datasets, pagination needs to be planned before the query layer grows.
What it helps with
- design a typed GraphQL schema
- trim queries to required fields
- remove N+1 problems with DataLoader
- add pagination for large datasets
- validate inputs and query complexity
Example prompts for the agent
- Design a GraphQL schema for this API with clear types, enums, and input validation.
- Rewrite this query so it requests only needed fields and reuses fragments.
- Inspect these resolvers for N+1 queries and suggest a DataLoader-based design.
How to install graphql
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill graphql -a claude-code2Manually: put the files in place
~/.claude/skills/graphql/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/graphql/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill graphql -a codex2Manually: put the files in place
.agents/skills/graphql/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill graphql -a cursor2Manually: put the files in place
.cursor/skills/graphql/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills graphql2Manually: put the files in place
.github/skills/graphql/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill graphql -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path graphqlManually: put the files in place
.devin/skills/graphql/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill graphql -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about graphql
How do I install graphql in Claude Code?
Run npx skills add Mindrally/skills --skill graphql -a claude-code, then check ~/.claude/skills/graphql/SKILL.md.
What does the graphql skill do?
It guides schema, query, and mutation design, query tuning, error handling, and typed GraphQL client integration.
Which security practices does graphql cover?
It covers authentication and authorization, query-complexity analysis, input validation and sanitization, plus rate limiting.
Source text
SKILL.md · Apache-2.0
--- name: graphql description: Expert in GraphQL API development with type-safe patterns and optimization metadata: maintainer: Mindrally source: https://github.com/Mindrally/skills --- # GraphQL You are an expert in GraphQL development with deep knowledge of schema design, queries, and API optimization. ## Core Principles - Use generated GraphQL clients for type-safe API interactions - Optimize GraphQL queries to fetch only necessary data - Implement proper error handling with early returns and guard clauses - Follow functional and declarative programming patterns ## Schema Design - Design schemas with clear, meaningful types - Use proper naming conventions for types, queries, and mutations - Implement proper input validation - Use enums for fixed sets of values - Design for extensibility ## Query Optimization - Fetch only necessary fields - Use fragments for reusable field selections - Implement pagination for large datasets - Use DataLoader for batching and caching - Avoid N+1 query problems ## Mutations - Design atomic mutations - Return affected data in mutation responses - Implement proper error handling - Use input types for complex parameters - Validate inputs before processing ## Client Integration ### Gatsby - Use useStaticQuery for querying GraphQL data at build time - Prefix GraphQL query files with `use` (e.g., `useSiteMetadata.ts`) ### Modern Web Apps - Use generated GraphQL clients (Genql) for type safety - Implement proper caching strategies - Handle loading and error states ## Security - Implement proper authentication and authorization - Use query complexity analysis to prevent abuse - Validate and sanitize all inputs - Implement rate limiting ## Best Practices - Document schemas with descriptions - Version APIs appropriately - Monitor and log query performance - Use persisted queries for production
© Mindrally · Apache-2.0 · Mindrally/skills