GraphQL
ExplainedProtocol / format
Query language for APIs that lets the client specify exactly which data it needs.
GraphQL, explained
Written by EduVerseWhat it is
GraphQL is a query language for APIs, together with a server-side runtime that answers those queries. Instead of many fixed endpoints there’s usually one endpoint, plus a typed schema that describes all available data. The client sends a query listing exactly the fields it wants and gets JSON back in that same shape.
Why teams use it
With a REST API, one screen often needs several requests, or receives far more fields than it shows. GraphQL lets the frontend fetch exactly what that screen needs in a single round trip. The cost lands on the server: HTTP caching is harder, and one careless query can ask for a huge amount of data.
An example from work
You join a team with a GraphQL API and open its in-browser query editor, often GraphiQL. You write a query for a user’s name and the titles of their last five orders, with autocomplete suggesting fields from the schema. The response holds exactly those fields and nothing else.
Our own explanation, not a quote from the book.
In the book
Sentences from The Software Realm, Decoded that mention GraphQL, exactly as printed.
1 more passages about GraphQL in the full book
Read every conversation where GraphQL comes up, with the interactive slides and demos.
Where it fits
Flexible APIs where the client shapes the response
Coverage in the book
Explained and compared with alternatives, so you know where and why it’s used.