DeliveryGroup returns empty array after running a mutation on the cart

Topic summary

Issue: On a Hydrogen custom storefront (dev store), any cart mutation causes cart.deliveryGroups to become an empty array. The delivery group only reappears after revisiting Checkout, unchanged from its prior state.

Context and attempts:

  • Followed Shopify’s documented approach to set delivery options and used Storefront API 2024-01 mutation cartSelectedDeliveryOptionsUpdate.
  • Mutation appears to succeed in GraphiQL, but the returned cart still has deliveryGroups: .
  • The same disappearance happens with any cart change (e.g., increasing item quantity, changing cart attributes).
  • Screenshots (central to understanding) show delivery group present before mutation, missing immediately after, and subsequent errors when referencing it.

Notes: “deliveryGroups” are Shopify’s groupings of items that share a delivery method.

Outcome and status:

  • No confirmed explanation on whether this is intended behavior or a bug.
  • OP’s workaround: stop programmatically setting delivery options; let customers choose in Checkout and restrict options via an app.
  • Discussion remains unresolved with unanswered questions about root cause/expected behavior.
Summarized with AI on December 22. AI used: gpt-5.

Hi there! This post is related to Shopify Hydrogen on a development store. I would like to inquire if a certain behaviour regarding deliveryGroups is intentional or a bug.

I’m working on setting the delivery method of a cart after the delivery group has been created. I found that any attempts to modify the cart deletes the delivery group. This delivery group returns unmodified upon re-entering the checkout.

I’ve followed this method for setting the delivery option: https://shopify.dev/docs/custom-storefronts/hydrogen/cart/selected-delivery-options and experimented with this mutation from the storefront API: https://shopify.dev/docs/api/storefront/2024-01/mutations/cartSelectedDeliveryOptionsUpdate

The mutation supposedly works when tested in the graphiql page, but still returns a cart with an empty array for deliveryGroups (even when it had prior). When the delivery group returns via visiting the checkout page, it is unmodified and it its state prior to editing. This behaviour not only occurs via modifying the deliveryOption, it also occurs when any change to the cart happens (increasing quantity of a product, changing attributes of a cart).

Below are attached screenshots showcasing the mutations being run on the cart in attempt to modify the delivery option

Did you find any answer to it?

Nope, In the end I opted to change the flow and let the user set it in the checkout page. I limited options using an app and gave up on doing it this way.