noob saibotN
Convex Community2y ago
1 reply
noob saibot

How to explicitly set the current page in a nextjs paginated query?

In my nextjs application, I have a use case where user can "jump" to a specific page and not only progress sequentially. For that user can indicate this url parameter ?page=n. How can I apply this parameter in my paginated query? In other words, I have created my paginated query function:
export default query({
  args: {
    paginatedOpts: paginationOptsValidator,
  },
  handler: async (ctx) => {
    ...
  }
});

The paginationOptsValidator object defines a
cursor
property. Is this the property I should use? If yes, how should I proceed?
Thanks
Was this page helpful?