The current limit & offset implementation does not allow for dynamic query limits. Each query is stuck to its initialPageParam
.
Take for example this following getNextPageParam
implementation
getNextPageParam: (currentPage, allPages, currentPageParam, allPageParams) => {
if (currentPage.data.length === 0) return undefined;
const page = currentPageParam.page + 1;
// const offset = currentPageParam.offset + queryArgs.limit
return { page };
},
There is no way to calculate offset because queryArgs
is not provided, only pageParams
.