GraphQL
A query language and runtime for APIs in which the client sends a query to one endpoint and names exactly the fields it wants from a typed graph of data.
In more detail
It suits many clients that need different shapes of connected data, saving round trips. In exchange, HTTP caching is less automatic, authorization must apply to every field and relationship, and resolvers need depth, cost and N+1 controls.
Related terms
- GraphQL resolver — The function a GraphQL server runs to produce the value of one field in a query.
- query depth and cost limits — Limits a GraphQL server places on how deeply nested or how expensive a single query may be.
- REST — An architectural style for networked software built on named resources, representations of their state, stateless requests and a uniform interface.
- N+1 query problem — A performance bug where code runs one query for a list and then one more query per item, so N items cost N+1 queries.
Taught in
- What An API Is, And The Alternatives — Modern API Architecture: REST, GraphQL & gRPC
- When Each Wins: REST, GraphQL, gRPC And SOAP — Modern API Architecture: REST, GraphQL & gRPC