Skip to main content
shoppy.pages.before(cursor)
Fetches pages before the given cursor for backward pagination.

Parameters

ParamTypeRequiredDescription
cursorstringYesCursor from previous pageInfo

Returns

PagesQueryBuilder (chainable)

Examples

Paginate backward

// Get a page
const currentPage = await shoppy.pages.limit(10).list()

// Get previous page
if (currentPage.pageInfo.hasPreviousPage) {
    const previousPage = await shoppy.pages
        .limit(10)
        .before(currentPage.pageInfo.startCursor)
        .list()
}