tRPC vs REST vs GraphQL
Three API styles for TypeScript apps.
/ quick answer
tRPC gives end-to-end types for TS-only stacks. REST is universal. GraphQL trades complexity for flexible clients. Three API styles for TypeScript apps.
| Dimension | Option A | Option B |
|---|---|---|
| Type safety | Best in TS (tRPC) | None built-in (REST) / Schema-driven (GraphQL) |
| Client diversity | TS only (tRPC) | Any (REST / GraphQL) |
| Complexity | Low (tRPC) | Low (REST) / High (GraphQL) |
- →Full TS monorepo → tRPC
- →Public API, many clients → REST
- →Flexible mobile + web clients → GraphQL
What is the difference in tRPC vs REST vs GraphQL?
tRPC gives end-to-end types for TS-only stacks. REST is universal. GraphQL trades complexity for flexible clients.
What are the main points of comparison?
Type safety: Best in TS (tRPC) vs None built-in (REST) / Schema-driven (GraphQL) · Client diversity: TS only (tRPC) vs Any (REST / GraphQL) · Complexity: Low (tRPC) vs Low (REST) / High (GraphQL)
Which one should I choose?
tRPC for internal TS apps. REST for anything public. GraphQL only when client flexibility outweighs the schema tax.
/ continue exploring
Related concepts
The vocabulary this page depends on.
- →AI Agent
An autonomous AI system that plans and executes multi-step tasks.
- →RAG (Retrieval-Augmented Generation)
Inject external knowledge into an LLM at query time.
- →Prompt Chaining
Pipelining LLM calls where each step's output feeds the next.
- →LLM Orchestration
Coordinating multiple model calls, tools, and data sources into one reliable system.
Related workflows
Turn this into a repeatable process.
- →Automated GitHub Issue Triage
Label, prioritize, and route incoming issues without a maintainer.
- →Automated Competitor Research
From a product description to a structured competitor matrix in under 10 minutes.
- →Build an Internal Knowledge Bot
Ship a Slack bot that answers questions from your company docs.
- →AI Content Factory: One Topic to Ten Assets
Convert a single topic into a full multi-channel content drop.
Related tool stacks
The tools that run it in production.
- →Indie Hacker MVP Stack
Ship a monetizable web MVP in a weekend, alone.
- →Technical Writer AI Stack
Docs, changelogs, and dev-facing content shipped by one writer + AI.
Related prompts
Reusable prompts for this job.
- →SQL Explainer Prompt
Explain a SQL query in plain English with data implications.
- →Error Diagnoser Prompt
Turn a stack trace + code into a ranked diagnosis with next steps.
- →Code Refactor Advisor Prompt
Get a ranked list of refactors before touching a file.
- →Test Case Generator Prompt
Generate meaningful test cases from a function signature.
Related use cases
How people apply it, and what came out.
- →10-Person Dev Team Adds AI Code Reviewer, Cuts Cycle Time 30%
Engineering team wires an LLM into PR review as a first-pass gate.
Comparisons & alternatives
Pick between the options.
- →LangChain vs Vercel AI SDK
Kitchen-sink orchestration vs lean SDK for shipping apps.
- →Cloudflare Workers vs Vercel Functions
Two edge runtimes for AI apps.
- →TanStack Start vs Next.js
The new full-stack React contender vs the incumbent.
- →Cursor vs Windsurf vs GitHub Copilot
Three AI coding environments.