Hi @sebastien.vassaux, thanks for reaching out about this. The documentation mentions that you can use the after and before parameters.
Unfortunately the Prismic GraphQL API doesn’t currently support offset. But I will pass this along to our dev team and add it to our feature request tracker as a possible improvement for the future.
Chiming in here to say that this is must! Especially that the prismic docs mention the official spec and the official spec tells us first and foremost about the ‘offset’ key.
Hello @yannick.tian, thanks for joining the conversation. At the moment, there is no news about the feature request.
Offset pagination is easy to implement, but it's prone to errors if your database is extensive. It needs to re-read the pages many times because it can't track the last requested record.
The cursor-based pagination standard is a more scalable option. It addresses issues that offset carries. It allows the server to use the cursor's index to perform efficient queries without having to read the same records repeatedly. Also, the results remain consistent. This improves the performance of your site. The only drawback of cursor-based pagination has is that the user needs to traverse all the pages as it uses the pagination.
Thanks for your reply @Pau
I totally agree that cursor-based pagination is more performant than offset pagination.
However in terms of SEO with cursor based pagination, it would lead to a large number of links as the content moves around due to more content being generated everyday. It will also lead to duplicated content, as multiple links may point to a bucket of content that was already covered in some other URL.
That's way I we believe that offset pagination would work better for SEO.
For the time being we'll just implement offset pagination with @prismicio/client but we will lose the power of GraphQL typings
Hello team. We close the threads after a week with no new activity. If this happens and you want to continue the conversation, you can easily flag it to reopen it and add a new comment.
Thanks.
Pau
closed , flag & select 'Something Else' to reopen.
18
Threads close after a period of inactivity. Flag this thread to re-open it and continue the conversation.