skip to content

Schema Design & Evolution

The judgement half of the contract: naming, mutation shape, nullability and the changes that break a client. A graph has no version number to hide behind, which is why evolution is the harder half.

part ofGraphQLoverview, primer and where to startread it →
on this pageshow

questions

page 2 of 2

How do you decide whether to expose a generic `where` input with nested AND/OR/NOT on a GraphQL list field?

level: principalimportance: should knowfreq 38%

basics

~20 s

Decide on consumer count and trust. A recursive where input turns the schema into a query language: every combination becomes a supported contract, nobody can enumerate the access paths to index, and static cost scoring loses its grip.

open as a page

How would you set a nullability policy for a large GraphQL schema, given Non-Null is a one-way door?

level: principalimportance: should knowfreq 36%

basics

~20 s

Treat each Non-Null as a promise you can never withdraw without a client migration. Default to nullable, spend Non-Null only on values guaranteed by an object's identity, and make adding one a reviewed decision rather than a stylistic default.

open as a page

You own a GraphQL graph twelve teams publish to — what fails the schema-check gate, what only warns, and who may override?

level: principalimportance: should knowfreq 31%

basics

~20 s

Hard-fail only breaking edits with observed usage; require a named reviewer for the dangerous class and for breaking edits with credible zero-usage evidence; report nothing for safe additions. Make overrides possible but recorded, and treat the override rate as the gate's health metric.

open as a page

How do you set a schema deprecation policy for a GraphQL API whose oldest clients are shipped mobile apps?

level: principalimportance: should knowfreq 41%

basics

~20 s

Make deprecation a promise, not a label: a stated window, a named replacement, an owner and a date. The window comes from how long the oldest client you cannot force to upgrade survives in the field.

open as a page

Are circular references between two object types legal in a GraphQL schema?

level: juniorimportance: nice to knowfreq 27%

basics

~20 s

Yes. Object types refer to each other by name, so a schema is a graph and cycles — including a type referring to itself — are ordinary. What is finite is the document a caller writes, not the type graph.

open as a page

How do you design a GraphQL input where exactly one of several alternatives must be supplied?

level: seniorimportance: nice to knowfreq 26%

basics

~20 s

Released GraphQL editions cannot express "exactly one of", so the usual shape is several nullable fields plus a runtime check. The alternatives are one schema field per case, or the draft @oneOf input marking where servers support it.

open as a page

How do you make a GraphQL list field require at least one selective filter argument?

level: seniorimportance: nice to knowfreq 24%

basics

~20 s

The type system cannot express "at least one of these". Non-null makes a filter mandatory on every call, breaking existing documents. The options are separate fields with a required anchor, a required argument on a new field, or a documented runtime check.

open as a page

showing 31–37 of 37