14 skills · 41 min
Skills
Skill 11 of 14
Guide for designing GraphQL schemas following industry best practices.
2 minutes · 370 words · 18 sections
Install
npx skills add apollographql/skills --skill graphql-schemanpx skills add apollographql/skills/plugin marketplace add apollographql/skillsThe first command installs just this skill, by the name in its SKILL.md; the second installs the whole repository.
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.
"""
A user in the system.
"""
type User {
id: ID!
email: String!
name: String
posts(first: Int = 10, after: String): PostConnection!
createdAt: DateTime!
| Pattern | Meaning |
|---|---|
| String | Nullable - 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.
# 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
interface Node {
id: ID!
}
type User implements Node {
id: ID!
email: String!
}
type Post implements Node {
id: ID!
title: String!
union SearchResult = User | Post | Comment
type Query {
search(query: String!): [SearchResult!]!
}Detailed documentation for specific topics:
mutation(input: InputType!)Node interface for refetchabilityID type for identifiers, not String or IntGuide for designing GraphQL schemas following industry best practices. Use this skill when: (1) designing a new GraphQL schema or API, (2) reviewing existing schema for improvements, (3) deciding on type structures or nullability, (4) implementing pagination or error patterns, (5) ensuring security in schema design.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
Bash(npm:*)Bash(npx:*)ReadWriteEditGlobGrepskills/graphql-schema/SKILL.mdmain, last pushed 23 September 2026.SKILL.md, not by matching a directory convention. One layout observed: skills/*/SKILL.md.h1 and no skipped levels:.claude-plugin/marketplace.json by Apollo GraphQL, declaring 1 plugin. It is read for editorial metadata only — never as the skill index, which is always the repository tree./apollographql/skills.md, and each skill at its own URL..md5 files · 37 KB
Everything this skill ships beside its prose. All of it is set here, as subchapters of skill 11.
Documentation the agent loads on demand, rather than up front.