Tags:
- Storefront GraphQL API
- 2026-07
Read a cart line's viewKey from the CartLine type
viewKey from the CartLine typeThe type now exposes a field, so you can correlate a returned cart line with the you sent to and .
What's new
returns the sameyour Liquid storefront renders, alongside the existing UUIDid.
How to use
Previously, identifying a line by was input-only: you could send a , but the response returned a UUID id with no to map back. You can now read it directly off the line.
query CartLines($cartId: ID!) {
cart(id: $cartId) {
lines(first: 10) {
edges {
node {
id
viewKey
}
}
}
}
}
query CartLines($cartId: ID!) {
cart(id: $cartId) {
lines(first: 10) {
edges {
node {
id
viewKey
}
}
}
}
}
The field reads a value the cart already stores, so existing UUID-based correlation keeps working unchanged.
Was this section helpful?