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 pageshowhide
explore
- Field & Type Naming3 questions
- Designing Mutations3 questions
- Nullable by Default4 questions
- Input Object Design3 questions
- Modelling Relationships4 questions
- Versionless Evolution4 questions
- Breaking-Change Classes4 questions
- Schema Checks & Registries4 questions
- Client-Shaped Schemas4 questions
- Filter & Sort Arguments4 questions
questions
page 2 of 2How do you decide whether to expose a generic `where` input with nested AND/OR/NOT on a GraphQL list field?
basics
~20 sDecide 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.
How would you set a nullability policy for a large GraphQL schema, given Non-Null is a one-way door?
basics
~20 sTreat 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.
You own a GraphQL graph twelve teams publish to — what fails the schema-check gate, what only warns, and who may override?
basics
~20 sHard-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.
How do you set a schema deprecation policy for a GraphQL API whose oldest clients are shipped mobile apps?
basics
~20 sMake 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.
Are circular references between two object types legal in a GraphQL schema?
basics
~20 sYes. 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.
How do you design a GraphQL input where exactly one of several alternatives must be supplied?
basics
~20 sReleased 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.
How do you make a GraphQL list field require at least one selective filter argument?
basics
~20 sThe 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.
showing 31–37 of 37