Skip to content

feat: migrate to TanStack Query#132

Merged
r2dedios merged 4 commits intoRHEcosystemAppEng:release-0.5.1from
vbelouso:feat/tanstack-query
Jan 23, 2026
Merged

feat: migrate to TanStack Query#132
r2dedios merged 4 commits intoRHEcosystemAppEng:release-0.5.1from
vbelouso:feat/tanstack-query

Conversation

@vbelouso
Copy link
Collaborator

No description provided.

Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
@vbelouso vbelouso self-assigned this Jan 19, 2026
@vbelouso vbelouso added the enhancement New feature or request label Jan 19, 2026
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
@vbelouso vbelouso force-pushed the feat/tanstack-query branch from 4a5707c to 6c0d88c Compare January 19, 2026 16:15
@r2dedios r2dedios linked an issue Jan 19, 2026 that may be closed by this pull request
Signed-off-by: Vladimir Belousov <vbelouso@redhat.com>
@vbelouso vbelouso requested a review from r2dedios January 22, 2026 14:11
Copy link
Collaborator

@r2dedios r2dedios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with backend v0.5.1 (current status) and it works great!

Just a couple of questions:

  1. Is the page size too big? (10.000 - 100.000)
  2. Can we use this change to include async data refetch?

@vbelouso

return useQuery<InstanceResponseApi[]>({
queryKey: ['instances'],
queryFn: async ({ signal }) => {
const { data } = await api.instances.instancesList({ page: 1, page_size: 100000 }, { signal });
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if asking for 100.000 instances every time we access to that info it's overloading the API

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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[]>({
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does make sense to include refetchInverval on this functions to maintain data updated?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure. What might this be needed for?

@r2dedios r2dedios added this to the v0.5.1 milestone Jan 22, 2026
@r2dedios
Copy link
Collaborator

r2dedios commented Jan 22, 2026

Is it possible to remove this icon?

image

** Correction: ** It only appears in development env. Not when running the container image

@vbelouso
Copy link
Collaborator Author

Is it possible to remove this icon?

image ** Correction: ** It only appears in development env. Not when running the container image

Yes, appears in dev mode only for debugging

Copy link
Collaborator

@r2dedios r2dedios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, merging

@r2dedios r2dedios merged commit 61f2b58 into RHEcosystemAppEng:release-0.5.1 Jan 23, 2026
1 check passed
@r2dedios r2dedios linked an issue Jan 28, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove sequential pagination by Bulk request migrate to TanStack Query

2 participants