T
TanStack3y ago
absent-sapphire

Multiple calls in createInfiniteQuery

this question is not strictly related to the solidjs version, it would be the same with useInfiniteQuery, is there a way in the queryFn to call two api endpoint instead of just one? I need to aggregate some data from two different call
queryFn: ({ pageParam = 1 }) => fetchPage(pageParam),
queryFn: ({ pageParam = 1 }) => fetchPage(pageParam),
queryFn: ({ pageParam = 1 }) => {
fetchPage(pageParam)
fetchPage2(pageParam)
},
queryFn: ({ pageParam = 1 }) => {
fetchPage(pageParam)
fetchPage2(pageParam)
},
2 Replies
exotic-emerald
exotic-emerald3y ago
You can use Promis.all(fetchPage(1),fetchPage2) Also if you using axios you can use axios.all() to fetch both result
absent-sapphire
absent-sapphireOP3y ago
thanks

Did you find this page helpful?