Cart warnings inform clients about automatic changes that a GraphQL mutation has made to a cart. Unlike a user error, which indicates a mutation failure, a warning confirms the mutation's success and the automatic changes it has made to the cart. All successful cart mutations can generate an array of [`CartWarning` objects](/docs/api/storefront/2024-10/objects/CartWarning). Each warning contains a discrete code, localized message and the ID of the targeted object in the cart. Clients can choose to address an automatic change, but action isn't required. For example, if an item that was previously added to the cart becomes out of stock during the addition of another product, we'll issue a warning indicating `MERCHANDISE_OUT_OF_STOCK` with the ID of the cart line for that out of stock item. An example call to [`cartLinesAdd`](/docs/api/storefront/2024-10/mutations/cartLinesAdd) is shown below.

Clients can take the [`target`](https://shopify.dev/docs/api/storefront/2024-10/objects/CartWarning#field-target) from a warning and construct a call to [`CartLinesRemove`](/docs/api/storefront/2024-10/mutations/cartLinesRemove) to remove an out of stock item.