CartNoteUpdatePayload
Payload returned by the cartNoteUpdate
mutation. This object contains the updated cart information along with any errors that occurred during the update process.
Type Definition
type CartNoteUpdatePayload {
cart: Cart!
userErrors: [UserError]!
}
Fields
Field | Type | Nullability | Description | Relationship |
---|---|---|---|---|
cart | Cart | Non-null | The updated cart after the note update | Related to Cart type |
userErrors | [UserError] | Non-null | List of errors that occurred during the cart note update | Related to UserError type |
Relationships
- cart: This field returns the updated
Cart
object reflecting the latest state after the note update mutation. - userErrors: This field returns a list of
UserError
objects that describe any validation or processing errors encountered during the mutation.
Usage Examples
Basic Query
mutation {
cartNoteUpdate(cartId: "eyJhbGciOiJIUzI1NiJ9...", note: "Please leave package at the back door.") {
cart {
id
note
}
userErrors {
field
message
}
}
}
Field Selection
{
cartNoteUpdate(cartId: "eyJhbGciOiJIUzI1NiJ9...", note: "Gift wrap this item.") {
cart {
id
note
totalQuantity
}
userErrors {
message
}
}
}
Nested Queries
mutation {
cartNoteUpdate(cartId: "eyJhbGciOiJIUzI1NiJ9...", note: "Deliver after 5 PM.") {
cart {
id
note
lines(first: 5) {
edges {
node {
id
merchandise {
title
priceV2 {
amount
currencyCode
}
}
quantity
}
}
}
}
userErrors {
field
message
}
}
}
Filtering and Sorting
The CartNoteUpdatePayload
type itself does not support filtering or sorting. However, you can apply filtering and sorting on nested fields within the cart
object, such as cart lines, if supported by the Cart
type.
Example (filtering cart lines by quantity > 1):
mutation {
cartNoteUpdate(cartId: "eyJhbGciOiJIUzI1NiJ9...", note: "Urgent delivery.") {
cart {
id
lines(first: 10, query: "quantity:>1") {
edges {
node {
id
quantity
merchandise {
title
}
}
}
}
}
userErrors {
message
}
}
}
Note: The above filtering example assumes the lines
connection on Cart
supports a query
argument for filtering.
Implements
This type does not implement any interfaces.
Connections
This type does not define any connections itself but contains fields that reference other object types which may have their own connections (e.g., Cart
).
Related Types
- Cart: Represents the shopping cart, including its contents, attributes, and metadata.
- UserError: Represents errors that occur during mutations or queries, including field-specific validation errors.
Best Practices
- Always check the
userErrors
field after performing thecartNoteUpdate
mutation to handle any errors gracefully. - Use the returned
cart
object to update your UI or application state to reflect the latest cart information. - When querying nested fields within
cart
, request only the fields you need to optimize performance. - Use pagination and filtering on nested connections (like cart lines) where supported to manage large datasets efficiently.
Notes
- The
cartNoteUpdate
mutation and its payload currently require no authentication; however, this may change in future API versions. - The
cart
field in the payload is guaranteed to be non-null, representing the cart state after the mutation. - The
userErrors
array will be empty if the mutation completes successfully without errors. - Avoid requesting excessive nested data in a single query to maintain optimal response times.
- Handle errors returned in
userErrors
carefully to provide meaningful feedback to end users.
Last updated on