How to get selected delivery options in Shopify app using function extension?

Meltin-Bit
Shopify Partner
26 0 10

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?

 

Thanks in advance.

F.

query Input {
	cart {
		lines {
			quantity
			merchandise {
				__typename
				... on ProductVariant {
					id
					sku
				}
			}
		}
		deliveryGroups {
			selectedDeliveryOption {
				deliveryMethodType
			}
		}
	}
	discountNode {
		metafield(namespace: "function-discounts", key: "function-config") {
			value
		}
	}
}

 

Meltin Bit
Replies 3 (3)

vixnguyen
Shopify Partner
45 4 4

I'm facing the same issue. It takes time to investigate if I'm doing wrong, but finally I realized that it's the issue of platform.

LucasBudi
Shopify Partner
7 0 2

We are facing the same thing but only for Order Discounts functions, while for Shipping Discount functions we get the deliveryGroups fine. Seems to be an issue with the Order Discount API, although the `input.cart` type is identical between the 2 https://shopify.dev/docs/api/functions/reference/order-discounts/graphql/common-objects/cart

onur_alp4
Shopify Partner
1 0 0

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