Agent skill

Graphql Schema

by apollographql in apollographql/skills

Guide for designing and changing GraphQL schemas following industry best practices.

MITAuto-check passedBackend & APIs

Install Graphql Schema

skills CLI
$ npx skills add apollographql/skills --skill graphql-schema -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install apollographql/skills graphql-schema --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/apollographql/skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/graphql-schema .claude/skills/graphql-schema && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
graphql-schema
GitHub stars
117
Token cost
~1.3k tokens
SKILL.md length
436 words
Files
6 (incl. references)
Skills in repo
12
Repo updated
First seen
Licence
MIT

At a glance

Guide for designing and changing GraphQL schemas following industry best practices.

  • Works in 3 steps: Design for Client Needs → Be Explicit → Design for Evolution
  • Edit GraphQL SDL
  • SKILL.md covers Schema Design Principles, Quick Reference, Reference Files and Key Rules, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Graphql Schema is an agent skill from apollographql/skills. Guide for designing and changing GraphQL schemas following industry best practices. Use this skill whenever you create or edit GraphQL SDL, such as a schema.graphql file or typeDefs, including when: (1) designing a new GraphQL schema or API, (2) adding or changing types, fields, arguments, mutations, or descriptions in an existing schema, (3) reviewing existing schema for improvements, (4) deciding on type structures or nullability, (5) implementing pagination or error patterns, (6) ensuring security in schema…

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/errors.md`, `references/naming.md` and `references/pagination.md`). Compatibility notes: Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.)

It sits in Backend & APIs, covering GraphQL. It works with GraphQL. The repository describes itself as: Apollo GraphQL Agent Skills. The licence is MIT.

When your agent uses it

  • Edit GraphQL SDL
  • Such as a schema.graphql file
  • Including when:
  • Designing a new GraphQL schema

Example prompts

  • “/graphql-schema”

Requirements

  • Compatibility (from SKILL.md): Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.)
  • Pre-approved tools (allowed-tools): Bash(npm:*), Bash(npx:*), Read, Write, Edit, Glob, Grep

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Design for Client Needs
  2. Be Explicit
  3. Design for Evolution

What it can do on your machine

Read from SKILL.md and the folder at commit 5f02fcf. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(npm:*)
    • Bash(npx:*)
    • Read
    • Write
    • Edit
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are graphql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.)

    From compatibility in the SKILL.md frontmatter.

Context cost

Graphql Schema loads about 1.3k tokens when it runs, and up to ~11k if it reads all its reference files. Until then it costs about 136 tokens; SKILL.md has 436 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~136
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~11k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from apollographql/skills at commit 5f02fcf, republished under its MIT licence (© apollographql). 436 words, ~1,262 tokens.

Download SKILL.mdSave it as .claude/skills/graphql-schema/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
graphql-schema
description
Guide for designing and changing GraphQL schemas following industry best practices. Use this skill whenever you create or edit GraphQL SDL, such as a `schema.graphql` file or `typeDefs`, including when: (1) designing a new GraphQL schema or API, (2) adding or changing types, fields, arguments, mutations, or descriptions in an existing schema, (3) reviewing existing schema for improvements, (4) deciding on type structures or nullability, (5) implementing pagination or error patterns, (6) ensuring security in schema design.
allowed-tools
Bash(npm:*), Bash(npx:*), Read, Write, Edit, Glob, Grep
compatibility
Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.)
license
MIT
metadata.author
apollographql
metadata.version
1.0.2

GraphQL Schema Design Guide

This guide covers best practices for designing GraphQL schemas that are intuitive, performant, and maintainable. Schema design is primarily a server-side concern that directly impacts API usability.

Schema Design Principles

1. Design for Client Needs
  • Think about what queries clients will write
  • Organize types around use cases, not database tables
  • Expose capabilities, not implementation details
2. Be Explicit
  • Use clear, descriptive names
  • Make nullability intentional
  • Document with descriptions
3. Design for Evolution
  • Plan for backwards compatibility
  • Use deprecation before removal
  • Avoid breaking changes
  • Give every new argument or input field a default value, or make it nullable. Existing clients don't send it, so a required field without a default makes their requests fail validation.

Quick Reference

Type Definition Syntax
graphql
"""
A user in the system.
"""
type User {
  id: ID!
  email: String!
  name: String
  posts(first: Int = 10, after: String): PostConnection!
  createdAt: DateTime!
}
Nullability Rules
PatternMeaning
StringNullable - may be null
String!Non-null - always has value
[String]Nullable list, nullable items
[String!]Nullable list, non-null items
[String]!Non-null list, nullable items
[String!]!Non-null list, non-null items

Best Practice: Use [Type!]! for lists - empty list over null, no null items.

Input vs Output Types
graphql
# Output type - what clients receive
type User {
  id: ID!
  email: String!
  createdAt: DateTime!
}

# Input type - what clients send
input CreateUserInput {
  email: String!
  name: String
}

# Mutation using input type
type Mutation {
  createUser(input: CreateUserInput!): User!
}
Interface Pattern
graphql
interface Node {
  id: ID!
}

type User implements Node {
  id: ID!
  email: String!
}

type Post implements Node {
  id: ID!
  title: String!
}
Union Pattern
graphql
union SearchResult = User | Post | Comment

type Query {
  search(query: String!): [SearchResult!]!
}

Reference Files

Detailed documentation for specific topics:

  • Types - Type design patterns, interfaces, unions, and custom scalars
  • Naming - Naming conventions for types, fields, and arguments
  • Pagination - Connection pattern and cursor-based pagination
  • Errors - Error modeling and result types
  • Security - Security best practices for schema design

Key Rules

Type Design
  • Define types based on domain concepts, not data storage
  • Use interfaces for shared fields across types
  • Use unions for mutually exclusive types
  • Keep types focused (single responsibility)
  • Avoid deep nesting - flatten when possible
Show full SKILL.md (178 more words)Show less
Field Design
  • Fields should be named from client's perspective
  • Return the most specific type possible
  • Make expensive fields explicit (consider arguments)
  • Use arguments for filtering, sorting, pagination
Mutation Design
  • Use single input argument pattern: mutation(input: InputType!)
  • Return affected objects in mutation responses
  • Model mutations around business operations, not CRUD
  • Consider returning a union of success/error types
ID Strategy
  • Use globally unique IDs when possible
  • Implement Node interface for refetchability
  • Base64-encode compound IDs if needed

Ground Rules

  • ALWAYS add descriptions to types and fields
  • ALWAYS use non-null (!) for fields that cannot be null
  • ALWAYS use [Type!]! pattern for lists
  • ALWAYS paginate lists that can grow without limit, such as Query.users or Post.comments: return a connection and give first a default page size
  • NEVER expose database internals in schema
  • NEVER break backwards compatibility without deprecation
  • NEVER add a required argument or input field without a default value
  • PREFER dedicated input types over many arguments
  • PREFER enums over arbitrary strings for fixed values
  • USE ID type for identifiers, not String or Int
  • USE custom scalars for domain-specific values (DateTime, Email, URL)

© apollographql, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in skills/graphql-schema of apollographql/skills.

  • SKILL.md
  • references/errors.md
  • references/naming.md
  • references/pagination.md
  • references/security.md
  • references/types.md

Open the folder on GitHubat commit 5f02fcf

Compare with similar skills

Graphql Schema next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Graphql Schema compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Graphql Schema this skillapollographql/skills117—~1.3kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15818 repos~4kAutomated safety check: PassAGPL-3.0
GraphQL Operations with CodegenChrisWiles/claude-code-showcase6.1k3 repos~1.5kAutomated safety check: PassNone
API Design Principlesjh941213/my-cc-harness12620 repos~3.4kAutomated safety check: PassNone
API And Interface Designdzhalaevd/Donatello1359 repos~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • GraphQL Operations with Codegen

    ChrisWiles/claude-code-showcase

    Sets the rules for writing GraphQL queries and mutations in .gql files, running codegen, and using generated Apollo hooks with proper error and loading handling.

    6.1k GitHub starsUsed in 3 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 20 repos~3.4k tokens
    Backend & APIsAuto-check passed
  • API And Interface Design

    dzhalaevd/Donatello

    Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 9 repos~2.6k tokens
    Backend & APIsAuto-check passed
  • Designing APIs

    CloudAI-X/claude-workflow-v2

    Designs REST and GraphQL APIs including endpoints, error handling, versioning, and documentation.

    1.4k GitHub starsUsed in 2 repos~1.2k tokens
    Backend & APIsAuto-check passed

More from apollographql/skills

All 12 skills in this repo
  • Apollo Federation

    apollographql/skills

    Guide for authoring Apollo Federation subgraph schemas. An agent skill from apollographql/skills.

    117 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Apollo iOS

    apollographql/skills

    Guide for building Apple-platform applications with Apollo iOS, the strongly-typed GraphQL client for Swift.

    117 GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Graphos Factory

    apollographql/skills

    Build and iterate on an Apollo Connectors subgraph for a GraphOS supergraph from a REST API, with or without an OpenAPI or Swagger spec, in a dedicated git workspace that records what the API…

    117 GitHub stars~15k tokensUpdated yesterday
    Auto-check passed
  • Graphql Operations

    apollographql/skills

    Guide for writing GraphQL operations (queries, mutations, fragments) following best practices.

    117 GitHub starsUsed in 1 repo~1.3k tokens
    Auto-check passed
  • Apollo Client

    apollographql/skills

    Guide for building React applications with Apollo Client 4.x.

    117 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Apollo Connectors

    apollographql/skills

    DEPRECATED: superseded by the graphos-factory skill (npx skills add apollographql/skills@graphos-factory), which builds and maintains a Connectors subgraph from a REST API with recorded decisions…

    117 GitHub stars~1.8k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Graphql Schema

What does Graphql Schema do?

Guide for designing and changing GraphQL schemas following industry best practices. Graphql Schema is an agent skill from apollographql/skills. Guide for designing and changing GraphQL schemas following industry best practices.

When should I use Graphql Schema?

Graphql Schema fits situations like: edit GraphQL SDL; such as a schema.graphql file; including when:; designing a new GraphQL schema.

How do I install Graphql Schema in Claude Code?

Run `npx skills add apollographql/skills --skill graphql-schema -a claude-code`. Or copy the skill folder (skills/graphql-schema in apollographql/skills) into .claude/skills/graphql-schema in your project. Claude Code loads it when a task matches its description.

How do I install Graphql Schema in Codex?

Run `npx skills add apollographql/skills --skill graphql-schema -a codex`. Or copy the skill folder (skills/graphql-schema in apollographql/skills) into .agents/skills/graphql-schema in your project. Codex loads it when a task matches its description.

Can I use Graphql Schema in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add apollographql/skills --skill graphql-schema -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/graphql-schema, .gemini/skills/graphql-schema, .github/skills/graphql-schema and .opencode/skills/graphql-schema in your project.

What does Graphql Schema need to run?

SKILL.md names no scripts, command-line tools or credentials: Graphql Schema is instructions for the agent only. Its frontmatter pre-approves these tools: Bash(npm:*), Bash(npx:*), Read, Write, Edit, Glob, Grep. Compatibility (from SKILL.md): Any GraphQL implementation (Apollo Server, graphql-js, Yoga, etc.).

Does Graphql Schema access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Graphql Schema safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Graphql Schema use?

Graphql Schema is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Graphql Schema use?

About 1.3k tokens (SKILL.md is roughly 5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.5k tokens, read only when the agent opens those files.

What are the alternatives to Graphql Schema?

Skills that share tags, products or a category with Graphql Schema: API Designer (Jeffallan/claude-skills, 12k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars), GraphQL Operations with Codegen (ChrisWiles/claude-code-showcase, 6.1k stars) and API Design Principles (jh941213/my-cc-harness, 126 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Graphql Schema?

apollographql (a GitHub organization) maintains it in apollographql/skills, which has 117 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 7, 2026.

Source: apollographql/skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.