GraphQL schema design including types, fields, pagination, nullability, naming conventions, and descriptions. Use when designing or modifying GraphQL schemas.
Provides expert guidance for designing well-structured GraphQL schemas, including types, fields, pagination, nullability, and naming conventions. Use when creating or modifying GraphQL schemas to ensure best practices and avoid common pitfalls.
/plugin marketplace add jovermier/cc-stack-marketplace/plugin install cc-graphql@cc-stack-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/documentation.mdreferences/fields.mdreferences/naming.mdreferences/pagination.mdreferences/types.mdExpert guidance for designing well-structured GraphQL schemas.
| Concept | Best Practice | Example |
|---|---|---|
| Nullability | Default nullable, required only when necessary | email: String not email: String! |
| Pagination | Relay connections (edges/nodes) | users(first: Int, after: String): UserConnection! |
| Naming | PascalCase types, camelCase fields | type UserProfile { firstName: String } |
| Descriptions | All types, fields, arguments | """User account""" |
| Mutations | Noun + Verb pattern | createUser, deletePost |
| Deprecations | @deprecated with reason | @deprecated(reason: "Use newField") |
Specify a number or describe your schema concern.
| Response | Reference to Read |
|---|---|
| 1, "type", "interface", "union", "enum" | types.md |
| 2, "field", "argument", "nullable", "default" | fields.md |
| 3, "pagination", "connection", "relay" | pagination.md |
| 4, "naming", "convention", "consistency" | naming.md |
| 5, "description", "deprecation", "document" | documentation.md |
"""
A user in the system
"""
type User {
"""
The unique identifier of the user
"""
id: ID!
"""
The user's display name
"""
name: String!
"""
The user's email address (optional if not public)
"""
email: String
"""
Posts created by this user, paginated
"""
posts(
"""
Number of posts to return
"""
first: Int
"""
Cursor for pagination
"""
after: String
): PostConnection!
}
"""
Paginated connection of posts
"""
type PostConnection {
edges: [PostEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type PostEdge {
node: Post!
cursor: String!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
| Issue | Severity | Fix |
|---|---|---|
| Unbounded lists | High | Use pagination connections |
| Missing descriptions | Medium | Add doc comments |
| Inconsistent nullability | Medium | Be intentional about ! |
| Breaking changes without deprecation | High | Use @deprecated first |
| CRUD-style mutations | Low | Use noun+verb (createUser) |
| No pagination on collections | High | Add Relay connections |
# Good: Nullable by default
type User {
id: ID!
name: String! # Required for user
email: String # Optional (not all users have email)
bio: String # Optional (not all users filled it out)
posts(first: Int): PostConnection! # Connection required, edges may be empty
}
# Avoid: Too many required fields
type User {
id: ID!
name: String!
email: String! # Required may block mutations
phone: String! # Required may block mutations
bio: String! # Required may block mutations
}
| File | Topics |
|---|---|
| types.md | Objects, interfaces, unions, enums, scalars |
| fields.md | Nullability, arguments, defaults, lists |
| pagination.md | Relay connections, edges, nodes, cursors |
| naming.md | Conventions for types, fields, mutations |
| documentation.md | Descriptions, deprecations, comments |
Schema is well-designed when:
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.