Vicedomini Softworks

Software Architecture

REST vs GraphQL: How to Choose the Right API Style

12 November 2026

Engineer comparing REST and GraphQL API structures

REST is the safer default for public APIs, partner integrations and simple resource-oriented services, because it works natively with HTTP caching and is understood by almost every consumer. GraphQL is the stronger choice when several client types need different slices of a complex, interrelated data model, because the client states exactly which fields it needs. Neither is universally better: the decision depends on the shape of your data, the diversity of your clients and the engineering capacity you can commit to operating the API.

Vicedomini Softworks
Build APIs That Fit Your System
Vicedomini Softworks develops custom software, APIs and system integrations, helping businesses choose an approach suited to their technical needs.
Ask for a consultation

TL;DR

  • REST exposes fixed resources on many URLs; GraphQL exposes a typed schema on a single endpoint where the client chooses the fields.
  • GraphQL reduces over-fetching and round trips, but REST keeps the advantage in HTTP caching, simplicity and tooling familiarity.
  • GraphQL moves security controls (depth limits, cost analysis, authorisation) into the application layer, which adds ongoing maintenance.
  • Choose REST for simple, public or partner-facing APIs; choose GraphQL for varied clients and complex, nested data; many mature systems use both.

Table of Contents

What actually separates REST from GraphQL

The two are not the same kind of thing, which is why the comparison is often framed unfairly. REST is an architectural style in which clients use HTTP verbs against resource URLs, whereas GraphQL is a query language and runtime in which clients define the operations (queries, mutations and subscriptions) and the data shape they want, as AWS explains in its comparison. In practice, a REST integration usually touches several endpoints, while a GraphQL integration exchanges data through one endpoint where resolvers fetch the requested fields.

Three practical consequences follow from that design difference.

Who defines the response. In REST, the endpoint you call is the identity of the object and the server determines its shape. In GraphQL, identity is separated from fetching: the schema declares which resources are available, and the client queries for what it needs, a distinction Apollo describes in its comparison.

How related data is reached. REST models access as a list of URLs, so retrieving related resources often takes several calls. GraphQL represents the accessible data as a graph of relationships and can traverse them in a single request, according to the same Apollo analysis.

How strictly the contract is typed. AWS characterises REST as weakly typed, with error handling implemented in surrounding code, while GraphQL is strongly typed through its schema and can identify malformed requests automatically, returning useful error messages (AWS). REST can be given a rigorous contract too, typically through OpenAPI, but the contract is an addition to the style, not a built-in property.

REST and GraphQL compared across five API dimensions

On the wire, the difference is visible. REST generally relies on the HTTP verbs, while GraphQL more frequently uses HTTP POST with the operation specified inside the request body, uses a schema definition language and returns JSON, as Google Cloud’s overview of both styles sets out.

Data fetching and performance

The argument for GraphQL most often begins with over-fetching and under-fetching. A REST endpoint may return more fields than a screen needs, or too few, forcing a second and third call to assemble a view. Google’s API management guidance presents GraphQL as a response to exactly this inefficiency, shifting field selection to the client and using resolvers to assemble only what was requested (Google Cloud). IBM makes the same point: the single endpoint can deliver a precise response in one round trip (IBM).

This matters most on constrained networks and in interfaces that compose data from several domains, such as a mobile dashboard that combines a customer, their orders and the status of each shipment. With REST, that screen is either several requests or a purpose-built endpoint that someone must maintain. With GraphQL, it is one query.

The performance story is not one-directional, however. GraphQL can introduce the N+1 problem, in which nested fields each fire their own resolver and multiply database calls; the standard remedy is batching with a tool such as DataLoader, as Vercel notes. A GraphQL API that is not designed with batching in mind can therefore be slower on the server than a well-shaped REST endpoint, even though it sends fewer requests over the network.

The honest summary is that GraphQL optimises for the number of round trips and the size of payloads, while REST optimises for simplicity and cacheability. Which of those dominates your latency budget depends on your clients, your topology and your data access patterns, and published synthetic benchmarks rarely reproduce your own workload. A profile of the real screens or integrations you intend to serve is a better guide than any general headline figure.

Data fetching and performance

Caching

Caching is where REST holds its clearest structural advantage. REST responses to GET requests can use standard HTTP mechanisms such as Cache-Control and ETag with no application-layer logic, and CDNs can key responses by URL. GraphQL operations usually travel over POST with varying query bodies, so those defaults do not apply, and teams turn to alternatives such as persisted queries sent over GET (Vercel; Postman makes the same point).

UK Government guidance is direct on the subject: it says HTTP caching cannot be used with GraphQL and that, because of GraphQL’s flexibility, special tooling has to be built to support caching (GOV.UK). Client-side normalised caches and server-side response caching exist and work well, but they are engineering work that a REST API receives from the platform for free.

For read-heavy public APIs, where the same resource is requested by many consumers, this difference alone often settles the question in favour of REST.

Versioning and schema evolution

REST APIs commonly handle breaking changes by versioning the URL, with prefixes such as /v1 and /v2, or by using headers (AWS). This is explicit and easy to reason about, though it can leave several versions running in parallel for years.

GraphQL takes a different route. According to the GraphQL project’s own guidance on schema change management, evolution is additive and backward-compatible: organisations make incremental changes to a single schema instead of releasing v1, v2 and v3, because existing queries continue to work as clients request only the fields they need. Fields that are no longer wanted are deprecated and then removed, and Vercel recommends monitoring usage before removal (Vercel).

Both approaches require discipline. A URL-versioned REST API needs a policy for how long old versions live, and a GraphQL schema needs a deprecation process and visibility into which clients still use which fields. Teams that expose content or data to many downstream consumers, for example when publishing content through an API, benefit from deciding this compatibility policy before the first external consumer integrates, whichever style they choose.

Security and operational load

REST security tends to be applied per route: authentication, authorisation, rate limits and CDN rules all attach to URLs and verbs. GraphQL concentrates every request on one endpoint and lets the client compose arbitrarily nested queries, so the same controls must be moved down into the application and its resolvers. Vercel lists the consequences: depth limits, field-cost analysis, introspection controls and resolver-level authorisation, because nested queries can fan out (Vercel).

The recommendations from authorities are consistent. OWASP’s GraphQL Cheat Sheet recommends denial-of-service prevention through depth limiting, amount limiting, pagination, reasonable timeouts, query cost analysis with a maximum cost per query, and rate limiting. GOV.UK guidance likewise calls for granular permissions, rate limiting, request timeouts and limits on query depth and complexity so that the system is not overloaded (GOV.UK).

None of this is an argument against GraphQL; it is a description of what a production GraphQL service should contain. The practical point for a business is budget: GraphQL shifts effort from the platform (CDN, gateway, per-route policies) to the application team, and that effort recurs with every schema change. Planning for it at the start is far cheaper than retrofitting it after an expensive query has hit production.

Tooling differs as well. REST discovery commonly relies on OpenAPI specifications and documentation portals, while GraphQL developers explore schemas through interactive tools such as GraphiQL (Google Cloud). Both are mature; the question is which your consumers already use.

REST and GraphQL side by side

Criterion REST GraphQL
Endpoints Many, one per resource Typically one
Response shape Fixed by the server Chosen by the client per query
Related data Often several calls One request through the schema
Typing Optional, via OpenAPI Built in through the schema
HTTP caching Native (Cache-Control, ETag) Needs persisted queries or custom tooling
Versioning URL or header versions Additive evolution and deprecation
Security controls Per route, verb and gateway Depth, cost and resolver-level rules
Typical risk Over- and under-fetching N+1 queries and expensive nested queries

When REST is the better choice

Shopify’s enterprise guidance places REST where the interaction is a simple read or write of a single resource, where partners expect a REST integration, and for webhooks and file uploads (Shopify). To that list, the comparison above adds public, read-heavy APIs that benefit from CDN caching, and teams that want the widest possible pool of developers and tools.

REST is also the pragmatic choice for a first version of a product with one or two clients and a stable domain model. The cost of a few additional endpoints is low, the operational model is familiar, and the API can be extended later, including by adding a GraphQL layer where a real need appears.

When GraphQL is the better choice

AWS suggests GraphQL for teams that want to minimise requests and responses, that must combine several data sources behind one endpoint, or whose client requests vary significantly (AWS). Shopify recommends it for complex data models, varied clients, custom storefronts where page speed depends on minimising requests, and long-lived integrations that must evolve without breaking (Shopify).

In day-to-day terms, GraphQL repays its overhead in three situations: a web application, a mobile application and a partner portal all consume the same domain with different needs; the front-end team iterates on screens faster than the back end can ship endpoints; or several internal services must be presented to clients as one coherent API.

A hybrid architecture is often the answer

The choice is rarely exclusive. A common pattern is to keep REST for public endpoints, webhooks, uploads and service-to-service calls, and to place a GraphQL layer in front of internal services for the front ends. Another is a backend-for-frontend per client, which can be REST or GraphQL; one of the pages ranking for this topic notes that for its own purposes REST backends-for-frontend proved simpler and more effective. The right shape follows from the number of client types, the stability of the domain and the team’s capacity to operate the API.

Our perspective

We approach the REST versus GraphQL question as an architectural decision with an operating cost, not as a matter of fashion. The useful question is not which style is more modern, but which one lets a given organisation change its software safely for the next five years.

In our experience, the decision is made well when three things are written down before any code exists: who the consumers are, how the domain will evolve, and who will operate the API in production. A public integration surface with many external consumers points toward REST and its caching and tooling. A product with several first-party clients and a deep domain model points toward GraphQL, provided that depth limits, cost analysis, batching and authorisation are designed in from the start.

Because we work without an account-manager layer, the engineers who recommend the approach are the engineers who build and maintain it, which keeps the recommendation honest about maintenance. We have no vendor bias toward either style: our stack covers REST APIs and GraphQL alongside Spring Boot, Quarkus, Next.js and message-driven architectures, and every consulting engagement ends with a written recommendation the client can keep and challenge.

Pepe F.

Getting the decision right with Vicedomini Softworks

If you are choosing an API style for a new platform, or reconsidering one on an existing system, our architecture and technology stack consulting covers stack selection, roadmapping, migration and code audit, and it ends in a written recommendation. We also build and maintain the resulting APIs, from custom software development to system integration and ongoing support.

Vicedomini Softworks

For teams that need senior technical direction on a continuing basis, our CTO advisory plans start with CTO Advisory from €1,800 a month, Fractional CTO from €4,000 a month and CTO Partner from €7,500 a month. An initial assessment is available from €3,500 as a one-off engagement.

FAQ

Is GraphQL faster than REST?

Not automatically. GraphQL can cut round trips and payload size, which helps on slow networks and composite screens. On the server, nested resolvers can trigger the N+1 problem unless queries are batched, so the result depends on how the API is built, as Vercel explains.

Can REST and GraphQL be used together?

Yes, and many production systems do so. REST often remains in place for public endpoints, webhooks and file uploads, while GraphQL serves front-end clients that need flexible, nested data. This lets each style handle the cases where it is strongest.

Is GraphQL less secure than REST?

It is not inherently less secure, but it needs different controls. Because clients can compose deep, nested queries, OWASP recommends depth limiting, pagination, timeouts, query cost analysis and rate limiting. Authorisation should also be enforced at resolver level.

Does GraphQL need API versioning?

GraphQL generally avoids numbered versions. Schemas evolve by adding fields and deprecating old ones, so existing queries keep working, as the GraphQL project describes. REST APIs more commonly use URL versions such as /v1 and /v2.

Sources

This article was produced with AI assistance and reviewed for accuracy. It is provided for general information only and is not professional advice.

Tell us about your project