Should the new API be REST or GraphQL? The deciding factor is how many clients you have
Short answer: if a single web front end consumes your API and the screens change every few months, REST is the correct default. GraphQL starts paying for itself when several clients ask for the same data in different shapes (an admin panel, a mobile app, a dealer portal, a partner integration) and the client teams ship faster than the backend team can add endpoints. The decision is structural rather than technical: how many screens, how many teams, how many data shapes. Teams that skip that question and ask "which one is more modern" usually end up writing REST inside GraphQL, sending fixed-shape queries from one client, and maintaining an extra layer for no return.
Count the clients before you compare the technologies
In REST, an endpoint maps to a resource. A single order detail screen in a mobile app may need the order, the customer, the shipping address, the courier status and the payment record, which is four or five round trips. Or the opposite problem: one response with fifty fields where the screen uses six. Under-fetching costs latency, over-fetching costs bandwidth, and both get noticeable on a weak mobile connection.
Here is the part that gets skipped. If you have exactly one client, that problem already has a cheap fix. Write a screen-specific endpoint, or put a thin backend-for-frontend layer in front of your services, and you are done. The real gain from GraphQL is not that clients can pick field shapes. It is that a client team can add a field to a screen without waiting for the backend team's next sprint. With one team and one client, that gain does not exist and the cost still does.
Caching is the thing REST gets for free
REST sits on top of HTTP's own caching machinery. GET requests, Cache-Control, ETag, conditional requests, CDN and browser caches all work out of the box. For a read-heavy workload such as a product catalogue, that means traffic that never reaches your servers at all.
GraphQL does not inherit this. Queries normally travel in the body of a POST /graphql request, most CDNs only cache GET, and query strings are usually too long to sit comfortably in a URL. There is a fix: persisted queries. The query text is stored server side, the client sends its SHA-256 hash, the short request can go out as a GET, and a CDN can serve it. Apollo's automatic persisted queries flow does exactly that. It is not free, though. You define cache hints in the schema, the server has to emit the right Cache-Control header, and the CDN has to be configured to honour origin headers. Mutations stay on POST, since caching a non-idempotent request is a bad idea. Cache strategy remains a project in its own right, and GraphQL makes it harder rather than easier.
One endpoint breaks the usual rate limiting
Rate limiting in REST is simple to reason about: so many requests per hour per endpoint, maybe per key. In GraphQL every call hits the same address, and counting requests tells you nothing, because a single query can touch ten tables.
GitHub is a useful reference here because it runs both styles side by side. On REST, an authenticated user gets roughly 5,000 requests per hour. On GraphQL the number is also 5,000, but the unit is points, not requests, and the cost of each query is calculated from the connections it asks for. Structural limits sit on top: every connection must pass a first or last argument between 1 and 100, and a single call cannot request more than 500,000 nodes in total.
OWASP's GraphQL cheat sheet points the same way. Limit query depth, limit the amount of data a query can request, run query cost analysis and reject anything over budget before execution, and set timeouts at the application layer where they can stop work mid-resolution. One item gets missed more often than the rest: alias and batching abuse. A single HTTP request can carry hundreds of separate lookups, which quietly defeats any limit that counts requests and opens the door to brute forcing. For sensitive objects such as password resets, one-time codes and tokens, batching should be turned off entirely. Rate limiting and quota design is harder under GraphQL, not simpler.
The N+1 problem moves into the client's hands
A GraphQL server fills fields through resolvers. A query that lists fifty orders and resolves each order's customer separately turns into fifty-one database queries. The standard answer is a batching layer such as DataLoader, which collects requests within a tick and issues one query instead.
The deeper difference is about who writes the worst case. In REST you write the query shape yourself, so the pathological case shows up in code review. In GraphQL the client writes the shape, and the pathological case shows up for the first time in production traffic, usually from a screen nobody profiled. That is why hunting slow queries in a GraphQL product is a standing habit rather than a one-off cleanup.
If errors come back as 200, nothing pages anyone
In common GraphQL deployments, field-level errors are returned inside the response as an errors array while the HTTP status stays 200. So the uptime monitor that counts 5xx responses records a query that failed to resolve the payment block as a success. On top of that, since all traffic goes to one address, "p95 latency on /graphql is 300 ms" tells you nothing useful: a heavy reporting query and a cheap profile lookup cancel each other out in the average.
Two practical steps. Tag your metrics by operation name and reject anonymous queries in production, so you can see per-operation latency and error rates. Then build alerting on response contents rather than status codes. The GraphQL over HTTP transport spec is still a working draft, so status code behaviour varies between server implementations, and hanging your observability setup on it is fragile.
Authorization happens per field, not at the door
A single endpoint creates the illusion that one check at the entrance is enough, and the most expensive mistakes come from exactly that. OWASP's guidance is explicit: enforce authorization checks on both edges and nodes, meaning on list connections and on individual objects. Fields that fetch an object by identifier, the node and nodes pattern in particular, can become the shortest path to another tenant's record. Your authorization model has to live outside the schema and be applied inside every resolver.
The second item is schema exposure. Disable introspection in production or restrict it to approved users. Do not stop there: if field suggestions stay on, a mistyped field name returns a "did you mean" response that lets someone enumerate much of the schema anyway, which is why OWASP recommends switching both off together. Everything else is ordinary API security work, since GraphQL inherits every risk an HTTP API has and adds a few of its own.
"No versioning" really means "field deprecation forever"
One of GraphQL's selling points is that you no longer need API versions. The accurate version of that claim: there is no /v2, but removing a field is still a breaking change. What changes is visibility. In REST a version is a contract and you know who sits on which one. In GraphQL you mark a field @deprecated and nobody stops calling it.
The only way to make this work is field usage telemetry: which field, from which client, under which operation name, how many times in the last 90 days. Without that data the schema grows every year, nothing is ever removed, and two years in you have a layer of fields nobody dares touch. API versioning and backward compatibility does not disappear under GraphQL. It changes shape and gets quieter, which is worse.
File uploads are still an unsolved corner
The GraphQL specification is transport agnostic, so file uploads sit outside it. The community produced a convention, the GraphQL multipart request spec, but it is unofficial and library support is uneven: some server implementations handle only one file per request, others need a third-party package.
There is a security wrinkle too. multipart/form-data counts as a "simple" request under CORS and does not trigger a preflight check, so without explicit CSRF protection an upload endpoint may accept requests from origins you never intended. The sturdier pattern in practice is to skip the problem: have the client upload straight to object storage with a pre-signed URL and pass only the resulting reference into the mutation. The rest of the file upload flow is a separate design job either way.
The platform may have decided for you
If you are not designing your own API but integrating with somebody else's, the choice is not yours. Shopify's REST Admin API has been a legacy API since October 1, 2024, and since April 1, 2025 new public apps submitted to the App Store must be built exclusively with the GraphQL Admin API. Several newer platform features ship in GraphQL only. GitHub, by contrast, keeps running both styles and shows no sign of retiring either.
The practical takeaway: for integration work, read the target platform's roadmap instead of holding an internal debate. For your own product the reverse holds, and the answer comes from the variety of your clients.
Ecosystem, team, and the view two years out
REST's biggest strength is that it is boring. Curl, browser dev tools, reverse proxies, WAFs, API gateways, logging tools and your customer's own IT team all understand it. Generating a client from an OpenAPI document is routine work, and so is explaining a 404 to someone who is not a developer.
The GraphQL ecosystem has matured but is still moving. The September 2025 edition of the specification was the first new edition since October 2021, and the HTTP transport spec remains a draft. In exchange, the normalized client cache in Apollo or Relay genuinely pays off on mobile, especially in products where the same object appears across many screens. The question worth asking before you commit: who maintains this schema in two years, who keeps the API documentation current, and how long does it take a new hire to understand the federation setup?
What most teams actually end up doing
You do not have to pick a side and live with it. The common and healthy arrangement is REST on the outside, facing partners, public consumers and webhooks, with GraphQL or a screen-specific BFF on the inside feeding your own front ends. The outer surface stays boring, stable and versioned; the inner one moves fast.
If you are migrating, do not move everything at once. Pick the three screens that make the most round trips, serve those through GraphQL, and leave the rest on REST. Six months later you will know whether the schema is doing real work or whether you have reinvented REST with fixed-shape queries. The second outcome is more common than the conference talks suggest.
One thing you can do this week
Open the heaviest screen in your product with the browser network tab running and write down two numbers: how many requests fire while the screen loads, and how many kilobytes come down. Repeat it for the mobile equivalent of the same screen. One client and three to five requests per screen means the bottleneck is elsewhere, so stay on REST. Three different clients and screens making eight or ten round trips means there is a real decision to make. Once you have those numbers, we can look at your current API together and work out which direction it should grow in.
Need help with this topic?