Infinite-query options for contracts that follow the Beignet cursor
pagination convention.
Spread the result into rq(contract).infiniteQueryOptions(...) when the
contract takes an optional cursor query param and responds with a
PageResult-style body whose page.nextCursor is string | null. The
first page is fetched without a cursor, each next page sends
lastPage.page.nextCursor, and null tells TanStack Query there is no
next page.
Type safety is structural: contracts without a cursor query param or
without page.nextCursor in the response fail to typecheck at the spread
site. Write initialPageParam, getNextPageParam, and page(...) by hand
for contracts that paginate differently.
Infinite-query options for contracts that follow the Beignet cursor pagination convention.
Spread the result into
rq(contract).infiniteQueryOptions(...)when the contract takes an optionalcursorquery param and responds with aPageResult-style body whosepage.nextCursorisstring | null. The first page is fetched without a cursor, each next page sendslastPage.page.nextCursor, andnulltells TanStack Query there is no next page.Type safety is structural: contracts without a
cursorquery param or withoutpage.nextCursorin the response fail to typecheck at the spread site. WriteinitialPageParam,getNextPageParam, andpage(...)by hand for contracts that paginate differently.