feat: migrate to TanStack Query#132
Merged
r2dedios merged 4 commits intoRHEcosystemAppEng:release-0.5.1from Jan 23, 2026
Merged
feat: migrate to TanStack Query#132r2dedios merged 4 commits intoRHEcosystemAppEng:release-0.5.1from
r2dedios merged 4 commits intoRHEcosystemAppEng:release-0.5.1from
Conversation
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
4a5707c to
6c0d88c
Compare
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
r2dedios
reviewed
Jan 22, 2026
| return useQuery<InstanceResponseApi[]>({ | ||
| queryKey: ['instances'], | ||
| queryFn: async ({ signal }) => { | ||
| const { data } = await api.instances.instancesList({ page: 1, page_size: 100000 }, { signal }); |
Collaborator
There was a problem hiding this comment.
I'm wondering if asking for 100.000 instances every time we access to that info it's overloading the API
Collaborator
Author
There was a problem hiding this comment.
In client-side filtering, we either get everything at once or switch to side filtering. Due to caching this data is requested only once. If we increase the data refresh time more than 5 minutes(as it is now) the API will have a minimum of requests.
Click between pages in the UI and you'll see that the request is made only once.
| import { api, SystemEventResponseApi } from '@api'; | ||
|
|
||
| export function useEvents() { | ||
| return useQuery<SystemEventResponseApi[]>({ |
Collaborator
There was a problem hiding this comment.
Does make sense to include refetchInverval on this functions to maintain data updated?
Collaborator
Author
There was a problem hiding this comment.
I'm not sure. What might this be needed for?
Collaborator
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.