GraphQL, explained
Facebook built GraphQL and released it publicly in 2015. It is now used by many CMS and commerce platforms, including headless options such as Contentful and Shopify's Storefront API.
With a typical REST API, each endpoint returns a fixed shape, so you can end up with too much data or need several calls. A GraphQL query names its fields and can follow links in one go.
The API is described by a typed schema. That gives developers good tools, such as autocomplete and early errors when a query asks for a field that does not exist.
It is not free of downsides. Caching can be harder than with plain URLs, and the server needs protection from very expensive queries. For simple needs, REST is often enough.



