Queries
cart
Fetch a cart with all line items.
Mutations
createCart
Create a new cart for a store.
| Field | Type | Required | Description |
|---|---|---|---|
storeUid | UUID | Yes | Store/project UID |
addToCart
Add a product to a cart.
| Field | Type | Required | Description |
|---|---|---|---|
cartUid | UUID | No | Cart UID. If omitted, reads from session cookie. |
productUid | UUID | Yes | Product to add |
quantity | Int | No | Defaults to 1 |
updateCartLine
Update a line item’s quantity.
| Field | Type | Required | Description |
|---|---|---|---|
cartUid | UUID | Yes | Cart UID |
lineItemUid | UUID | Yes | Line item to update |
quantity | Int | Yes | New quantity. Set to 0 to remove. |
removeCartLine
Remove a line item from a cart.
| Field | Type | Required | Description |
|---|---|---|---|
cartUid | UUID | Yes | Cart UID |
lineItemUid | UUID | Yes | Line item to remove |
Types
Cart
| Field | Type | Description |
|---|---|---|
uid | UUID | Cart ID |
lineItems | [CartLineItem] | Items in the cart |
createdAt | DateTime | |
updatedAt | DateTime |
CartLineItem
| Field | Type | Description |
|---|---|---|
uid | UUID | Line item ID |
product | Product | The product |
quantity | Int | Quantity |
createdAt | DateTime |