| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Code generator for TanStack Query (React Query) based on your OpenAPI schema — queryOptions factories following the official TanStack Query v5 pattern, plus ready-to-use hooks, prefetch, ensure, suspense, and infinite query helpers.
📖 Documentation · Migrating to v3
npm install -D @7nohe/openapi-react-query-codegen
npx openapi-rq -i ./petstore.yamlimport { useQuery } from "@tanstack/react-query";
import { findPetsOptions } from "./openapi/queries";
function Pets() {
const { data } = useQuery(findPetsOptions({ query: { limit: 10 } }));
// ...or use the generated hook directly: useFindPets({ query: { limit: 10 } })
}See the documentation for CLI options, SSR recipes, and infinite query usage.
| This library | @hey-api tanstack-query plugin | Orval | |
|---|---|---|---|
| queryOptions / infiniteQueryOptions factories (TanStack v5 pattern) | ✅ | ✅ | ❌ |
| Ready-to-use hooks (useQuery / suspense / infinite variants) | ✅ | ❌ (options only) | ✅ |
| SSR helpers (prefetchQuery / prefetchInfiniteQuery / ensureQueryData) | ✅ | ❌ | Partial (usePrefetch) |
| Hierarchical query keys for granular invalidation | ✅ | ✅ (tags) | Partial |
| Stable release line | ✅ SemVer | pre-1.0, frequent breaking changes | ✅ |
| MSW mock generation | ❌ (out of scope) | ❌ | ✅ |
| Vue / Solid / Svelte / Angular | ❌ React-focused | ✅ | ✅ |
Scope: this library is deliberately React-focused and does not generate API mocks — use Orval if MSW mocks are your priority, or hey-api's own plugin if you need non-React frameworks.
This library builds on @hey-api/openapi-ts, which is pre-1.0 and moves fast. We pin the exact hey-api version and absorb its breaking changes for you: hey-api upgrades land here only after our full snapshot-test suite passes, and are released as minor versions. Your generated API surface follows SemVer — breaking output changes only happen in major versions, with a migration guide.
MIT
| Back | FazBrowse Home | New Git URL |