GraphQL
What is GraphQL?
GraphQL: A query language and runtime for APIs that allows clients to request exactly the data they need, avoiding over-fetching or under-fetching that is common with REST. GraphQL is a query language for APIs. Instead of fixed endpoints that each return a set structure, clients send a query describing exactly which fields they want, and the server returns precisely that.
Frequently asked questions about GraphQL
How is GraphQL used in practice?
This helps front ends that need data from several related objects at once. A mobile app can fetch a customer, their last five orders and the product names in one request, without receiving fields it does not use.
What should you keep in mind with GraphQL?
The flexibility has costs. Caching is harder than with plain REST URLs, and a careless query can ask for huge amounts of nested data, so servers need limits on query depth and complexity. For many business applications, a well-designed REST API is simpler to build and maintain. GraphQL earns its place when many different clients need very different views of the same data.
At a glance
| Category | Core glossary |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |