The API paradigm debate used to be a religious war. REST was the default, GraphQL was the challenger, and everyone had an opinion about which one was obviously correct.
In 2026, the data has settled most of it. REST still powers over 80% of public APIs and appears in 70%+ of job listings. GraphQL adoption surged 340% since 2023, but 93% of development teams still rely on REST as their primary API style. And tRPC, which didn't exist as a serious option five years ago, now appears in roughly 15% of TypeScript job postings and climbing.
None of them replaced the others. What actually happened is that each one found its lane.
This post is about which lane you're in. It covers what each paradigm actually is, what the same feature looks like in all three, and the decision framework that's emerged as the consensus in 2026.
If you're still deciding where your API should live — Next.js built-in routes vs a separate service — our Next.js API Routes vs REST API comparison covers that question first. This post is about the shape of the API once you've decided to build one.
Quick answer: which should you use?
| Your situation | Use this |
|---|---|
| Public API, third parties, mobile clients | REST |
| Full-stack TypeScript, same team owns client and server | tRPC |
| Multiple clients with different data needs | GraphQL |
| Monorepo with shared types | tRPC |
| API that will outlive the current frontend | REST |
| Complex nested data with variable shape | GraphQL |
| You want the largest hiring pool | REST |
| You're already deep in the TanStack ecosystem | tRPC |
Default recommendation for most new projects: REST. It's the safest choice, the most portable, and the easiest to hire for. Choose tRPC if you're a TypeScript-only full-stack team and the same people own both sides of the API. Choose GraphQL if you genuinely have multiple clients with divergent data requirements and the infrastructure tax is justified.
That's the honest split. The interesting part is why.
The data: what actually changed by 2026
Three numbers tell the story.
REST is still dominant. 80%+ of public APIs, 70%+ of job listings. This isn't a decline — it's the baseline. If you're building something other people will integrate with, REST is the default assumption.
GraphQL grew but didn't replace anything. 340% adoption growth since 2023 is real. But 93% of teams still rely on REST, which means GraphQL is typically an addition rather than a replacement. The teams that adopted it are the ones with the specific problems it solves: multiple clients, complex nested data, a self-documenting schema requirement.
tRPC found a niche and owns it. 2M+ weekly downloads, ~15% of TypeScript job postings. It eliminates the API boundary entirely for TypeScript full-stack apps — no codegen, no schema file, no REST endpoints. Just TypeScript functions you call from the client. The teams that adopted it are the ones where the client and server are the same codebase, owned by the same team.
The pattern: none of these paradigms won universally. Each one won its specific use case, and the "right" choice depends entirely on which use case you're in.
What each paradigm actually is
REST: resources and HTTP verbs
REST models your API as a set of resources, accessed via standard HTTP methods. GET /users/123 fetches a user. POST /users creates one. PATCH /users/123 updates one. DELETE /users/123 deletes one.
The constraints are what make REST valuable: stateless requests, resource-based URLs, standard HTTP verbs, and the assumption that responses are cacheable. Those constraints are also why it fits so many different consumers — a browser, a mobile app, and a third-party integration all understand HTTP.
// REST — fetch a user and their posts
const user = await fetch("/api/users/123").then((r) => r.json());
const posts = await fetch("/api/users/123/posts").then((r) => r.json());
The tradeoff: if a screen needs the user and their posts and their recent activity, that's three round trips. The client requests data it might not use, or makes multiple requests to get what it needs.
GraphQL: a query language for your data
GraphQL exposes a single endpoint with a typed schema. The client sends a query describing exactly what it needs, and the server returns exactly that shape — nothing more, nothing less.
# GraphQL — fetch a user and their posts in one request
query {
user(id: "123") {
name
email
posts(first: 5) {
title
publishedAt
}
}
}
The tradeoff: GraphQL adds a layer of tooling. You need a schema, resolvers, and usually a client like Apollo or urql. The "infrastructure tax" is real — query complexity analysis, caching strategy, and specialized monitoring tools all become part of your build. GraphQL is powerful, but it's not free.
tRPC: TypeScript functions over the wire
tRPC doesn't have a schema file or an endpoint. You define a server function, and the client imports its types automatically. Calling it looks like calling a local function, but it goes over HTTP under the hood.
// Server — define the procedure
export const appRouter = router({
getUser: publicProcedure
.input(z.object({ id: z.string() }))
.query(async ({ input }) => {
return db.user.findUnique({ where: { id: input.id } });
}),
});
// Client — call it like a function
const user = await trpc.getUser.useQuery({ id: "123" });
The type safety is end-to-end and automatic. If you change the shape of getUser on the server, the client gets a compile error immediately. No codegen step, no schema sync, no manual type definitions.
The tradeoff: tRPC only works when the client and server are both TypeScript and both in the same codebase. It's not a public API protocol. A mobile app written in Swift can't call a tRPC endpoint without a wrapper.
The same feature in all three
Here's a "fetch a user with their recent posts" feature implemented in each paradigm.
REST — two endpoints, two round trips:
// Server
app.get("/users/:id", async (req, res) => {
const user = await db.user.findUnique({ where: { id: req.params.id } });
res.json(user);
});
app.get("/users/:id/posts", async (req, res) => {
const posts = await db.post.findMany({
where: { authorId: req.params.id },
take: 5,
});
res.json(posts);
});
// Client
const [user, posts] = await Promise.all([
fetch(`/api/users/${id}`).then((r) => r.json()),
fetch(`/api/users/${id}/posts`).then((r) => r.json()),
]);
GraphQL — one endpoint, one query, exactly the shape requested:
# Server (schema)
type User {
id: ID!
name: String!
email: String!
posts(first: Int): [Post!]!
}
# Client
query GetUserWithPosts($id: ID!) {
user(id: $id) {
name
email
posts(first: 5) {
title
publishedAt
}
}
}
tRPC — one procedure, one call, fully typed:
// Server
const userRouter = router({
getWithPosts: publicProcedure
.input(z.object({ id: z.string() }))
.query(async ({ input }) => {
return db.user.findUnique({
where: { id: input.id },
include: { posts: { take: 5 } },
});
}),
});
// Client
const user = await trpc.user.getWithPosts.useQuery({ id });
// user.posts is fully typed as Post[]
The difference in developer experience is significant. The REST version requires knowing two endpoints and coordinating two requests. GraphQL requires writing a query and knowing the schema. tRPC feels like calling a function.
The difference in portability is equally significant. The REST version works from any client in any language. GraphQL works from any client that speaks GraphQL. tRPC works only from TypeScript clients in the same codebase.
When each one wins
REST wins when:
- You have external consumers. Public APIs, third-party integrations, partner systems — REST is the default assumption and the easiest for anyone to integrate with.
- You have non-TypeScript clients. Mobile apps, desktop apps, or services in Python, Go, or Java. REST is language-agnostic.
- You want the API to outlive the frontend. A REST API is a stable contract. If you rewrite the frontend in three years, the API doesn't change.
- You want the largest hiring pool. 70%+ of job listings reference REST. Every backend developer knows it.
- You want the simplest mental model. Resources, HTTP verbs, standard status codes. No schema, no query language, no client library required.
tRPC wins when:
- You're TypeScript-only on both sides. The client and server are in the same repo, written in TypeScript, owned by the same team.
- You want zero API boilerplate. No schema files, no codegen, no REST endpoint definitions. Define a function, call it from the client.
- You want end-to-end type safety that can't drift. Change the server, the client breaks at compile time. No manual type sync.
- You're building a Next.js app where the API is internal to your own frontend.
- You're already using TanStack Query — tRPC integrates directly, and the pattern feels cohesive.
GraphQL wins when:
- You have multiple clients with different data needs. A web dashboard that needs everything, a mobile app that needs a subset, a partner integration that needs a specific shape — GraphQL lets each client ask for exactly what it needs from one schema.
- Your data is deeply nested and the shape varies by screen. Fetching a user with their posts with their comments with their authors is one query in GraphQL and four round trips in REST.
- You want a self-documenting API. The schema is the documentation, and tools like GraphiQL make exploration trivial.
- You have a team large enough to benefit from the schema contract. The infrastructure tax is real, but it pays off when many teams need to agree on the API shape.
The hybrid reality
Most production systems in 2026 don't pick one. They combine two or three.
A common pattern: a public REST API for third parties and mobile clients, a tRPC layer for the internal dashboard (TypeScript full-stack, same team), and GraphQL if there's a complex data-fetching requirement that justifies the schema.
This isn't indecision. It's recognizing that different consumers have different needs. The public API needs to be universal, so it's REST. The internal dashboard needs to be fast to build and type-safe, so it's tRPC. The complex data-fetching screen needs to avoid over-fetching, so it's GraphQL.
The mistake is picking one paradigm because it's "modern" and forcing every consumer through it. The right move is picking the paradigm that matches each consumer's constraints.
Migration: is it worth switching?
From REST to tRPC is a substantial rewrite. Every endpoint becomes a procedure, every client call becomes a hook, every type needs to be inferred from the new pattern. Budget weeks for a small API, months for a large one. Worth it if you're TypeScript-only and the boilerplate is genuinely slowing you down. Not worth it if your API serves non-TypeScript consumers.
From REST to GraphQL is also a substantial rewrite. You need a schema, resolvers, a GraphQL server, and a client library. The infrastructure tax is real. Worth it if you have multiple clients with genuinely different data needs. Not worth it if you have one client and a straightforward data model.
From GraphQL to REST is rare, but it happens when a team realizes the schema complexity wasn't justified by their actual usage. The migration is straightforward — you replace each query with an endpoint — but it's still weeks of work.
From tRPC to REST happens when an API needs to serve a non-TypeScript client. The migration is a rewrite of the API surface, but the underlying logic usually ports cleanly.
The honest answer for most teams: don't migrate unless you have a specific problem the current paradigm can't solve. A working REST API that's a little verbose is better than a tRPC rewrite that only serves half your consumers.
A real story: the dashboard that outgrew REST
A team I worked with built a Next.js dashboard for internal operations. They started with REST because that's what everyone knew. The dashboard had about 15 screens, each fetching from one or two endpoints.
Six months in, the screens got more complex. A single view needed data from five endpoints. The frontend was making five parallel requests and stitching the results together client-side. Loading states multiplied. The component tree was full of useEffect calls coordinating fetches.
We migrated the internal API to tRPC. The five endpoints became one procedure that returned the exact shape the screen needed, fully typed. The frontend went from five fetch calls with hand-written loading state to one trpc.dashboard.getOverview.useQuery() call.
The migration took about three weeks. The public API — which served mobile and partner integrations — stayed REST. The two coexisted cleanly because they served different consumers.
The lesson: the paradigm should match the consumer, not the team's preference. Internal TypeScript full-stack screens benefit from tRPC. Public APIs benefit from REST. Using both isn't a compromise; it's the correct architecture.
Decision framework
Here's the flow I use when choosing an API paradigm for a new project.
1. Who consumes the API?
- External developers, mobile apps, non-TypeScript clients → REST
- Your own TypeScript frontend, same repo → tRPC
- Multiple clients with different data needs → GraphQL
2. Will the API outlive the current frontend?
- Yes → REST
- No → tRPC or GraphQL are on the table
3. How complex is the data model?
- Simple, resource-shaped → REST
- Deeply nested, variable shape → GraphQL
- Whatever the database returns, typed → tRPC
4. How large is the team?
- Small, TypeScript-only → tRPC
- Large, multiple teams → REST (stable contract) or GraphQL (schema contract)
5. What's the hiring constraint?
- Need to hire backend developers who know the stack → REST
- Team is already TypeScript full-stack → tRPC
If you're still unsure: REST. It's the lowest-risk default, and you can add tRPC or GraphQL later for specific consumers without rewriting the public API.
Wrapping up
The API paradigm debate is mostly settled in 2026, not because one won, but because each found its lane. REST dominates public APIs and job listings. GraphQL serves teams with genuinely complex multi-client data requirements. tRPC eliminates the API boundary for TypeScript full-stack teams.
The right choice isn't about which paradigm is "modern." It's about who's calling your API and what they need. Pick the one that matches the consumer, and don't be afraid to combine them when different consumers have different constraints.
For the question of where the API should live — Next.js built-in routes vs a separate service — see our Next.js API Routes vs REST API comparison. If you're going the tRPC route, our TanStack Query vs SWR and TanStack Router vs React Router guides cover the rest of that stack.
Frequently asked questions
Is tRPC better than REST?
For TypeScript full-stack teams where the same people own the client and server, yes — tRPC eliminates the API boilerplate entirely and gives you end-to-end type safety with no codegen. For public APIs, mobile clients, or non-TypeScript consumers, REST is better because it's universal and language-agnostic. They're not competing; they serve different consumers.
Is GraphQL replacing REST?
No. GraphQL adoption grew 340% since 2023, but 93% of development teams still rely on REST as their primary API style, and REST still powers over 80% of public APIs. GraphQL is typically adopted alongside REST for specific use cases — multiple clients with divergent data needs, or complex nested data — not as a replacement.
What's the difference between tRPC and GraphQL?
Both solve the "client needs a specific shape of data" problem, but differently. GraphQL exposes a schema and a query language that any client can use. tRPC skips the schema entirely and lets TypeScript infer types directly from server functions. GraphQL is language-agnostic; tRPC is TypeScript-only.
Can I use tRPC for a public API?
Technically yes, but it's not designed for it. tRPC has no stable public protocol — a mobile app in Swift can't call a tRPC endpoint without a wrapper. If you need a public API, use REST or GraphQL. If you need internal TypeScript-only APIs, tRPC is the better fit.
When should I use GraphQL instead of REST?
When you have multiple clients (web, mobile, third parties) with genuinely different data requirements, or when your data is deeply nested and the shape varies by screen. GraphQL lets each client ask for exactly what it needs from one schema, which avoids over-fetching and multiple round trips. The tradeoff is the infrastructure tax: schema, resolvers, client library, caching, monitoring.
What are the downsides of tRPC?
tRPC only works when both the client and server are TypeScript and in the same codebase. It's not a public API protocol, so mobile apps and third-party integrations can't consume it directly. It also couples the client and server tightly — a server change that breaks the client is a compile error, which is a feature for internal teams but can be a problem for cross-team boundaries.
Do most production systems use one paradigm or combine them?
Most combine two or three. A common pattern is a public REST API for external consumers, a tRPC layer for the internal TypeScript dashboard, and GraphQL for a specific screen that needs complex data fetching. Picking one paradigm for every consumer usually means compromising somewhere.
Is REST dead?
No. REST still powers over 80% of public APIs and appears in 70%+ of job listings. It's the default choice for anything external, the easiest to reason about, and the most compatible with existing tooling. GraphQL and tRPC are additions for specific use cases, not replacements.
Which API paradigm is best for a Next.js app?
For a Next.js app where the API is internal to your own frontend, tRPC is a strong fit because it eliminates the boilerplate and gives you type safety without codegen. For a Next.js app that also serves a public API or mobile clients, use REST for the public surface and tRPC for the internal surface. If you're choosing between Next.js built-in routes and a separate service first, see our Next.js vs REST API comparison.
What about gRPC?
gRPC delivers the highest throughput for internal service-to-service communication and is a common choice for microservices. It's not a general-purpose API paradigm for frontend consumption, so it's outside this comparison. If your API is primarily service-to-service, gRPC is worth evaluating alongside the three above.
Need help choosing an API paradigm or migrating from REST to tRPC without breaking existing consumers? Red Surge Technology builds APIs and full-stack architectures that match the consumer. Get in touch to discuss your project.