Orval
A tool that reads an OpenAPI document and generates typed TypeScript API clients and TanStack Query hooks.
In more detail
Setting client to react-query in orval.config.ts makes Orval emit a query hook per endpoint plus query key helpers. Regenerating after each API change turns contract changes into compile errors.
Related terms
- code generation — Producing client or server code automatically from a machine-readable contract such as an OpenAPI document or a Protocol Buffers file.
- OpenAPI — A standard, language-neutral format for describing an HTTP API: its paths, operations, parameters, request and response schemas, errors and security.
- TanStack Query — A library that fetches, caches and refreshes server data in frontend apps, and runs changes to it as mutations.
Taught in
- API Contract Architecture: OpenAPI 3.1 & Schema Truth — Production Full-Stack Engineering
- Type-Safe Client Generation: Orval & Automated SDKs — Production Full-Stack Engineering