GraphQL Schema Review Checklist
Checklist for reviewing GraphQL schemas: naming conventions, type design, pagination, error handling, security, performance, deprecation, and federation readiness with code examples and validation rules.
Overview
This checklist covers what to review in a GraphQL schema before merging or deploying: naming conventions, type design, pagination, error handling, security, performance, deprecation, and federation readiness. Run it on new schemas, on every schema-changing pull request, and as a periodic audit of long-lived APIs.
Treat a schema as a public contract, not an implementation detail. Whatever naming quirk or nullability mistake ships today is what client code will depend on next quarter, and changing it later costs a breaking change. Small inconsistencies compound into migrations nobody wants to run; review is the cheapest place to catch them.
Most of this checklist can be automated. Sections marked “automatable” have a tool listed under them: graphql-eslint for lint rules, graphql-inspector for breaking-change detection in CI, and rover for federation composition. Everything else comes down to judgment, and the items below exist to structure exactly that.
How to Use This Checklist
| Section | What breaks if you skip it | Automatable? |
|---|---|---|
| 1. Naming | Inconsistent public contract, confused clients | Yes, graphql-eslint naming rules |
| 2. Type Design | Breaking changes when nullability tightens, wrong types | Partially, graphql-inspector diff |
| 3. Pagination | Unstable pagination under writes, slow totalCount | Partially, schema review |
| 4. Error Handling | Clients parse message strings instead of codes | Partially, code review |
| 5. Security | Depth/complexity abuse, introspection leaks | Yes, server config audit |
| 6. Performance | N+1 queries, unbounded lists | Partially, tracing + review |
| 7. Deprecation | Breaking changes without warning | Yes, graphql-inspector diff |
| 8. Federation | Composition failures at the gateway | Yes, rover supergraph compose |
Walk the checklist top to bottom on a full review. For a pull request, check the sections touched by the diff plus Deprecation: every schema diff is a deprecation risk.
What a real review session looks like
Reviews that actually catch problems look a certain way. The reviewer opens the schema diff next to the query traffic, not in isolation: a new field is fine on paper and pointless if no client ever requested it. Each changed line gets three questions: who consumes this, can it legitimately be null, and what happens to queries that already exist. When a question has no answer, it goes back to the author as a blocking comment, never as a shrug.
There’s a second skill to it: reading for what isn’t there. You notice the mutation with no payload type, the list field missing pagination arguments, the enum that picked up values nobody wrote down. The checklist below exists because these omissions are invisible to linters; a human has to notice the shape that’s missing.
1. Naming Conventions
Consistent naming is the cheapest signal of a well-designed API. Clients form expectations from your names; a schema that mixes User and users, createdAt and created, forces them to look up every field instead of guessing correctly.
Reviewers tend to skim naming checks because they look cosmetic. They aren’t. The day a client SDK generates a plural accessor for a field that returns one User, or a teammate ships createUserV2, the cost lands in support threads and migration docs rather than in the schema file itself.
How to verify: the @graphql-eslint/eslint-plugin naming-convention rule enforces casing and suffix conventions in CI instead of eyeballing them.
1.1 Type Names
- Every type name is PascalCase:
User,ProductOrder - Types stay singular, so
Userand neverUsers - Edges carry the parent name plus
Edge, likeUserEdge - Connections are
{Parent}Connection - Inputs end in
Input, as inCreateUserInput - Mutation returns are
{Action}{Type}Payload, likeCreateUserPayload - Filter and sort arguments follow
{Type}Filter/{Type}Sort
# Good
type User { ... }
type ProductOrder { ... }
input CreateUserInput { ... }
type CreateUserPayload { ... }
# Bad
type Users { ... }
type user { ... }
input NewUser { ... }
type CreateUserResult { ... }
CreateUserResult looks like it could be a union of success and error types, which it isn’t: Payload is the convention mutation return types settled on, and deviating from it makes clients guess wrong.
1.2 Field Names
- Field names are camelCase:
firstName,createdAt - Booleans open with a verb:
isActive,hasPermissions - DateTime fields close with
At:createdAt,updatedAt,deletedAt - Anything counting gets the
Countsuffix:orderCount,commentCount - Identifiers are typed
ID, neverString - Abbreviations only where the domain already owns them:
URL,ISBN
# Good
type User {
id: ID!
firstName: String!
isActive: Boolean!
createdAt: DateTime!
orderCount: Int!
}
# Bad
type User {
id: String!
first_name: String!
active: Boolean!
created: String!
orders: Int!
}
Two real costs in the “Bad” version: id: String! loses the opaque-identifier contract ID gives (clients may start parsing it), and orders: Int! as a count reads like a list of orders; the Count suffix exists to prevent exactly that confusion.
1.3 Mutation Names
- Mutation names lead with a verb:
create,update,delete,archive,restore - The shape is
{verb}{Type}:createUser,updateProduct,deleteOrder - Batch versions pluralize the type:
createUsers,deleteOrders - Nothing generic like
saveormodify, which hides whether the operation inserts or updates; the client can’t tell from the name
2. Type Design
2.1 Nullability
Few schema decisions are as hard to undo as nullability, and it’s also one of the least discussed in review. Tightening a field to Non-Null later breaks every client compiled against the nullable version; leaving it nullable forever costs nothing. Still unsure? Leave it nullable.
Rules:
- Use Non-Null (!) for fields that are always present
- Use Nullable for fields that may be absent or optional
- Never make a field Non-Null if it can become null in the future
- Database required fields → Non-Null in schema
- Optional fields → Nullable in schema
- Lists: use [Type!]! for required non-empty lists
- Lists: use [Type!] for optional lists (may be null)
- Lists: use [Type] for lists that may contain null items (rare)
# Good — clear nullability contract
type User {
id: ID! # Always present
email: String! # Always present
phone: String # Optional
orders: [Order!]! # Always a list, never null items
deletedAt: DateTime # Null until deleted
}
# Bad — unsafe nullability
type User {
id: ID
email: String
orders: [Order]
deletedAt: DateTime!
}
deletedAt: DateTime! in the bad version is the classic trap: the field is legitimately null until deletion happens, so the Non-Null promises something the data can’t always give, and it still can’t be relaxed later without breaking clients.
How to verify: graphql-inspector diff flags every nullability change in a schema diff as BREAKING or DANGEROUS, so tightening sneaks into review instead of production.
2.2 Enums
- Enums cover every field whose values form a fixed set
- Values are UPPER_SNAKE_CASE
- Enum names are PascalCase
- No catch-all
Statusenum: two domains sharing it will collide the day they need different values, so useOrderStatus,UserStatus
enum OrderStatus {
PENDING
CONFIRMED
SHIPPED
DELIVERED
CANCELLED
REFUNDED
}
Enums tend to be under-modeled during review. A status: String field looks flexible until three services start interpreting the free text differently; an enum forces the vocabulary up front. Removing or renaming an enum value is a breaking change, so treat them like public constants. Adding values is safe for consumers that handle unknown values, but can still break exhaustive switch statements in typed clients, so version it in the changelog anyway.
2.3 Interfaces and Unions
- Interfaces appear only where types share a real common contract
- Unions cover fields returning different types with no shared fields
- Interface names read as nouns:
Node,Ownable - Union names say what the members have in common:
SearchResult
interface Node {
id: ID!
}
type User implements Node {
id: ID!
name: String!
}
type Product implements Node {
id: ID!
price: Float!
}
union SearchResult = User | Product | Article
The trade-offs between the two (shared fields, fragment ergonomics, __resolveType discriminators) are covered in depth by the interface polymorphism pattern.
2.4 Custom Scalars
- Domain-specific formats get their own scalars
- Every custom scalar ships a parser:
serialize,parseValue,parseLiteral - Scalar docs show real format examples inside the schema description
scalar DateTime
scalar URL
scalar Email
scalar UUID
scalar JSON
// Example scalar resolver
const DateTime = {
serialize: (value: Date) => value.toISOString(),
parseValue: (value: string) => new Date(value),
parseLiteral: (ast) => {
if (ast.kind === Kind.STRING) {
return new Date(ast.value);
}
return null;
},
};
For anything beyond a one-off format, use the maintained graphql-scalars package, which covers DateTime, EmailAddress, UUID, URL, JSON and dozens more, with validation edge cases already solved.
3. Pagination
Offset pagination (page=3&size=20) quietly breaks once writes come in: insert one row and every client’s page boundaries shift, so items repeat or disappear. Relay’s Connection pattern fixes that with opaque cursors, and it’s the shape most GraphQL tooling expects out of the box. The connection pagination pattern walks the full resolver-side implementation.
3.1 Connection Pattern
- List fields follow the Connection/Edge pattern (Relay spec)
-
pageInfoexposeshasNextPageandhasPreviousPage -
totalCountshows up only where the UI really needs it, because aCOUNT(*)on a large table isn’t free - Every edge carries
cursorandnode - Relationship data lives on the edge (
roleonUserGroupEdge), not overloaded intonode
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type UserEdge {
node: User!
cursor: String!
joinedAt: DateTime!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
type Query {
users(first: Int, after: String, last: Int, before: String): UserConnection!
}
3.2 Pagination Checklist
-
firstandlastare capped server-side (say, 100), or a client can ask for the whole table - A sane default page size exists (20 is typical)
- Cursors stay opaque base64; if clients can build them, you’re back to offset semantics
- Malformed
after/beforecursors fail with a clear error, not a 500 - No offset pagination on large datasets
-
totalCountcomputes only on demand; keep it behind a cheap field or defer it
Pagination bugs are invisible on a quiet staging server and painful in production. A smoke test that inserts rows while a client pages through the list catches what a static query never will.
4. Error Handling
There are two error channels in GraphQL: thrown errors (the errors array with extensions.code) for unexpected failures, and typed error fields on mutation payloads for expected business failures (validation, duplicates, conflicts). Mixing them up, like a validation error thrown as a hard error, turns an expected state into a client-side exception path. The tell of a weak error contract is client code doing message.includes('email'); once that ships, you can’t change the message text without breaking someone. The error extension pattern covers the thrown-error channel; this section covers payload errors.
4.1 Mutation Errors
# Mutation payload should include userErrors for partial failures
type CreateUserPayload {
user: User
userErrors: [UserError!]!
}
type UserError {
field: String
message: String!
code: UserErrorCode!
}
enum UserErrorCode {
INVALID_EMAIL
DUPLICATE_EMAIL
PASSWORD_TOO_SHORT
UNAUTHORIZED
}
Note user is nullable: on a validation failure the mutation returns user: null plus a populated userErrors list, so clients can render per-field errors without a try/catch.
4.2 Error Handling Checklist
- Mutations return payload types carrying error fields
- Errors are typed by code, not by message text: clients switch on
code, never parsemessage - Validation errors carry field-level detail (
field,constraint,max) so forms can light up the right input. The input validation recipe shows the resolver-side checks that feed this - Auth failures use the standard
UNAUTHENTICATEDcode - Authorization failures use the standard
FORBIDDENcode - Error messages leak nothing sensitive: no SQL fragments, stack traces, or internal hostnames
- Rate-limit errors come with
retryAfterso the client can schedule the retry
5. Security
GraphQL’s flexibility is the attack surface: one query can traverse the whole graph, and nesting is unbounded unless you cap it. Depth and complexity limits exist to stop the friends { friends { friends { ... } } } class of queries before they hit the resolvers. In practice these limits get configured the day after the first incident rather than before it, which is exactly why they belong on a review checklist.
5.1 Query Depth Limiting
// Server configuration — limit query depth
import { createDepthLimit } from 'graphql-depth-limit';
const depthLimit = createDepthLimit({
maxDepth: 10,
ignore: ['__schema', '__type'],
});
graphql-depth-limit works but hasn’t seen a release in years. For anything beyond depth, the maintained option is graphql-armor, which bundles depth limit, alias limit, directive limit, cost/complexity limit, and introspection blocking in one plugin.
5.2 Query Complexity
// Limit total query complexity
import { createComplexityRule } from 'graphql-query-complexity';
const complexityRule = createComplexityRule({
maximumComplexity: 1000,
estimators: [
fieldExtensionsEstimator(),
directiveEstimator(),
simpleEstimator({ defaultComplexity: 1 }),
],
});
Depth caps nesting; complexity caps breadth: a flat query asking for 500 fields is shallow but expensive. You want both, or a single cost-based limit (graphql-armor’s cost limit subsumes both).
5.3 Security Checklist
- Query depth is capped (10-15 levels, tuned just above your deepest legitimate query)
- Query complexity has a ceiling too, so flat-but-wide queries can’t slip past the depth rule
- Rate limiting applies per user/IP
- Every non-public field sits behind authentication
- Authorization runs per field, not only per query; a public
postsfield leakingpost.author.emailis the classic miss - Introspection is off in production, or gated to authenticated clients if public docs tooling needs it
- Production clients use persisted queries
- Error messages carry no sensitive data
- CORS is configured for your real origins
- Upload size limits are enforced
6. Performance
The N+1 problem is GraphQL’s signature performance bug: a query for 50 orders each fetching order.user fires 50 identical user queries unless you batch. It’s sneaky because nothing looks broken. Data comes back correct, just slow, and nobody notices until they count database calls per request. Tracing shows it immediately: look for the same SQL statement repeated per parent object.
6.1 N+1 Prevention
// Use DataLoader to batch and cache database queries
import DataLoader from 'dataloader';
const userLoader = new DataLoader(async (userIds) => {
const users = await db.users.findMany({ where: { id: { in: userIds } } });
return userIds.map(id => users.find(u => u.id === id));
});
// In resolver
const resolvers = {
Order: {
user: (parent, _, context) => context.loaders.user.load(parent.userId),
},
};
The DataLoader batching recipe and the DataLoader pattern cover the per-tick dedup contract and common pitfalls, like caching errors, or forgetting that the loader cache lives per request and should be rebuilt in context creation.
6.2 Performance Checklist
- Every N+1-prone resolver has a DataLoader in front
- Database queries batch per request, not per resolver call
- Resolvers don’t hit the database for fields the client never asked for
- Slow fields get
@defer. Part of the incremental delivery work; support varies by server, check yours before relying on it - Large lists get
@stream; same incremental delivery caveat - Field-level caching where it pays off
- Production clients send persisted queries (smaller payloads, allow-listing as a bonus)
- Responses go out compressed (gzip/brotli)
- Subscriptions release resources on disconnect
7. Deprecation
GraphQL’s answer to “we need to change the schema” isn’t versioning; it’s deprecation. The @deprecated directive is built into the spec: tools, docs, and typed clients all surface it without extra work. Yet deprecation failures usually aren’t technical at all. The field gets @deprecated, nobody tells the clients, usage never drops, and the field either stays forever or gets deleted angrily. The checklist items below exist to close that loop.
7.1 Deprecation Checklist
- Every deprecated field carries
@deprecatedwith a realreason; “deprecated” alone tells clients nothing - The reason names the replacement to move to
- The retirement timeline reaches clients, not just the schema
- Usage of deprecated fields is actually tracked. Apollo Studio field usage metrics or your own resolver analytics show who’s still calling them
- Removal happens only after the deprecation window (6 months minimum) or when usage reaches zero
- Every breaking change lands in the changelog
type User {
id: ID!
name: String! @deprecated(reason: "Use firstName and lastName instead")
firstName: String!
lastName: String!
}
graphql-inspector diff classifies schema changes as BREAKING, DANGEROUS, or NON_BREAKING, so run it in CI on every schema PR and a silent breaking change can’t reach production.
8. Federation Readiness
Federation adds a failure mode that standalone schema validity can’t catch: an entity missing its @key, a scalar defined differently in two subgraphs, a circular extension. Your schema either composes or it doesn’t, and the gateway is the wrong place to find out. Minutes of review here save hours of a broken deploy.
8.1 Federation Checklist
- Every entity carries a
@keyon fields that identify it uniquely across subgraphs -
__resolveReferenceexists for each entity - No circular dependencies between subgraphs (A extends a type from B which extends a type from A)
- Shared types are extended with
@extends - Custom scalars match identically in every subgraph using them
- Enum values stay consistent across subgraphs
- No orphaned types; anything unreachable from a query is dead weight in the supergraph
# Subgraph A — User entity
type User @key(fields: "id") {
id: ID!
name: String!
}
# Subgraph B — extends User
type User @key(fields: "id") @extends {
id: ID! @external
orders: [Order!]!
}
How to verify: rover supergraph compose composes the subgraphs locally and reports every violation before deploy, so wire it into CI. For the full onboarding path (subgraph templates, gateway, context propagation), see the federation onboarding template.
See Also
Frequently Asked Questions
How do I handle breaking changes in a GraphQL schema?
The first rule: no field gets deleted without a deprecation period. Ship the replacement, mark the old field with @deprecated(reason: "..."), publish the timeline, and watch real usage until it hits zero or the period ends (6 months minimum). When a type itself has to change, stand up the new type and deprecate the old one. Run graphql-inspector diff in CI so breaking changes get flagged instead of shipped.
What is the maximum query depth I should allow?
Somewhere between 10 and 15 covers most APIs. Look at the queries your real clients send, find the deepest legitimate one, and put the limit just above it. Malicious queries with excessive depth (user { friends { friends { friends { ... } } } }) cause exponential resource consumption. Enforce it server-side with graphql-depth-limit or the depth limit in graphql-armor.
Should I use offset or cursor-based pagination?
If a list can grow, it wants cursors (the Connection pattern). They stay stable under writes, since new rows don't shift positions, and they support bidirectional pagination. Keep offset for small static lists only, like a settings screen. Migrating an API from offsets to cursors later means a breaking change for every client, so pick cursors from the start.
How do I prevent N+1 queries in GraphQL?
Any resolver that fetches related data wants a DataLoader in front of it. Within one execution tick it merges every load of the same resource and caches by key, so 50 user queries collapse into one WHERE id IN (...). Create loaders per request: a shared loader across requests leaks stale data between users. Verify batching with query logging or tracing rather than assuming it works.
What should I check before enabling federation?
Each entity wants a @key on fields that identify it uniquely, a __resolveReference per entity, zero circular dependencies between subgraphs, and custom scalars plus enums defined identically wherever they appear. Compose locally with rover supergraph compose in CI, which reports every composition error before the gateway does.
How do I automate schema review in CI?
Three tools cover most of it: graphql-inspector diff (breaking/dangerous/non-breaking classification on every PR), graphql-eslint (naming conventions, deprecated-field usage, input-name rules), and rover supergraph compose for federation. What stays manual is judgment work: nullability trade-offs, whether a field earns its place in the API, and security configuration review.
Can I run this checklist on a schema already in production?
Yes, and you should. Run graphql-inspector diff against the last released version to see what drifted, then work through the sections top to bottom. Expect failures; log them as issues instead of fixing silently, because changing a production schema follows the same breaking-change rules as adding to it.
Who should review schema changes?
At least one person who didn't write the change and knows who consumes the API. Schema review is closer to API design review than code review; the reviewer needs context on which clients depend on which fields, not just SDL fluency. On federated graphs, pull in someone from the gateway team whenever entities are touched.
Related Resources
GraphQL API Design Guidelines
Internal GraphQL API design guidelines template with schema structure, naming, mutations, pagination, auth, rate limiting, versioning, and federation rules.
DocGraphQL Deprecation Policy Template
Policy template for deprecating GraphQL fields, types, and enum values without breaking clients, with timelines, usage tracking, and migration examples.
GuideComplete Guide to GraphQL Federation
Build and operate unified GraphQL APIs across multiple services with Apollo Federation. Covers subgraphs, supergraph composition, entity resolution, router deployment, security, and observability.
DocGraphQL Federation Onboarding Template
Template for onboarding a service to a federated GraphQL graph: subgraph setup, entities, resolvers, gateway integration, testing, deployment, and monitoring.