All Posts
API Design 8 min read

Why we swapped GraphQL for tRPC and REST in our newest client projects

#trpc#graphql#typescript

For years, GraphQL was our default recommendation for modern web applications. The promise of "ask for exactly what you need and nothing more" sounded like perfection. But after maintaining large GraphQL schemas across multiple enterprise client projects, the operational complexity began to outweigh the benefits.

The hidden overhead of GraphQL

In production, GraphQL introduces significant friction:

- The N+1 query problem requires DataLoader tooling on almost every nested resolver - Client-side bundles (Apollo Client or Relay) add 40KB+ of JavaScript just for caching and query parsing - Edge caching HTTP responses with CDNs is notoriously difficult because every request is a POST to a single `/graphql` endpoint - Schema synchronization and code generation steps slow down developer feedback loops

The rise of tRPC for full-stack TypeScript

When the backend and frontend are both written in TypeScript (which represents 90% of modern web apps), tRPC provides a vastly superior developer experience:

- Zero code generation: changing a backend router function signature immediately creates TypeScript compiler errors in the frontend components - Tiny runtime footprint: tRPC clients are negligible in size compared to GraphQL clients - Native React Query integration: automatic caching, optimistic updates, and background refetching out of the box

When we still use REST or GraphQL

We haven't abandoned traditional protocols completely:

- We use REST with OpenAPI/Swagger when exposing public APIs to third-party developers - We use GraphQL when building a public gateway over dozens of legacy microservices with diverse team ownership - For unified modern web applications, tRPC has become our undisputed velocity champion.

Have a similar challenge?

We build production-grade software for companies that need it done right.

Let's Talk