From 9116d8259244ac3b03dec76f39aa56e2d478998f Mon Sep 17 00:00:00 2001 From: Dmytro Cheshun Date: Sat, 30 Jun 2018 13:57:01 +0300 Subject: [PATCH] Fix the category tree depth calculation issue --- .../Model/Resolver/Products/DataProvider/CategoryTree.php | 4 ++-- .../testsuite/Magento/GraphQl/Catalog/CategoryTest.php | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php index 3c0157941063..80cd427ea984 100644 --- a/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php +++ b/app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php @@ -24,9 +24,9 @@ class CategoryTree { /** - * In depth we need to calculate only children nodes, so 2 first wrapped nodes should be ignored + * In depth we need to calculate only children nodes, so the first wrapped node should be ignored */ - const DEPTH_OFFSET = 2; + const DEPTH_OFFSET = 1; /** * @var CollectionFactory 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 0133b87e757b..4f68090657a1 100644 --- a/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php +++ b/dev/tests/api-functional/testsuite/Magento/GraphQl/Catalog/CategoryTest.php @@ -63,9 +63,6 @@ public function testCategoriesTree() children { level id - children { - id - } } } }