TanStackT
TanStack2y ago
4 replies
ordinary-sapphire

fetch next page

https://tanstack.com/query/latest/docs/framework/react/guides/query-functions#query-function-variables

is there a way to pass the data that has been retrieved when fetchNextPage is being executed?

i wanted to use the document data (retrieved from the initial fetch) as my cursor instead of incementing or decrementing one by one.
A query function can be literally any function that returns a promise. The promise that is returned should either resolve the data or throw an error.

All of the following are valid query function configurations:
Query Functions | TanStack Query React Docs
Was this page helpful?