Skip to content

Commit c1418cf

Browse files
committed
docs: add auto-generated query key feature
1 parent beeb6b3 commit c1418cf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## Features
66

77
- Supports generation of custom react hooks that use React Query's `useQuery` and `useMutation` hooks
8+
- Supports generation of query keys for query caching
89
- Supports the option to use pure TypeScript clients generated by [OpenAPI Typescript Codegen](https://github.com/ferdikoomen/openapi-typescript-codegen)
910

1011
## Install
@@ -81,8 +82,13 @@ You can also use pure TS clients.
8182
```tsx
8283
import { useQuery } from "@tanstack/react-query";
8384
import { PetService } from '../openapi/requests/services/PetService';
85+
import {
86+
usePetServiceFindPetsByStatusKey,
87+
} from "../openapi/queries";
88+
8489
function App() {
85-
const { data } = useQuery(['MyKey'], () => {
90+
// You can still use the auto-generated query key
91+
const { data } = useQuery([usePetServiceFindPetsByStatusKey], () => {
8692
// Do something here
8793

8894
return PetService.findPetsByStatus(['available']);

0 commit comments

Comments
 (0)