Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/7nohe/openapi-react-query-codegen
Node.js library that generates React Query (also called TanStack Query) hooks based on an OpenAPI specification file.
https://github.com/7nohe/openapi-react-query-codegen
codegen openapi react react-query swagger tanstack tanstack-query tanstack-react-query typescript
Last synced: 5 days ago
JSON representation
Node.js library that generates React Query (also called TanStack Query) hooks based on an OpenAPI specification file.
- Host: GitHub
- URL: https://github.com/7nohe/openapi-react-query-codegen
- Owner: 7nohe
- Created: 2022-07-22T00:34:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-30T23:30:10.000Z (8 months ago)
- Last Synced: 2024-05-02T03:10:23.529Z (8 months ago)
- Topics: codegen, openapi, react, react-query, swagger, tanstack, tanstack-query, tanstack-react-query, typescript
- Language: TypeScript
- Homepage:
- Size: 379 KB
- Stars: 142
- Watchers: 3
- Forks: 14
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
# OpenAPI React Query Codegen
> Code generator for creating [React Query (also known as TanStack Query)](https://tanstack.com/query) hooks based on your OpenAPI schema.
[![npm version](https://badge.fury.io/js/%407nohe%2Fopenapi-react-query-codegen.svg)](https://badge.fury.io/js/%407nohe%2Fopenapi-react-query-codegen)
## Features
- Generates custom react hooks that use React Query's `useQuery`, `useSuspenseQuery`, `useMutation` and `useInfiniteQuery` hooks
- Generates custom functions that use React Query's `ensureQueryData` and `prefetchQuery` functions
- Generates query keys and functions for query caching
- Generates pure TypeScript clients generated by [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts)