Ask for exactly what you need — and own the cost.
GraphQL — Strengths and Pitfalls: ask for exactly what you need
turn boundaries into contracts
Client gets exactly what it needs.
GraphQL exposes a typed schema and lets clients fetch exactly the fields they want in one request. It excels at graph-shaped data but shifts complexity to the server.
Resolvers fetch fields; naïve resolvers cause N+1 (one DB call per node). Dataloader batches.
Persisted queries: client sends an ID, server has the canonical query — cacheable, audited, safer.
Cost limiting (depth, complexity scoring) is required to prevent expensive queries.
Mobile screen needs user, their last 10 orders, and items per order.