Practice English vocabulary for GraphQL schema design: contracts, nullability, enums, input types, and connection pagination patterns.
0 / 5 completed
1 / 5
What does 'the schema defines the contract' mean in GraphQL?
In GraphQL, the schema is the source of truth for the API's capabilities. Clients can only request what the schema exposes, and the server guarantees it will fulfill those types. The schema is the contract both sides adhere to.
2 / 5
What is the practical difference between 'nullable vs. non-nullable fields' in a GraphQL schema?
Using ! (non-nullable) is a strong promise to clients that the field will always have a value. If violated, GraphQL propagates nulls upward to the nearest nullable parent, potentially nulling out large response sections — so non-nullable fields should be used carefully.
3 / 5
Why is an 'enum' used to restrict a field to specific values?
GraphQL enums define a closed set of allowed values (e.g., OrderStatus: PENDING, PROCESSING, SHIPPED, DELIVERED). This prevents invalid values, improves developer experience with IDE auto-complete, and self-documents the possible states.
4 / 5
Why are 'input types used for mutations'?
Using input types (e.g., CreateOrderInput) in mutations keeps the schema clean, allows reuse across related mutations, and prevents the confusion of sharing output types as mutation arguments (which would expose fields that should not be set by clients).
5 / 5
What is the 'connection pattern (edges/nodes/cursors)' used for in GraphQL pagination?
The Relay-style connection pattern (popularized by Facebook) is the recommended GraphQL pagination approach: the connection object has edges (each with a node and a cursor), and pageInfo (hasNextPage, endCursor). Cursors enable stable, efficient pagination even as data changes.