0
0
GraphQLquery~5 mins

Over-fetching and under-fetching problems in GraphQL - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is over-fetching in GraphQL?
Over-fetching happens when a query asks for more data than needed, causing extra information to be sent and slowing down the app.
Click to reveal answer
beginner
What does under-fetching mean in GraphQL?
Under-fetching occurs when a query does not request enough data, so the app must make multiple requests to get all needed information.
Click to reveal answer
beginner
How does GraphQL help solve over-fetching and under-fetching problems?
GraphQL lets clients ask exactly for the data they want, no more and no less, which avoids both over-fetching and under-fetching.
Click to reveal answer
intermediate
Give an example of over-fetching in a REST API compared to GraphQL.
In REST, a user profile endpoint might return all user info even if the app only needs the name. In GraphQL, the query can ask just for the name, avoiding extra data.
Click to reveal answer
intermediate
Why can under-fetching cause performance issues?
Under-fetching causes multiple network requests to get all needed data, which slows down the app and uses more resources.
Click to reveal answer
What problem does over-fetching cause?
AGetting too much data than needed
BGetting too little data than needed
CNo data returned
DData format errors
Under-fetching leads to:
AMultiple requests to get all data
BOne request with all data
CNo data returned
DFaster app performance
How does GraphQL prevent over-fetching?
ABy returning all data always
BBy limiting queries to one field
CBy caching data on the server
DBy letting clients specify exactly what data they want
Which is a common cause of under-fetching?
ARequesting too many fields
BUsing GraphQL
CRequesting too few fields
DUsing REST APIs
What is a benefit of avoiding over-fetching and under-fetching?
AMore network traffic
BBetter app performance and user experience
CSlower app loading
DMore server errors
Explain over-fetching and under-fetching problems in simple terms.
Think about asking for too much or too little data.
You got /3 concepts.
    How does GraphQL help fix over-fetching and under-fetching issues compared to REST APIs?
    Focus on how GraphQL queries work.
    You got /3 concepts.