thebushidocollective/han/graphql-schema-design
Claude Code and agent skill by thebushidocollective/han
- community
Checking that the SKILL.md file is still in the repository.
Use when designing GraphQL schemas with type system, SDL patterns, field design, pagination, directives, and versioning strategies for maintainable and scalable APIs.
Install
npx vskill@latest install thebushidocollective/han/graphql-schema-designSKILL.md
GraphQL Schema Design
Apply GraphQL schema design principles to create well-structured, maintainable, and scalable GraphQL APIs. This skill covers the type system, Schema Definition Language (SDL), field design patterns, pagination strategies, directives, and schema evolution techniques.
Core Type System
Object Types
Object types are the fundamental building blocks of GraphQL schemas. Each object type represents a kind of object you can fetch from your service, and what fields it has.
Interface Types
Interfaces define abstract types that multiple object types can implement. Use interfaces when multiple types share common fields.
Union Types
Union types represent values that could be one of several object types. Use unions when a field can return different types without shared fields.
Enum Types
Enums define a specific set of allowed values for a field. Use enums for fields with a fixed set of options to ensure type safety.
Input Types
Input types are used for complex arguments in queries and mutations. They allow you to pass structured data as a single argument.
Custom Scalars
Custom scalars extend the built-in scalar types (String, Int, Float, Boolean, ID) with domain-specific types.
Directives
Directives provide a way to modify execution behavior or add metadata to your schema.
Nullable vs Non-Null Design
Carefully consider nullability in your schema design. Non-null fields provide stronger guarantees but reduce flexibility.
Pagination Patterns
Offset-Based Pagination
Simple pagination using limit and offset. Easy to implement but has performance issues with large offsets.
Cursor-Based Pagination (Connections)
More efficient for large datasets and supports bidirectional pagination. Based on Relay Connection specification.
Mutation Design Patterns
Input Object Pattern
Use input objects for mutations to allow for easier evolution and better organization of arguments.
Error Handling in Schema
Design your schema to support both field-level and mutation-level error handling.
Schema Stitching and Federation Basics
Schema Federation
Design schemas for federation by defining entities and extending types across services.
Versioning Strategies
Field Deprecation
Mark fields as deprecated while maintaining backward compatibility.
Additive Changes
Add new fields and types without breaking existing queries.
Best Practices
- Use meaningful names: Choose clear, descriptive names for types,
fields, and arguments that reflect their purpose and domain
- Design for nullable fields: Make fields nullable by default
unless you can guarantee the value will always be present
- Prefer input objects: Use input types for complex arguments in
mutations to allow for easier evolution
- Implement pagination: Always paginate list fields that could
grow unbounded using cursor-based or offset-based patterns
- Use enums for fixed sets: Define enums for fields with a
limited set of possible values to ensure type safety
- Document your schema: Add descriptions to types, fields, and
arguments using GraphQL description syntax
- Version through deprecation: Use @deprecated directive rather
than removing fields to maintain backward compatibility
- Design mutations carefully: Return payload types that include
both the result and potential errors
- Keep schema flat: Avoid deeply nested types that could lead to
complex queries and N+1 problems
- Use interfaces wisely: Define interfaces for shared fields
across multiple types to enable polymorphic queries
Common Pitfalls
- Over-fetching in schema design: Creating fields that return
entire objects when only specific data is needed
- Under-fetching: Not providing enough related data, forcing
clients to make multiple requests
- Circular dependencies: Creating circular references between
types without careful resolver design
- Breaking changes: Removing or renaming fields without
deprecation period, breaking existing clients
- No pagination: Returning unbounded lists that can cause
performance issues as data grows
- Inconsistent naming: Using different conventions for similar
fields across types
- Over-use of non-null: Making too many fields non-null, reducing
schema flexibility and resilience
- Missing error handling: Not designing proper error handling in
mutation payloads
- Ignoring N+1 problems: Creating schema designs that inherently
lead to N+1 query problems
- Poor input validation: Not defining constraints on input types,
leading to runtime validation issues
When to Use This Skill
Use GraphQL schema design skills when:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/tools/graphql/skills/graphql-schema-design/SKILL.md
Popularity
- Repository stars
- 198
- Repository forks
- 21
- 7-day trend score
- 26
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 18 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thebushidocollective/han/graphql-schema-design)