Back to list
jovermier

graphql-schema-design

by jovermier

Claude Code agents for Go, GraphQL, Next.js, and Playwright. 4 agents, 12 skills for code review and test generation.

0🍴 0📅 Jan 3, 2026

SKILL.md


name: graphql-schema-design description: GraphQL schema design including types, fields, pagination, nullability, naming conventions, and descriptions. Use when designing or modifying GraphQL schemas.

GraphQL Schema Design

Expert guidance for designing well-structured GraphQL schemas.

Quick Reference

ConceptBest PracticeExample
NullabilityDefault nullable, required only when necessaryemail: String not email: String!
PaginationRelay connections (edges/nodes)users(first: Int, after: String): UserConnection!
NamingPascalCase types, camelCase fieldstype UserProfile { firstName: String }
DescriptionsAll types, fields, arguments"""User account"""
MutationsNoun + Verb patterncreateUser, deletePost
Deprecations@deprecated with reason@deprecated(reason: "Use newField")

What Do You Need?

  1. Type design - Structs, interfaces, unions, enums
  2. Field design - Nullability, arguments, defaults
  3. Pagination - Relay-style connections
  4. Naming - Conventions for consistency
  5. Documentation - Descriptions, deprecations

Specify a number or describe your schema concern.

Routing

ResponseReference 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

Critical Rules

  • Default to nullable: Easier to make required later than vice versa
  • Use Relay pagination: Connections with edges/nodes, not lists
  • Document everything: Schema is the API documentation
  • Deprecate before removing: @deprecated with reason, wait for clients to migrate
  • Noun mutations for state changes: createUser, deletePost, closeCard
  • Avoid business logic in schema: Schema describes shape, not behavior

Schema Template

"""
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
}

Common Schema Issues

IssueSeverityFix
Unbounded listsHighUse pagination connections
Missing descriptionsMediumAdd doc comments
Inconsistent nullabilityMediumBe intentional about !
Breaking changes without deprecationHighUse @deprecated first
CRUD-style mutationsLowUse noun+verb (createUser)
No pagination on collectionsHighAdd Relay connections

Nullability Guidelines

# 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
}

Reference Index

FileTopics
types.mdObjects, interfaces, unions, enums, scalars
fields.mdNullability, arguments, defaults, lists
pagination.mdRelay connections, edges, nodes, cursors
naming.mdConventions for types, fields, mutations
documentation.mdDescriptions, deprecations, comments

Success Criteria

Schema is well-designed when:

  • All types and fields have descriptions
  • Collections use Relay pagination (not unbounded lists)
  • Nullability is intentional (not default required)
  • Naming follows conventions (PascalCase, camelCase)
  • Deprecated fields have @deprecated with reason
  • No breaking changes without deprecation period
  • Schema reads as documentation for clients

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

0/5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon