FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
tRPC Has a Free API: End-to-End Type-Safe APIs Without Code Generation
How-ToWeb Development

tRPC Has a Free API: End-to-End Type-Safe APIs Without Code Generation

via Dev.to ReactAlex Spinov3h ago

Why tRPC tRPC gives you end-to-end type safety between your API and client — no code generation, no GraphQL schema, no OpenAPI spec. Change a server type, and TypeScript catches client errors instantly. Install npm install @trpc/server @trpc/client zod Server import { initTRPC } from ' @trpc/server ' ; import { z } from ' zod ' ; const t = initTRPC . create (); const appRouter = t . router ({ getUser : t . procedure . input ( z . object ({ id : z . string () })) . query ( async ({ input }) => { return await db . user . findUnique ({ where : { id : input . id } }); }), createUser : t . procedure . input ( z . object ({ name : z . string (). min ( 2 ), email : z . string (). email (), })) . mutation ( async ({ input }) => { return await db . user . create ({ data : input }); }), listUsers : t . procedure . input ( z . object ({ page : z . number (). default ( 1 ), limit : z . number (). max ( 100 ). default ( 20 ), })) . query ( async ({ input }) => { return await db . user . findMany ({

Continue reading on Dev.to React

Opens in a new tab

Read Full Article
0 views

Related Articles

Week 6 — No New Problems. Just Me and Everything I Already Learned.
How-To

Week 6 — No New Problems. Just Me and Everything I Already Learned.

Medium Programming • 3h ago

What OpenClaw Gets Wrong Out of the Box (And How to Fix It)
How-To

What OpenClaw Gets Wrong Out of the Box (And How to Fix It)

Medium Programming • 4h ago

Android Remote Compose:讓 Android UI 不用發版也能更新
How-To

Android Remote Compose:讓 Android UI 不用發版也能更新

Medium Programming • 5h ago

How-To

Learn Something Old Every Day, Part XVIII: How Does FPU Detection Work?

Lobsters • 12h ago

“Learn to Code” Is Dead… Learn to Think Instead
How-To

“Learn to Code” Is Dead… Learn to Think Instead

Medium Programming • 14h ago

Discover More Articles