What if you could get just the data you want, instantly and without waste?
Why Over-fetching and under-fetching problems in GraphQL? - Purpose & Use Cases
Imagine you want to get just a friend's phone number from a huge phone book. You flip through pages and copy the entire page with many names and numbers, even though you only need one number.
This manual way wastes time and effort. You get too much information you don't need (over-fetching), or sometimes you get too little and have to look again (under-fetching). It's slow and confusing.
GraphQL lets you ask exactly for the data you want, no more and no less. It's like telling the phone book to give you only the friend's phone number, saving time and avoiding extra clutter.
query { allUsers { id name email phone address } } # gets everything even if you want only phonequery { user(id: 1) { phone } } # gets only the phone number you needYou can fetch just the right data in one go, making apps faster and easier to build.
A social media app shows your friend's profile picture and name instantly without loading their entire post history or settings.
Manual data fetching often grabs too much or too little data.
Over-fetching wastes resources; under-fetching causes extra requests.
GraphQL solves this by letting you specify exactly what you need.