Skip to content
All tags

#api-contract

8 posts

GraphQL and Code Generator: Type Safety Comes from Schema Plus Operations

A GraphQL schema defines available capabilities; GraphQL Code Generator combines it with actual queries, mutations, and fragments to emit precise results, variables, and typed documents.

gRPC and Connect: One Protobuf Contract across Services and Browsers

gRPC generates cross-language stubs from Protobuf services. A Connect server can support gRPC, gRPC-Web, and the Connect protocol together, avoiding a translating proxy for browsers.

Hono RPC: Infer Fetch Client Types from Route Implementations

Hono RPC exports a route's `typeof AppType` so `hc` can infer inputs, response bodies, and status codes. The shared artifact is a TypeScript type, not an independent wire schema.

oRPC: Put End-to-End Type Safety and OpenAPI on the Same Path

oRPC supports implementation-first and contract-first APIs, offers an RPC client, and can expose the same router through OpenAPI 3.1.1 HTTP endpoints.

Protobuf and Buf: Put Cross-Language Schema Linting, Codegen, and Compatibility in CI

Protobuf defines binary messages with stable field numbers; Buf adds modules, linting, remote plugins, generation, and breaking-change checks to govern those schemas.

tRPC: Connect Client and Server Contracts through TypeScript Inference

tRPC lets a client reference the server router type without a separate schema or code generation. Version 11 also has an official, alpha-stage OpenAPI 3.1 generator.

ts-rest: A TypeScript Contract-First API that Preserves REST Semantics

ts-rest describes methods, paths, status codes, and schemas in a shared contract, providing end-to-end server and client types without a code-generation step.

Zodios: Build an Axios Type-Safe Client from Zod Endpoint Definitions

Zodios uses a central Zod endpoint definition for Axios client types, runtime validation, and aliases, with optional Express and OpenAPI packages.