Practice English vocabulary for GraphQL schema design: contracts, nullability, enums, input types, and connection pagination patterns.
0 / 15 completed
1 / 15
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 / 15
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 / 15
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 / 15
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 / 15
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.
6 / 15
Alex: 'Hey team, I'm using the IntrospectionQuery to check if my GraphQL schema supports filtering by userId on the User type. It's returning a lot of fields I don't need – is this normal?', What does Alex likely mean?
IntrospectionQuery allows clients to discover the structure of the GraphQL server. It's intended for exploring and understanding the API, not for retrieving data itself. Alex is likely referring to the capability to examine the schema's types and fields, which is the purpose of this query. The other options misrepresent the function of IntrospectionQuery.
7 / 15
'Maria' (in a Slack message): 'I'm seeing this error: 'Field 'product' does not have an input type defined.' I created a mutation to update product details. What is the most probable reason for this error?'
GraphQL schemas require explicit definitions for input types used within mutations. Without an input type defined for 'product', the server doesn't know how to validate and process the data being sent in the mutation. This is why Maria needs to create a custom input type that matches the expected structure of the product information, ensuring correct data validation.
8 / 15
'David' (in a PR description): 'I've added an enum called OrderStatus to the Order type. This enforces that order statuses can only be one of these values: 'pending', 'shipped', or 'delivered'. Why is this beneficial?'
Using an enum like OrderStatus is crucial for maintaining data integrity. It restricts the possible values for a field, preventing incorrect or unexpected status updates that could compromise the accuracy of order information. This enforces validation at the schema level, leading to more reliable and consistent data.
9 / 15
'Sarah' (during a standup): 'We're using input types for our mutation that updates user profiles. It seems like a good practice to prevent clients from sending arbitrary data to the server.' What is the primary advantage of using input types in these mutations?
The core benefit of utilizing input types is robust data validation. They enable developers to specify required fields, enforce specific data formats (e.g., email address), and dictate the overall structure of the data being sent in mutations. This protects against invalid or unexpected data reaching the server, enhancing security and reliability.
10 / 15
'Ben' (in a code review comment): 'I'm using the connection pattern with edges/nodes/cursors for paginating through a large list of products. It seems complex, but it's necessary to handle efficiently.' What is the key purpose of this connection pattern?
The connection pattern (edges/nodes/cursors) is specifically designed to address the challenges of pagination in GraphQL. It enables clients to retrieve data in manageable chunks and manage cursors to navigate through infinite lists efficiently. This minimizes bandwidth usage and optimizes performance for large datasets.
11 / 15
Alex: 'Hey team, I'm using the IntrospectionQuery to check if my GraphQL schema supports filtering by userId on the User type. It's returning a lot of fields I don't need – is this normal?', What does Alex likely mean?
IntrospectionQuery allows clients to discover the structure of the GraphQL server. It's intended for exploring and understanding the API, not for retrieving data itself. Alex is likely referring to the capability to examine the schema's types and fields, which is the purpose of this query. The other options misrepresent the function of IntrospectionQuery.
12 / 15
'Maria' (in a Slack message): 'I'm seeing this error: 'Field 'product' does not have an input type defined.' I created a mutation to update product details. What is the most probable reason for this error?'
GraphQL schemas require explicit definitions for input types used within mutations. Without an input type defined for 'product', the server doesn't know how to validate and process the data being sent in the mutation. This is why Maria needs to create a custom input type that matches the expected structure of the product information, ensuring correct data validation.
13 / 15
'David' (in a PR description): 'I've added an enum called OrderStatus to the Order type. This enforces that order statuses can only be one of these values: 'pending', 'shipped', or 'delivered'. Why is this beneficial?'
Using an enum like OrderStatus is crucial for maintaining data integrity. It restricts the possible values for a field, preventing incorrect or unexpected status updates that could compromise the accuracy of order information. This enforces validation at the schema level, leading to more reliable and consistent data.
14 / 15
'Sarah' (during a standup): 'We're using input types for our mutation that updates user profiles. It seems like a good practice to prevent clients from sending arbitrary data to the server.' What is the primary advantage of using input types in these mutations?
The core benefit of utilizing input types is robust data validation. They enable developers to specify required fields, enforce specific data formats (e.g., email address), and dictate the overall structure of the data being sent in mutations. This protects against invalid or unexpected data reaching the server, enhancing security and reliability.
15 / 15
'Ben' (in a code review comment): 'I'm using the connection pattern with edges/nodes/cursors for paginating through a large list of products. It seems complex, but it's necessary to handle efficiently.' What is the key purpose of this connection pattern?
The connection pattern (edges/nodes/cursors) is specifically designed to address the challenges of pagination in GraphQL. It enables clients to retrieve data in manageable chunks and manage cursors to navigate through infinite lists efficiently. This minimizes bandwidth usage and optimizes performance for large datasets.
What will I practise in "GraphQL Schema Design Vocabulary"?
Practice English vocabulary for GraphQL schema design: contracts, nullability, enums, input types, and connection pagination patterns.
How many exercises are in this module?
This module has 15 multiple-choice exercises, each with instant feedback and a full explanation of the correct answer.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is free to use with no account, sign-up, or paywall.
Do I need to create an account to do these exercises?
No account is required. Just click an option to answer — your score for this session is tracked automatically in the progress bar above.
What happens if I choose the wrong answer?
You'll immediately see which answer was correct, plus a full explanation covering the vocabulary and reasoning behind it — mistakes are where most of the learning happens.
Can I retry the exercises if I want a higher score?
Yes — use the "Try again" button on the results screen to reset and go through all the questions again.
Is my progress saved if I close the page?
No. Progress is tracked only for your current visit; reloading or leaving the page resets the counter. This keeps the exercise simple and account-free.
Where can I find more GraphQL & API Gateway Language exercises?
Browse the full GraphQL & API Gateway Language hub for related drills, or check the "Next up" link below to continue with a connected topic.
How is this different from reading an article on the same topic?
Articles explain vocabulary and concepts in prose; this exercise tests and reinforces that vocabulary through active recall with immediate feedback — the two work best together.
Who writes these exercises?
Every exercise is written by the CoderSlingo team, drawing on real workplace English used in IT roles, then reviewed for accuracy and clarity.