Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private function fetch() : array
'price' => $link->getSelectionPriceValue(),
'position' => $link->getPosition(),
'id' => $link->getSelectionId(),
'qty' => (int)$link->getSelectionQty(),
'qty' => (float)$link->getSelectionQty(),
'quantity' => (float)$link->getSelectionQty(),
'is_default' => (bool)$link->getIsDefault(),
'price_type' => $this->enumLookup->getEnumValueFromField(
'PriceTypeEnum',
Expand Down
3 changes: 2 additions & 1 deletion app/code/Magento/BundleGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ type BundleItem @doc(description: "BundleItem defines an individual item in a bu
type BundleItemOption @doc(description: "BundleItemOption defines characteristics and options for a specific bundle item.") {
id: Int @doc(description: "The ID assigned to the bundled item option.")
label: String @doc(description: "The text that identifies the bundled item option.") @resolver(class: "Magento\\BundleGraphQl\\Model\\Resolver\\Options\\Label")
qty: Float @doc(description: "Indicates the quantity of this specific bundle item.")
qty: Float @deprecated(reason: "The `qty` is deprecated. Use `quantity` instead.") @doc(description: "Indicates the quantity of this specific bundle item.")
quantity: Float @doc(description: "Indicates the quantity of this specific bundle item.")
position: Int @doc(description: "When a bundle item contains multiple options, the relative position of this option compared to the other options.")
is_default: Boolean @doc(description: "Indicates whether this option is the default option.")
price: Float @doc(description: "The price of the selected option.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function testAllFieldsBundleProducts()
sku
options {
id
qty
quantity
position
is_default
price
Expand Down Expand Up @@ -143,7 +143,7 @@ public function testBundleProductWithNotVisibleChildren()
sku
options {
id
qty
quantity
position
is_default
price
Expand Down Expand Up @@ -269,7 +269,7 @@ private function assertBundleProductOptions($product, $actualResponse)
$actualResponse['items'][0]['options'][0],
[
'id' => $bundleProductLink->getId(),
'qty' => (int)$bundleProductLink->getQty(),
'quantity' => (int)$bundleProductLink->getQty(),
'position' => $bundleProductLink->getPosition(),
'is_default' => (bool)$bundleProductLink->getIsDefault(),
'price_type' => self::KEY_PRICE_TYPE_FIXED,
Expand Down Expand Up @@ -428,8 +428,9 @@ public function testNonExistentFieldQtyExceptionOnBundleProduct()
QUERY;

$this->expectException(\Exception::class);
$this->expectExceptionMessage('GraphQL response contains errors: Cannot'. ' ' .
'query field "qty" on type "ProductInterface".');
$this->expectExceptionMessage(
'GraphQL response contains errors: Cannot query field "qty" on type "ProductInterface".'
);
$this->graphQlQuery($query);
}
}