tRPC vs GraphQL

Type-safe APIs.

Overview

tRPC and GraphQL are two leading type-safe API styles with different trade-offs. tRPC is TypeScript-native (end-to-end type safety via TS inference, no schema language to maintain, server-and-client must both be TypeScript); GraphQL is schema-first (cross-language schema, federation across services, mature ecosystem of clients and tooling). The right answer depends on whether the stack is TypeScript-only or polyglot.

The approach

Workload-driven choice, per-team operational fit considered, documented rationale per API. The discipline is making the API style choice once with a written reason rather than mixing both styles within the same surface area.

Why this compounds

The right API style compounds across years. API patterns and team expertise align with the style; cross-API tooling (client codegen, schema versioning, observability) gets built once and reused. By year two the style choice is automatic per API.