Skip to content

Compare ​

The Compare menu lets a signed-in customer build a side-by-side comparison list of products. A client uses it to power the "add to compare" action and the compare page.

When you use it ​

The compare list is per-customer. A customer can add a product to the list, list everything in it, view one item, remove an item, or clear the whole list at once. Compare is a customer feature — it is not available to guests.

Operations ​

OperationGraphQL fieldDescription
List the comparisoncompareItemsEvery product the customer has added, each with its full product detail.
View one entrycompareItemA single comparison entry.
Add a productcreateCompareItemPut a product on the comparison list.
Remove a productdeleteCompareItemDrop one product from the list.
Clear the listcreateDeleteAllCompareItemsRemove every product in one call.

Each entry carries the whole product object, so a compare table can be rendered from one request — there is no need to fetch each product separately. Catalog products also carry an isInCompare flag, which lets a listing page show the added state without reading this list.

All Compare operations require a customer Bearer token — see Authentication.

Released under the MIT License.