T
TanStack2y ago
fair-rose

Best way to handle multiple api endpoint calls for dashboard

I am building a dashboard with multiple components. On load of the dashboard, 13 separate api calls are made fetch the data for the dashboard causing the dashboard to render extremely slowly. Eventually the api calls complete and the dashboard renders. The queries are distributed across the components that need them. I've confirmed that the api endpoints are being hit only once and there are no errors. Any suggestions on how to stagger the api calls would be greatly appreciated. I posted this question in more detail on SO. https://stackoverflow.com/questions/77632992/multiple-react-query-api-calls-render-dashboard-ui-extremely-slow
Stack Overflow
Multiple react-query api calls render dashboard UI extremely slow
I am building a react app that has a dashboard and uses react-query. On the initial load of the dashboard there are 13 query calls to multiple api endpoints that fetch the data for all of the various
1 Reply
harsh-harlequin
harsh-harlequin2y ago
Hi, without your code it's hard to say anything on how to improve your queries. So code example of how you fetch your data would be highly appreciated.

Did you find this page helpful?