From b8f5c5363a3ea33fe9e79c79fee77cc448f07fe0 Mon Sep 17 00:00:00 2001 From: RomanKis Date: Mon, 25 Mar 2019 15:20:18 +0200 Subject: [PATCH 1/7] graphQl-527: Category Tree Contains null Leaves --- .../Model/Category/DepthCalculator.php | 4 +- .../Magento/GraphQl/Catalog/CategoryTest.php | 43 +++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php index dbe58a9c77cd0..5645b18017a2f 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php @@ -26,7 +26,9 @@ public function calculate(FieldNode $fieldNode) : int $depth = count($selections) ? 1 : 0; $childrenDepth = [0]; foreach ($selections as $node) { - if ($node->kind === 'InlineFragment') { + if ($node->kind === 'InlineFragment' + || null !== $node->alias + ) { continue; } diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index cbce53325e9e6..dc3b348c2706e 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -8,6 +8,7 @@ namespace Magento\GraphQl\Catalog; use Magento\Catalog\Api\Data\CategoryInterface; +use Magento\Catalog\Model\CategoryRepository; use Magento\Catalog\Model\ResourceModel\Category\Collection as CategoryCollection; use Magento\Framework\DataObject; use Magento\TestFramework\TestCase\GraphQl\ResponseContainsErrorsException; @@ -23,9 +24,15 @@ class CategoryTest extends GraphQlAbstract */ private $objectManager; + /** + * @var CategoryRepository + */ + private $categoryRepository; + protected function setUp() { $this->objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->categoryRepository = $this->objectManager->get(CategoryRepository::class); } /** @@ -103,6 +110,42 @@ public function testCategoriesTree() ); } + /** + * @magentoApiDataFixture Magento/Catalog/_files/categories.php + */ + public function testCategoriesTreeWithDisabledCategory() + { + $category = $this->categoryRepository->get(3); + $category->setIsActive(false); + $this->categoryRepository->save($category); + + $rootCategoryId = 2; + $query = <<graphQlQuery($query); + + $this->assertArrayHasKey('category', $response); + $this->assertArrayHasKey('children', $response['category']); + $this->assertSame(6, count($response['category']['children'])); + } + /** * @magentoApiDataFixture Magento/Catalog/_files/categories.php */ From b948b62baa0ec1ee81b5f08330e4545780eb9dce Mon Sep 17 00:00:00 2001 From: Valerii Naida Date: Mon, 25 Mar 2019 13:20:45 -0500 Subject: [PATCH 2/7] GraphQL-527: Category Tree Contains null Leaves --- .../CatalogGraphQl/Model/Category/DepthCalculator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php index 5645b18017a2f..3d30f26be3b61 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php @@ -26,8 +26,9 @@ public function calculate(FieldNode $fieldNode) : int $depth = count($selections) ? 1 : 0; $childrenDepth = [0]; foreach ($selections as $node) { - if ($node->kind === 'InlineFragment' - || null !== $node->alias + if ( + $node->kind === 'InlineFragment' + || null !== $node->alias ) { continue; } From 7b80d6174247ee275f4d9d0259d9949f7f21286a Mon Sep 17 00:00:00 2001 From: Alex Taranovsky Date: Wed, 27 Mar 2019 14:30:26 +0200 Subject: [PATCH 3/7] magento/graphql-ce#542: Replace deprecated Magento/Checkout/_files/quote_with_address_saved.php fixture in SetOfflineShippingMethodsOnCartTest --- .../SetOfflineShippingMethodsOnCartTest.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetOfflineShippingMethodsOnCartTest.php index cf32003340a66..a88f31f6ca884 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetOfflineShippingMethodsOnCartTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetOfflineShippingMethodsOnCartTest.php @@ -52,7 +52,11 @@ protected function setUp() } /** - * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php * @@ -67,7 +71,7 @@ public function testSetOfflineShippingMethod(string $carrierCode, string $method $quote = $this->quoteFactory->create(); $this->quoteResource->load( $quote, - 'test_order_1', + 'test_quote', 'reserved_order_id' ); $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId()); @@ -102,7 +106,11 @@ public function offlineShippingMethodDataProvider() } /** - * @magentoApiDataFixture Magento/Checkout/_files/quote_with_address_saved.php + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php */ public function testSetShippingMethodTwiceInOneRequest() @@ -110,7 +118,7 @@ public function testSetShippingMethodTwiceInOneRequest() $quote = $this->quoteFactory->create(); $this->quoteResource->load( $quote, - 'test_order_1', + 'test_quote', 'reserved_order_id' ); $shippingAddress = $quote->getShippingAddress(); From 33d05229a1b61449f1f3a7975bb4981dbf47fa11 Mon Sep 17 00:00:00 2001 From: Alex Taranovsky Date: Thu, 28 Mar 2019 12:25:12 +0200 Subject: [PATCH 4/7] magento/graphql-ce#547: ProductFilterInput. Remove duplicate "special_price" field --- app/code/Magento/CatalogGraphQl/etc/schema.graphqls | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls index 778d0783305b7..dc37b3ce76113 100644 --- a/app/code/Magento/CatalogGraphQl/etc/schema.graphqls +++ b/app/code/Magento/CatalogGraphQl/etc/schema.graphqls @@ -460,7 +460,7 @@ input ProductFilterInput @doc(description: "ProductFilterInput defines the filte description: FilterTypeInput @doc(description: "Detailed information about the product. The value can include simple HTML tags.") short_description: FilterTypeInput @doc(description: "A short description of the product. Its use depends on the theme.") price: FilterTypeInput @doc(description: "The price of an item") - special_price: FilterTypeInput @doc(description: "The discounted price of the product") + special_price: FilterTypeInput @doc(description: "The discounted price of the product. Do not include the currency code.") special_from_date: FilterTypeInput @doc(description: "The beginning date that a product has a special price") special_to_date: FilterTypeInput @doc(description: "The end date that a product has a special price") weight: FilterTypeInput @doc(description: "The weight of the item, in units defined by the store") @@ -477,7 +477,6 @@ input ProductFilterInput @doc(description: "ProductFilterInput defines the filte custom_layout_update: FilterTypeInput @doc(description: "XML code that is applied as a layout update to the product page") min_price: FilterTypeInput @doc(description:"The numeric minimal price of the product. Do not include the currency code.") max_price: FilterTypeInput @doc(description:"The numeric maximal price of the product. Do not include the currency code.") - special_price: FilterTypeInput @doc(description:"The numeric special price of the product. Do not include the currency code.") category_id: FilterTypeInput @doc(description: "Category ID the product belongs to") options_container: FilterTypeInput @doc(description: "If the product has multiple options, determines where they appear on the product page") required_options: FilterTypeInput @doc(description: "Indicates whether the product has required options") From 1093d8b60292d59bbaca6095f008321c77bdd9e2 Mon Sep 17 00:00:00 2001 From: Valerii Naida Date: Fri, 29 Mar 2019 17:45:07 -0500 Subject: [PATCH 5/7] GraphQL-542: Replace deprecated Magento/Checkout/_files/quote_with_address_saved.php fixture in SetOfflineShippingMethodsOnCartTest --- .../SetOfflineShippingMethodsOnCartTest.php | 160 +++++++++++++ .../SetOfflineShippingMethodsOnCartTest.php | 140 +++++++++++ .../SetOfflineShippingMethodsOnCartTest.php | 218 ------------------ 3 files changed, 300 insertions(+), 218 deletions(-) create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php create mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php delete mode 100644 dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/SetOfflineShippingMethodsOnCartTest.php diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php new file mode 100644 index 0000000000000..bd147cc4a197e --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Customer/SetOfflineShippingMethodsOnCartTest.php @@ -0,0 +1,160 @@ +getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class); + $this->getQuoteShippingAddressIdByReservedQuoteId = $objectManager->get( + GetQuoteShippingAddressIdByReservedQuoteId::class + ); + $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); + } + + /** + * @magentoApiDataFixture Magento/Customer/_files/customer.php + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php + * + * @param string $carrierCode + * @param string $methodCode + * @param float $amount + * @param string $label + * @dataProvider offlineShippingMethodDataProvider + */ + public function testSetOfflineShippingMethod(string $carrierCode, string $methodCode, float $amount, string $label) + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + $quoteAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute('test_quote'); + + $query = $this->getQuery( + $maskedQuoteId, + $methodCode, + $carrierCode, + $quoteAddressId + ); + $response = $this->graphQlQuery($query, [], '', $this->getHeaderMap()); + + self::assertArrayHasKey('setShippingMethodsOnCart', $response); + self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']); + self::assertArrayHasKey('shipping_addresses', $response['setShippingMethodsOnCart']['cart']); + self::assertCount(1, $response['setShippingMethodsOnCart']['cart']['shipping_addresses']); + + $shippingAddress = current($response['setShippingMethodsOnCart']['cart']['shipping_addresses']); + self::assertArrayHasKey('selected_shipping_method', $shippingAddress); + + self::assertArrayHasKey('carrier_code', $shippingAddress['selected_shipping_method']); + self::assertEquals($carrierCode, $shippingAddress['selected_shipping_method']['carrier_code']); + + self::assertArrayHasKey('method_code', $shippingAddress['selected_shipping_method']); + self::assertEquals($methodCode, $shippingAddress['selected_shipping_method']['method_code']); + + self::assertArrayHasKey('amount', $shippingAddress['selected_shipping_method']); + self::assertEquals($amount, $shippingAddress['selected_shipping_method']['amount']); + + self::assertArrayHasKey('label', $shippingAddress['selected_shipping_method']); + self::assertEquals($label, $shippingAddress['selected_shipping_method']['label']); + } + + /** + * @return array + */ + public function offlineShippingMethodDataProvider(): array + { + return [ + 'flatrate_flatrate' => ['flatrate', 'flatrate', 10, 'Flat Rate - Fixed'], + 'tablerate_bestway' => ['tablerate', 'bestway', 10, 'Best Way - Table Rate'], + 'freeshipping_freeshipping' => ['freeshipping', 'freeshipping', 0, 'Free Shipping - Free'], + ]; + } + + /** + * @param string $maskedQuoteId + * @param string $shippingMethodCode + * @param string $shippingCarrierCode + * @param int $shippingAddressId + * @return string + */ + private function getQuery( + string $maskedQuoteId, + string $shippingMethodCode, + string $shippingCarrierCode, + int $shippingAddressId + ): string { + return <<customerTokenService->createCustomerAccessToken($username, $password); + $headerMap = ['Authorization' => 'Bearer ' . $customerToken]; + return $headerMap; + } +} diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php new file mode 100644 index 0000000000000..8ed9ef84d6fbd --- /dev/null +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/SetOfflineShippingMethodsOnCartTest.php @@ -0,0 +1,140 @@ +getMaskedQuoteIdByReservedOrderId = $objectManager->get(GetMaskedQuoteIdByReservedOrderId::class); + $this->getQuoteShippingAddressIdByReservedQuoteId = $objectManager->get( + GetQuoteShippingAddressIdByReservedQuoteId::class + ); + } + + /** + * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/guest/create_empty_cart.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php + * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php + * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php + * + * @param string $carrierCode + * @param string $methodCode + * @param float $amount + * @param string $label + * @dataProvider offlineShippingMethodDataProvider + */ + public function testSetOfflineShippingMethod(string $carrierCode, string $methodCode, float $amount, string $label) + { + $maskedQuoteId = $this->getMaskedQuoteIdByReservedOrderId->execute('test_quote'); + $quoteAddressId = $this->getQuoteShippingAddressIdByReservedQuoteId->execute('test_quote'); + + $query = $this->getQuery( + $maskedQuoteId, + $methodCode, + $carrierCode, + $quoteAddressId + ); + $response = $this->graphQlQuery($query); + + self::assertArrayHasKey('setShippingMethodsOnCart', $response); + self::assertArrayHasKey('cart', $response['setShippingMethodsOnCart']); + self::assertArrayHasKey('shipping_addresses', $response['setShippingMethodsOnCart']['cart']); + self::assertCount(1, $response['setShippingMethodsOnCart']['cart']['shipping_addresses']); + + $shippingAddress = current($response['setShippingMethodsOnCart']['cart']['shipping_addresses']); + self::assertArrayHasKey('selected_shipping_method', $shippingAddress); + + self::assertArrayHasKey('carrier_code', $shippingAddress['selected_shipping_method']); + self::assertEquals($carrierCode, $shippingAddress['selected_shipping_method']['carrier_code']); + + self::assertArrayHasKey('method_code', $shippingAddress['selected_shipping_method']); + self::assertEquals($methodCode, $shippingAddress['selected_shipping_method']['method_code']); + + self::assertArrayHasKey('amount', $shippingAddress['selected_shipping_method']); + self::assertEquals($amount, $shippingAddress['selected_shipping_method']['amount']); + + self::assertArrayHasKey('label', $shippingAddress['selected_shipping_method']); + self::assertEquals($label, $shippingAddress['selected_shipping_method']['label']); + } + + /** + * @return array + */ + public function offlineShippingMethodDataProvider(): array + { + return [ + 'flatrate_flatrate' => ['flatrate', 'flatrate', 10, 'Flat Rate - Fixed'], + 'tablerate_bestway' => ['tablerate', 'bestway', 10, 'Best Way - Table Rate'], + 'freeshipping_freeshipping' => ['freeshipping', 'freeshipping', 0, 'Free Shipping - Free'], + ]; + } + + /** + * @param string $maskedQuoteId + * @param string $shippingMethodCode + * @param string $shippingCarrierCode + * @param int $shippingAddressId + * @return string + */ + private function getQuery( + string $maskedQuoteId, + string $shippingMethodCode, + string $shippingCarrierCode, + int $shippingAddressId + ): string { + return <<quoteResource = $objectManager->get(QuoteResource::class); - $this->quoteFactory = $objectManager->get(QuoteFactory::class); - $this->quoteIdToMaskedId = $objectManager->get(QuoteIdToMaskedQuoteIdInterface::class); - $this->customerTokenService = $objectManager->get(CustomerTokenServiceInterface::class); - } - - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - * @magentoApiDataFixture Magento/OfflineShipping/_files/tablerates_weight.php - * - * @param string $carrierCode - * @param string $methodCode - * @param float $amount - * @param string $label - * @dataProvider offlineShippingMethodDataProvider - */ - public function testSetOfflineShippingMethod(string $carrierCode, string $methodCode, float $amount, string $label) - { - $quote = $this->quoteFactory->create(); - $this->quoteResource->load( - $quote, - 'test_quote', - 'reserved_order_id' - ); - $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId()); - $shippingAddressId = (int)$quote->getShippingAddress()->getId(); - - $query = $this->getQuery( - $maskedQuoteId, - $shippingAddressId, - $carrierCode, - $methodCode - ); - - $response = $this->sendRequestWithToken($query); - - $addressesInformation = $response['setShippingMethodsOnCart']['cart']['shipping_addresses']; - self::assertEquals($addressesInformation[0]['selected_shipping_method']['carrier_code'], $carrierCode); - self::assertEquals($addressesInformation[0]['selected_shipping_method']['method_code'], $methodCode); - self::assertEquals($addressesInformation[0]['selected_shipping_method']['amount'], $amount); - self::assertEquals($addressesInformation[0]['selected_shipping_method']['label'], $label); - } - - /** - * @return array - */ - public function offlineShippingMethodDataProvider() - { - return [ - 'flatrate_flatrate' => ['flatrate', 'flatrate', 10, 'Flat Rate - Fixed'], - 'tablerate_bestway' => ['tablerate', 'bestway', 10, 'Best Way - Table Rate'], - 'freeshipping_freeshipping' => ['freeshipping', 'freeshipping', 0, 'Free Shipping - Free'], - ]; - } - - /** - * @magentoApiDataFixture Magento/Customer/_files/customer.php - * @magentoApiDataFixture Magento/Catalog/_files/product_simple.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/customer/create_empty_cart.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/add_simple_product.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/set_new_shipping_address.php - * @magentoApiDataFixture Magento/GraphQl/Quote/_files/enable_offline_shipping_methods.php - */ - public function testSetShippingMethodTwiceInOneRequest() - { - $quote = $this->quoteFactory->create(); - $this->quoteResource->load( - $quote, - 'test_quote', - 'reserved_order_id' - ); - $shippingAddress = $quote->getShippingAddress(); - $shippingAddressId = $shippingAddress->getId(); - $maskedQuoteId = $this->quoteIdToMaskedId->execute((int)$quote->getId()); - - $query = <<sendRequestWithToken($query); - } - - /** - * Generates query for setting the specified shipping method on cart - * - * @param int $shippingAddressId - * @param string $maskedQuoteId - * @param string $carrierCode - * @param string $methodCode - * @return string - */ - private function getQuery( - string $maskedQuoteId, - int $shippingAddressId, - string $carrierCode, - string $methodCode - ): string { - return <<customerTokenService->createCustomerAccessToken('customer@example.com', 'password'); - $headerMap = ['Authorization' => 'Bearer ' . $customerToken]; - - return $this->graphQlQuery($query, [], '', $headerMap); - } -} From 8ab95cffeffee3509cf0e059139ae3c420768512 Mon Sep 17 00:00:00 2001 From: Valerii Naida Date: Fri, 29 Mar 2019 18:12:25 -0500 Subject: [PATCH 6/7] GraphQL-527: Category Tree Contains null Leaves -- fix code style --- .../CatalogGraphQl/Model/Category/DepthCalculator.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php index 3d30f26be3b61..b5d02511da4e7 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php +++ b/app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php @@ -26,10 +26,7 @@ public function calculate(FieldNode $fieldNode) : int $depth = count($selections) ? 1 : 0; $childrenDepth = [0]; foreach ($selections as $node) { - if ( - $node->kind === 'InlineFragment' - || null !== $node->alias - ) { + if ($node->kind === 'InlineFragment' || null !== $node->alias) { continue; } From f13c1ba7f1647383fa60fed875db969619b2be13 Mon Sep 17 00:00:00 2001 From: Valerii Naida Date: Fri, 29 Mar 2019 21:56:17 -0500 Subject: [PATCH 7/7] GraphQL-527: Category Tree Contains null Leaves -- fix static tests --- .../testsuite/Magento/GraphQl/Catalog/CategoryTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php index dc3b348c2706e..b2ce0400f7d83 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -17,6 +17,9 @@ use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\TestFramework\ObjectManager; +/** + * Test loading of category tree + */ class CategoryTest extends GraphQlAbstract { /**