1

Our app uses Algolia for searching which allows for two typical forms of pagination: by page page=3&hitsPerPage=5 or by offset offset=10&length=5

GraphQL preferences cursor-based pagination where a recordID and length are provided friendsConnection(first:5 after:"Y3Vyc29yMQ==")

Is there anyway to translate info from a cursor-based pagination request into a page or offset pagination request?

Dan
  • 1,136
  • 10
  • 24

1 Answers1

1

Depending what you use Algolia for (having all records available), you're able to use the index.browseFrom method. This will use a cursor. The documentation for that is here

Haroen Viaene
  • 1,329
  • 18
  • 33
  • As browse methods browseParameters has limited features such as no support for facets we can't use browseFrom. Thanks anyways – Dan Apr 30 '18 at 06:04
  • Then you'll be stuck with offset or pagination, something interesting to keep in mind though, thanks for bringing it up! – Haroen Viaene Apr 30 '18 at 09:15