A query language for APIs that lets clients ask for exactly the data they need — no more, no less.
Official siteGraphQL is a query language and runtime for APIs, created at Facebook. Instead of many fixed REST endpoints, it exposes a single endpoint backed by a typed schema, and the client specifies exactly which fields it wants. That eliminates over-fetching and under-fetching and lets one request pull related data that REST would spread across several calls.
The strong, introspectable schema is a real asset: it doubles as documentation and powers excellent tooling. The cost is added server-side complexity around caching, query cost limits and performance.
GraphQL sits over your data sources and answers precisely-shaped queries against a typed schema. Clients request the exact fields and relationships they need in one round trip, and the schema is self-documenting and introspectable.
GraphQL earns its keep when clients have varied data needs, when you aggregate several backends behind one API, or when frontend and backend teams iterate independently. Mobile and complex dashboards benefit most from asking for only what they render.
It shifts complexity to the server: HTTP caching is harder than with REST, you need query-cost limits to prevent abuse, and naive resolvers cause N+1 database queries (solved with batching/dataloaders). For simple, uniform APIs, REST is often the lighter choice.
GraphQL is a query language and runtime for APIs, developed by Meta, that lets clients request exactly the data they need in a single request — no more, no less. It matters because it solves two chronic problems with traditional REST APIs: over-fetching (endpoints returning more data than the client needs) and under-fetching (needing several requests to assemble one screen's data). By exposing a single, strongly-typed endpoint where the client specifies its needs precisely, GraphQL makes front-end data-fetching efficient and flexible, which is why it is popular for complex applications and APIs serving many different clients.
A GraphQL API is defined by a strongly-typed schema describing all the data and operations available; clients send queries specifying the exact fields they want, and the server returns precisely that shape in one response. This gives clients flexibility and eliminates round-trips, and the schema doubles as documentation and enables great tooling. The trade-offs are real: caching is harder than REST's simple URL-based caching, a naive implementation can allow expensive queries (needing depth/complexity limits), and the server-side setup (resolvers, the N+1 query problem) is more involved. GraphQL is a powerful choice, not a free win.
GraphQL fits well when clients have varied, complex data needs — a mobile app, a web app and third parties each wanting different slices of the same data — or when front-end teams want to iterate on data requirements without waiting for new REST endpoints. It is often unnecessary for a simple API with a fixed, small set of consumers, where REST's simplicity and easy caching win. The decision comes down to data-shape complexity and client diversity: GraphQL's flexibility pays off when many clients need many different data shapes; REST's simplicity wins when needs are straightforward and stable.
Part of our technologies knowledge graph — browse every entry in this branch.
A server-side JavaScript runtime built on V8 that lets one language run your whole stack.
A typed superset of JavaScript that catches whole classes of bugs before your code ever runs.
The powerful, standards-compliant open-source relational database — the safe default for structured data.
An open standard that lets AI models connect to tools and data sources through one consistent interface.
A document database that stores flexible, JSON-like records — great when your data is nested and evolving.
Common questions
Straight answers on how this fits your marketing and build.
Still have questions? Talk to a specialist