GraphQL is an open-source data query and manipulation language for APIs, and a query runtime engine. Facebook (now Meta) started GraphQL development in 2012 and released it in 2015. GraphQL was moved on 7 November 2018 to the newly established GraphQL Foundation, hosted by the non-profit Linux Foundation.
GraphQL provides a web API approach in which clients define the structure of the data to be returned by the server. This can impede web caching of query results. GraphQL does not provide a full-fledged graph queries language such as SPARQL, or even dialects of SQL that support transitive closure. For example, a GraphQL interface that reports the parents of an individual cannot return, in a single query, the set of all their ancestors.
GraphQL consists of a type system, query language and execution semantics, static validation, and type introspection. It supports reading, writing (mutating), and subscribing to changes to data (real-time updates – most commonly implemented using Websockets). GraphQL servers are available in multiple languages. The result of a single query is returned in JSON format.
On 9 February 2018, the GraphQL Schema Definition Language (SDL) became part of the specification.