GraphQL
GraphQL is a query language and runtime for APIs, created by Facebook. Instead of calling many fixed endpoints as in a REST API, the client sends one query to a single endpoint that describes exactly which fields it wants, and the server returns data in exactly that shape.
This avoids over-fetching (receiving fields you do not need) and under-fetching (making several requests to collect related data). A GraphQL API is described by a strongly typed schema; queries read data, mutations change it and subscriptions push live updates to the client.
query {
user(id: "42") {
name
email
orders(last: 3) {
id
total
}
}
}