Systems & Backend

GraphQL

A query language for APIs where the client asks for exactly the fields it needs in one request.

GraphQL is an API query language and runtime where the client specifies exactly which fields it wants and the server returns just that shape in a single request — instead of REST’s fixed endpoints that over- or under-fetch.

Worked example: a mobile screen needing a user’s name and their last three order totals fetches precisely that in one GraphQL query, versus REST calls to /user then /user/orders returning far more than needed. Gotcha: the flexibility moves cost to the server — an arbitrary client query can trigger the N+1 problem or an expensive deep query — so you need query-depth limits, cost analysis, and batching; GraphQL trades REST’s simple HTTP caching for client flexibility.