Skip to content

Commit fc5a7ff

Browse files
committed
Change cart total_quanity to float and make optional
1 parent f6f0aef commit fc5a7ff

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/CartTotalQuantity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
2929
/** @var Quote $cart */
3030
$cart = $value['model'];
3131

32-
return $cart->getItemsSummaryQty();
32+
return (float)$cart->getItemsSummaryQty();
3333
}
3434
}

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ type Cart {
197197
available_payment_methods: [AvailablePaymentMethod] @resolver(class: "Magento\\QuoteGraphQl\\Model\\Resolver\\AvailablePaymentMethods") @doc(description: "Available payment methods")
198198
selected_payment_method: SelectedPaymentMethod @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\SelectedPaymentMethod")
199199
prices: CartPrices @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartPrices")
200-
total_quantity: Int! @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity")
200+
total_quantity: Float @resolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartTotalQuantity")
201201
}
202202

203203
interface CartAddressInterface @typeResolver(class: "\\Magento\\QuoteGraphQl\\Model\\Resolver\\CartAddressTypeResolver") {

0 commit comments

Comments
 (0)