Documentation Index
Fetch the complete documentation index at: https://docs.colossal.sh/llms.txt
Use this file to discover all available pages before exploring further.
Queries
cart
Fetch a cart with all line items.
query Cart($uid: UUID!) {
cart(uid: $uid) {
uid
lineItems {
uid
product {
uid
name
}
quantity
createdAt
}
createdAt
updatedAt
}
}
Mutations
createCart
Create a new cart for a store.
mutation CreateCart($input: CreateCartInput!) {
createCart(input: $input) {
success
data {
uid
}
}
}
Input:
| Field | Type | Required | Description |
|---|
storeUid | UUID | Yes | Store/project UID |
addToCart
Add a product to a cart.
mutation AddToCart($input: AddToCartInput!) {
addToCart(input: $input) {
success
data {
uid
lineItems {
uid
product { uid name }
quantity
}
}
}
}
Input:
| 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.
mutation UpdateCartLine($input: UpdateCartLineInput!) {
updateCartLine(input: $input) {
success
data {
uid
lineItems { uid quantity }
}
}
}
Input:
| 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.
mutation RemoveCartLine($input: RemoveCartLineInput!) {
removeCartLine(input: $input) {
success
data {
uid
lineItems { uid }
}
}
}
Input:
| 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 | |