"Should we do it in GraphQL?" is a question I've seen wreck weeks of a schedule. The four styles in this article solve different problems, and the wrong choice doesn't show up on day one. It shows up when a client from another company can't integrate, when a screen fires 300 database queries or when the browser doesn't speak the protocol.
The API concepts article has a one-line summary of each style. Here I go deeper: how each one works inside, what it solves, where it hurts, the myths going around and how to choose. Versions and data checked on November 21, 2026.

The Question That Decides: Who Consumes Your API?
Before comparing technology, answer this:
- Third parties, using different languages and from different companies? You need a neutral contract you can document. REST with OpenAPI is the safest path.
- Your own screens, with lots of data combinations? GraphQL starts to make sense.
- Your other services, talking a lot and fast? gRPC.
- Only your TypeScript front end, in the same repository? tRPC.
Almost every bad choice I've seen came from picking the trendy style instead of looking at who consumes the API.
REST: Much More Than JSON Over HTTP
REST was born in Roy Fielding's doctoral dissertation in 2000. It's not a protocol or a format. It's an architectural style, defined by constraints. The main ones:
- Client and server are separate.
- Stateless: each request carries everything the server needs.
- Cache: the response says whether it can be stored or not.
- Uniform interface: resources with addresses, manipulated through representations, with self-descriptive messages and hypermedia guiding the next step.
- Layers: the client doesn't know if it's talking to the final server or to an intermediary.
None of them mention JSON. And Fielding himself was blunt in 2008: an API whose state isn't driven by hypertext "cannot be RESTful". For him, most of what we call REST is RPC over HTTP.
The most useful way to see this is the Richardson Maturity Model, popularized by Martin Fowler:
| Level | What changes | Example |
|---|---|---|
| 0 | HTTP only as transport | POST /api with {"action": "cancelOrder"} |
| 1 | Resources | POST /orders/42/cancel |
| 2 | HTTP verbs and status codes | DELETE /orders/42 returns 204 or 404 |
| 3 | Hypermedia | The response includes "links": {"pay": "/orders/42/payment"} |
Fowler himself warns that the model is a learning tool, not an official definition of REST. In practice, level 2 already delivers the main benefits: working HTTP caching, error codes every client understands and ready-made tooling.
Where REST shines: public APIs, integration between companies, CDNNetwork of servers spread around the world that keeps copies of files and pages close to users, serving them faster and offloading the origin server. caching, any client in any language. With OpenAPI (version 3.2, from September 2025, which added the QUERY method and streaming support), the contract becomes a document, generates clients and feeds tests.
Where it hurts: a screen that needs data from five resources makes five calls, and each one brings fields the screen doesn't use.
GraphQL: The Client Picks the Dish
GraphQL was created at Facebook in 2012, open sourced in 2015 and is now maintained by the GraphQL Foundation, under the Linux Foundation. The specification got its September 2026 edition.
The core idea: a single endpoint, a typed schema and the client writing the query with exactly the fields it wants.
query {
order(id: 42) {
total
customer { name }
items { product { name } quantity }
}
}This solves over-fetching (too much data) and under-fetching (needing several calls). But it trades them for three problems that the official documentation itself describes:
1. N+1. To list 50 orders with the customer name, a naive server runs 1 query for the orders and 50 more, one per customer. The documentation calls this service "chatty". The standard fix is DataLoader, which batches the lookups made at the same moment and sends a single query.
2. Expensive queries. Since the client builds the query, it can nest lists inside lists, and the cost grows exponentially. The documentation recommends limiting depth and calculating the cost of each query before running it.
3. Caching. Standard HTTP caching works with GET and a stable URL. With GraphQL, that requires persisted queries (the client sends a hash and the server already knows the query). And they only work when you know your clients, so they're no good for a public API.
A security detail that comes up in every conversation: turning off introspection (the feature that exposes the schema) in production is, in the documentation's words, "security through obscurity". It helps, but it doesn't replace authorization on every field.
Where GraphQL shines: products with many screens and clients (web, app, admin panel) pulling different data from the same domain. Where it hurts: a simple CRUD API, third-party integration, a team with no time to take care of performance and security.
gRPC: Strict Contract, Fast Conversation
gRPC is a CNCF project. The contract lives in a .proto file (Protocol Buffers), messages travel in binary and the transport is HTTP/2. Client and server code in several languages come out of the same file.
service Orders {
rpc Get (GetOrder) returns (Order); // unary
rpc Track (GetOrder) returns (stream Status); // the server sends many
rpc SendItems (stream Item) returns (Summary); // the client sends many
rpc Chat (stream Message) returns (stream Message); // both at the same time
}The browser myth. Saying gRPC doesn't work in the browser is a half truth. It works in two ways:
- gRPC-Web, with a proxy like Envoy doing the translation. Official limitation: client streaming and bidirectional streaming aren't supported.
- Connect RPC, a CNCF project that serves gRPC, gRPC-Web and its own protocol with no proxy needed.
Where gRPC shines: communication between internal services, many languages, streaming, low latency. Where it hurts: debugging binary with curl, a public API for people who don't want to generate a client, the browser without an extra layer.
tRPC: The Types Cross the Network
tRPC (version 11.29 in November 2026) has no schema and no code generation. The client imports the type of the server's router, and TypeScript does the rest:
// server
export const appRouter = router({
orderById: publicProcedure
.input(z.string())
.query(async ({ input }) => getOrder(input)),
});
export type AppRouter = typeof appRouter;
// client
import type { AppRouter } from '../server/router';
const trpc = createTRPCClient<AppRouter>({ links: [httpBatchLink({ url: '/api/trpc' })] });
const order = await trpc.orderById.query('42'); // typed end to endThe day to day experience is excellent: rename a field on the server and the front end editor points out the error right away. It pairs really well with tests and types as a safety net.
The limit is a direct consequence of the design: the contract is a TypeScript type. Anyone who doesn't compile TypeScript with access to that type (a Kotlin app, a partner using Python) gets nothing out of it. The documentation requires TypeScript 5.7.2 or later and strict mode.
Where tRPC shines: a monorepo with front end and back end in TypeScript, a small team, an internal API. Where it hurts: any consumer outside that circle.
Side by Side
| REST | GraphQL | gRPC | tRPC | |
|---|---|---|---|---|
| Contract | OpenAPI (optional) | Required schema | Required .proto |
TypeScript type |
| Format | Any, almost always JSON | JSON | Binary (Protobuf) | JSON |
| HTTP caching | Natural | Needs persisted queries | Doesn't apply | Limited |
| Streaming | With separate SSE or WebSocket | Subscriptions | Native, 4 types | Subscriptions |
| Browser | Yes | Yes | With gRPC-Web or Connect | Yes |
| Client languages | All | All | All with a generator | TypeScript only |
| Best for | Public API and integration | Many screens and clients | Service to service | TypeScript monorepo |
And you can mix them. It's common to see REST facing outward, gRPC between services and GraphQL or a Backend for Frontend in front of the screens.
The Other Names That Come Up
- JSON-RPC 2.0: function calls in JSON, not tied to any transport. It's the foundation of MCP, the protocol that connects tools to AI models.
- AsyncAPI 3.1: the "OpenAPI of the async world", for describing event and queue APIs.
- Webhooks, WebSocket and SSE: they aren't competing styles, they're channels for the server to notify the client. In the 2025 Postman survey, webhooksHTTP call a system makes to your address when something happens, like an approved payment, notifying you right away instead of you polling for changes. show 50% usage and WebSockets 35%.

Quick check
Frequently Asked Questions
Is GraphQL faster than REST?
Not by nature. It saves calls and fields, but it can be slower on the server if N+1 and expensive queries aren't handled. HTTP caching is also harder.
Does gRPC replace REST?
For communication between internal services, often yes. For a public API and the browser, rarely: REST is still simpler to consume and debug.
Can I use tRPC and REST together?
Yes. It's common to use tRPC between the front end and back end of the same product and expose REST for integrations.
What is OpenAPI and do I need it?
It's the specification that describes a REST API in a YAML or JSON file. It isn't mandatory, but it generates documentation, clients and tests. For a public API, I consider it essential.
Which one should I learn first?
REST, in depth: HTTP, verbs, status codes and caching. Everything else builds on that. The list of free back-end courses has good starting points.
References
Checked on November 21, 2026:
- Roy Fielding, Representational State Transfer (REST), chapter 5 of the dissertation, 2000, and REST APIs must be hypertext-driven, 2008
- Martin Fowler, Richardson Maturity Model, 2010
- OpenAPI Specification 3.2.0
- GraphQL Specification, performance, security and GraphQL Foundation
- Apollo Server: previous versions and end of support
- gRPC: core concepts, gRPC-Web and Connect RPC
- tRPC: documentation and quickstart
- JSON-RPC 2.0 and AsyncAPI
- Postman State of the API 2025