APIs · Updated 2026-06-05

REST vs GraphQL

REST is the right default for most APIs: it is simple, cacheable over plain HTTP, and every tool understands it. GraphQL earns its complexity when clients are diverse and over-fetching is real — many screens, many shapes, one graph. Plenty of teams run both: REST for public/simple surfaces, GraphQL for a rich client app.

REST
Resource-oriented HTTP APIs with many endpoints.
Since
2000
By
Roy Fielding (dissertation)
License
Architectural style
en.wikipedia.org/wiki/REST ↗
GraphQL
A query language for APIs with a single typed endpoint.
Since
2015
By
Facebook / GraphQL Foundation
License
Open spec (MIT-licensed reference)
graphql.org ↗

REST models the server as a set of resources you act on with HTTP verbs. GraphQL models it as one typed graph the client queries for exactly the fields it wants. The trade is over-fetching and round-trips (REST’s weak spots) against caching simplicity and operational maturity (GraphQL’s).

Quick takes

If you're…

  • You have a simple CRUD API with stable, predictable responses REST REST endpoints map cleanly to resources and cache for free over HTTP.
  • Mobile and web clients each need different subsets of the same data GraphQL One GraphQL query fetches exactly the fields each client needs — no over- or under-fetching.
  • You rely heavily on HTTP/CDN caching REST GET URLs cache trivially; GraphQL POSTs to one endpoint do not.
  • A screen aggregates data from many resources GraphQL GraphQL collapses several REST round-trips into a single request.
  • You are publishing a public API for third parties REST REST is universally understood and easier to document, version, and rate-limit per endpoint.
  • Your frontend changes shape often and you want fewer backend changes GraphQL Clients add or drop fields without new endpoints, as long as the schema covers them.
Decision wizard

A few questions, a verdict.

Q1

How varied are your clients’ data needs?

Q2

How important is plain HTTP/CDN caching?

Q3

Who consumes the API?

At a glance

The scorecard.

Dimension
REST
GraphQL
Edge
Server-defined responses
Client-defined responses
depends
Fixed payloads
Exact fields
GraphQL
Free HTTP caching
App-layer cache needed
REST
OpenAPI optional
Typed schema built in
GraphQL
Explicit versions
Additive evolution
GraphQL
Predictable cost
N+1 / query-cost risk
REST
Everywhere
Rich, app-centric
REST
In depth

Dimension by dimension.

core

Request shape

depends
REST

Many endpoints, one per resource; the server decides the response shape.

GraphQL

One endpoint; the client specifies exactly which fields and relations it wants.

core

Over/under-fetching

edge: GraphQL
REST

Common: endpoints return fixed payloads, so clients often get too much or need several calls.

GraphQL

Solved by design: one query returns precisely the requested fields across resources.

ops

Caching

edge: REST
REST

Trivial: GET responses cache in browsers, CDNs, and proxies by URL.

GraphQL

Harder: queries POST to one URL; needs client-side normalized caches (Apollo, urql) or persisted queries.

features

Schema & typing

edge: GraphQL
REST

No built-in schema; OpenAPI/Swagger adds one as a layer.

GraphQL

A typed schema is mandatory and introspectable, powering codegen and tooling out of the box.

ops

Versioning

edge: GraphQL
REST

Usually explicit (/v1, /v2) — clear but proliferates endpoints.

GraphQL

Evolutionary: add fields freely, deprecate old ones; clients pull only what they use.

core

Backend performance risk

edge: REST
REST

Predictable per endpoint; easy to reason about and rate-limit.

GraphQL

N+1 resolver problems and expensive nested queries need dataloaders, depth limits, and cost analysis.

ecosystem

Tooling & ubiquity

edge: REST
REST

Universal: curl, browsers, every HTTP client and gateway speaks it.

GraphQL

Excellent but narrower: GraphiQL, Apollo, codegen — strongest inside app teams.

When to pick neither

A different shape of problem.

  • Internal service-to-service calls where you control both ends and want speed
  • A TypeScript monorepo wanting end-to-end types without a schema language
  • JSON:API
    You want REST with a strict convention for includes and sparse fieldsets
Situational picks

For specific cases.

A public API for third-party developers

REST

Universality, per-endpoint rate limiting, and easy caching matter more than query flexibility.

A data-rich SPA or mobile app with many views

GraphQL

Per-screen queries kill over-fetching and cut round-trips; the typed schema speeds the client team.

A small internal CRUD service

REST

REST is less machinery to run; GraphQL’s caching and N+1 concerns are not worth it here.

A platform serving both partners and a first-party app

Either

REST for the public surface, GraphQL for the internal client, is a common and healthy split.

Sources

Primary material.

Found this useful?