0
0
GraphQLquery~5 mins

GraphQL vs REST comparison - Quick Revision & Key Differences

Choose your learning style9 modes available
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?
AClients receive all data from the server regardless of need
BClients must call multiple endpoints to get related data
CClients use HTTP methods to fetch data
DClients specify exactly what data they want in a single request
How does REST typically handle API versioning?
ABy using versioned endpoints like /v1/, /v2/
BBy evolving the schema without versions
CBy letting clients choose fields dynamically
DBy using GraphQL queries
What is a benefit of REST's use of HTTP methods?
AThey allow clients to specify fields dynamically
BThey simplify caching and security with standard methods
CThey reduce the number of requests needed
DThey eliminate the need for endpoints
Why might GraphQL reduce over-fetching of data?
ABecause clients specify exactly which fields they want
BBecause it caches all responses
CBecause it uses multiple endpoints
DBecause it returns all data by default
What is a common challenge when adopting GraphQL?
AIt has no support for querying data
BIt is simpler than REST to implement
CIt can be complex to optimize caching and error handling
DIt requires multiple endpoints for each resource
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.