T
TanStack3y ago
graceful-blue

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
wise-white
wise-white3y ago
You can use Promis.all(fetchPage(1),fetchPage2) Also if you using axios you can use axios.all() to fetch both result
graceful-blue
graceful-blueOP3y ago
thanks

Did you find this page helpful?