Over Fetching
A fixed response often returns far more data than a screen needs, wasting bandwidth and slowing mobile clients. Partial responses let the client name which fields it wants, so the server sends only those.
How It Looks
A common pattern is a fields query parameter, such as fields equals id name email. The server parses the list and projects just those attributes. GraphQL takes this further by making field selection the core of every query.
Benefits and Costs
- Smaller payloads cut latency and mobile data use.
- The server can skip expensive joins for unrequested fields.
- The cost is more parsing, harder caching, and trickier security since field access must be checked.
Guarding It
Always validate requested fields against an allow list so a client cannot pull sensitive columns. Cache keys must include the field set, since two requests for different fields return different bodies.
Key idea
Field selection lets clients request only needed attributes, shrinking payloads and skipping work, as long as the server validates fields and keys caches by field set.