Skip to content

Commit ce67f9a

Browse files
committed
docs: update README with PokeAPI query example and import
1 parent f46e548 commit ce67f9a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

readme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,17 @@ const { data, isLoading, error } = useQuery(AccountFavoritesQueryOptions());
5656
and more complex queries:
5757
```typescript
5858
import { useQuery } from '@tanstack/react-query';
59-
import { AccountFavoritesQueryOptions } from './src/generated/api';
59+
import { characteristicListQueryOptions } from './src/generated/pokiApi.queryOptions';
6060

6161
const { data, isLoading, error } = useQuery({
62-
...AccountFavoritesQueryOptions(),
63-
select: (data) => data.favorites,
62+
...characteristicListQueryOptions(),
63+
select: (data) => data.results.find(item => item.id === itemId),
6464
});
6565
```
6666

6767
easier query invalidation:
6868
```typescript
69-
queryClient.invalidateQueries(AccountFavoritesQueryOptions());
69+
queryClient.invalidateQueries(characteristicListQueryOptions());
7070
```
7171

7272

0 commit comments

Comments
 (0)