Skip to content

Get Compare Items

About

The compareItems query retrieves a paginated list of products in the authenticated customer's comparison list. Use this query to:

  • Display the customer's product comparison list
  • Build comparison tables with product details
  • Implement pagination for large comparison lists
  • Show compare item counts and status

This query uses cursor-based pagination and returns compare items with their associated product and customer data.

Authentication

This query requires customer authentication:

  • Authenticated customers: Provide a valid customer authentication token in the Authorization header. Obtain this token via the Customer Login API.
Authorization: Bearer <accessToken>

Arguments

ArgumentTypeDescription
firstIntNumber of items to return per page.
afterStringCursor for pagination. Use endCursor from previous response.

Possible Returns

FieldTypeDescription
edges[CompareItemEdge!]Array of compare item edges with cursor and node.
edges.cursorString!Cursor for this edge, used in pagination.
edges.nodeCompareItem!The compare item object.
edges.node.idID!IRI identifier (e.g. /api/shop/compare-items/606).
edges.node._idInt!Numeric identifier.
edges.node.productProduct!Associated product with id, name, sku, price, etc.
edges.node.customerCustomer!Associated customer with id, email, firstName, lastName.
edges.node.createdAtStringTimestamp when the item was added.
edges.node.updatedAtStringTimestamp when the item was last updated.
pageInfoPageInfo!Pagination metadata.
totalCountInt!Total number of compare items.

Released under the MIT License.