cartLinesAdd mutation does not provide enough feedback on success/failure #151
juanpprieto
started this conversation in
Ideas & Requests
Replies: 1 comment
-
To add to this, it appears that updating subsequent line items above the available quantity results in the API dropping the quantity to I documented this in detail here, which was pushed as an issue with the Storefront API: Shopify/hydrogen#824 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When we call
cartLinesAdd
we get no feedback wether the line was actually added or updated.This is problematic because it makes it very hard for merchants to update their (success/error) UI without keeping track of the previous cart and performing a comparison logic often on client-side.
It's also very hard to reliably trigger analytics events such as "add_to_cart", because it's impossible to determine if the item was successfully added/updated (without a prev cart)
No feedback if adding beyond what is
availableForSale
Furthermore, If a variant has 2
availableForSale
and I add 2 everything is ok. But, if I then add another item I don't get any indication that the mutation did not update the line quantity.Possible solutions
linesAdded: Lines[] | null
along sidecart
anduserErrors
. This one would be preferred because we get back the lines that were updated. This is the payload the "add_to_cart" analytic events requireuseError
indicating the lines was not updated/added due to availability. Less ideal as we would need to build the "linesAdded" payload on the application to pass it to analyticsBeta Was this translation helpful? Give feedback.
All reactions