Skip to main content
shoppy.products.before(cursor)
Sets the cursor for backward pagination. Use to fetch the previous page.
This is a chainable method. Call .list() to execute.

Parameters

ParamTypeRequiredDescription
cursorstringYespageInfo.startCursor from current response

Returns

ProductsQueryBuilder (chainable)

Examples

Go back one page

const previousPage = await shoppy.products
    .limit(12)
    .before(currentPage.pageInfo.startCursor)
    .list()

With collection

const previousPage = await shoppy.products
    .collection('all')
    .limit(12)
    .before(currentPage.pageInfo.startCursor)
    .list()