Quick Comparison
| tRPC | GraphQL | |
|---|---|---|
| Schema | None (inferred from TS) | Required (SDL) |
| Type safety | End-to-end (automatic) | With codegen |
| Transport | HTTP/WebSocket | HTTP/WebSocket |
| Clients | TypeScript only | Any language |
| Learning curve | Low (just TypeScript) | Moderate |
When to Use tRPC
- Full-stack TypeScript apps (Next.js, T3 stack)
- You want zero-config type safety
- Your API is only consumed by your own frontend
- You want the simplest possible setup
When to Use GraphQL
- Multiple clients (web, mobile, third-party)
- You need a public API
- Complex data requirements with nested queries
- Your team isn’t all TypeScript
Verdict
tRPC for full-stack TypeScript monorepos. GraphQL for public APIs and multi-client architectures. If your frontend and backend are in the same repo and both TypeScript, tRPC is simpler.