Hi !
I’m trying to get an estimate cost of shipping in my Hydrogen app.
For that, I add a cart line item, which creates a cartId.
const result = await context.cart.addLines([
{
merchandiseId: variantId,
quantity: 1,
},
]);
I then mutate succesfully the “cartBuyerIdentityUpdate”, providing the country, province and zip code.
const buyerIdentityResponse = await context.storefront.mutate(
UPDATE_CART_BUYER_IDENTITY_MUTATION,
{
variables: {
cartId,
buyerIdentity: {
countryCode,
deliveryAddressPreferences: [
{
deliveryAddress: {
zip: postalCode,
country: country,
province: provinceCode,
},
},
],
},
},
},
);
But it always returns an empty array for deliveryGroups.
When I try the same cartId in the checkout page, it works perfectly.
Am I missing something ? Any idea why deliveryGroups would come back unpopulated everytime ?
Thanks for your help !