Main issue: In Shopify Function Extensions, querying input.cart.deliveryGroups to read the selected delivery option at checkout returns an empty array.
Key observations:
Multiple developers report deliveryGroups is empty in Order Discount functions, even when cartBuyerIdentityUpdate succeeds and in Shopify GraphiQL.
Shipping Discount functions do return deliveryGroups correctly, indicating a difference between function types despite identical input.cart types in docs.
Latest clarification:
This behavior is a documented limitation of the Order Discount Function API (see “About the Order Discount Function API” → “Limitations and considerations”). The GraphQL reference lists deliveryGroups, but it will not populate in Order Discount functions.
Implications:
Use cases that rely on applying order discounts based on selected delivery method (e.g., local delivery/pickup) are not supported directly.
Some teams updated project scope and implemented less-ideal workarounds.
Status:
No platform fix or official workaround announced. The discussion points to consulting the limitations documentation and exploring alternative approaches outside Order Discount functions.
Summarized with AI on December 16.
AI used: gpt-5.
In a Shopify app with a function extension I am trying to get in the input.graphql the delivery options selected at checkout. In the docs i didn’t find anything.
I came up with the following. Everything works but deliveryGroups returns always a empty array. Did someone is facing the same?
I’m having the same issue with cart query. I can confirm that I’m mutating “cartBuyerIdentityUpdate” successfully but deliveryGroup is always empty no matter what I try. My store only have local Delivery and pickup options and I’m coding a Hydrogen store.
What’s the catch with this deliveryGroup? Is it available only under some conditions or what should we check further?
Ps. I’m having the same issue with shopify-graphiql-app
For those experiencing getting an empty deliveryGroups array in the Order Discount Function, this is a documented limitation of the function. Unfortunately, the field is listed as an available property of the input query and there is no mention that it always returns an empty array in the function GraphQL API reference docs. If relying on the function GraphQL API reference to determine compatibility, you will be led astray as I was. The limitation is listed in the ‘About the Order Discount Function API’ page under ‘Limitations and considerations’. Link to doc here: https://shopify.dev/docs/api/functions/reference/order-discounts
It would be great if Shopify gave us this information with the Order Discount function or at the very least update the docs, so it’s more clear. Our use case is that we want to provide an order discount based on certain delivery methods selected. We had to find a workaround that is not as ideal.