Recall & Review
beginner
What is the main difference between GraphQL and REST in how they fetch data?
GraphQL allows clients to request exactly the data they need in a single query, while REST typically requires multiple endpoints and requests to fetch related data.
Click to reveal answer
intermediate
How does GraphQL handle versioning compared to REST?
GraphQL avoids versioning by evolving the schema and allowing clients to request only the fields they want, whereas REST often uses versioned endpoints to manage changes.
Click to reveal answer
intermediate
What is a key advantage of REST's use of HTTP methods over GraphQL?
REST uses standard HTTP methods (GET, POST, PUT, DELETE) which are well understood and supported by tools and infrastructure, making it simple to cache and secure.
Click to reveal answer
beginner
Why might GraphQL reduce over-fetching and under-fetching of data?
Because clients specify exactly which fields they want in a query, GraphQL avoids sending too much or too little data compared to REST endpoints that return fixed data structures.
Click to reveal answer
advanced
What is a common challenge when using GraphQL compared to REST?
GraphQL can be more complex to set up and optimize, especially for caching and error handling, while REST benefits from simpler, well-known patterns.
Click to reveal answer
Which of the following best describes how GraphQL queries work?
✗ Incorrect
GraphQL lets clients request exactly the data they want in one query.
How does REST typically handle API versioning?
✗ Incorrect
REST often uses versioned URLs to manage changes in the API.
What is a benefit of REST's use of HTTP methods?
✗ Incorrect
Standard HTTP methods help with caching and security in REST.
Why might GraphQL reduce over-fetching of data?
✗ Incorrect
GraphQL queries specify exactly the needed fields, avoiding extra data.
What is a common challenge when adopting GraphQL?
✗ Incorrect
GraphQL can be complex to set up caching and error handling compared to REST.
Explain the main differences between GraphQL and REST in how they handle data fetching and versioning.
Think about how clients ask for data and how APIs change over time.
You got /4 concepts.
Describe one advantage and one challenge of using GraphQL compared to REST.
Consider what makes GraphQL flexible but also what makes it harder to manage.
You got /2 concepts.