Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 284f345

Browse files
committed
Additional checks for fragments added in category tree
1 parent f947cad commit 284f345

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

app/code/Magento/CatalogGraphQl/Model/AttributesJoiner.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ public function join(FieldNode $fieldNode, AbstractCollection $collection) : voi
2828

2929
/** @var FieldNode $field */
3030
foreach ($query as $field) {
31+
if ($field->kind === 'InlineFragment') {
32+
continue;
33+
}
34+
3135
if (!$collection->isAttributeAdded($field->name->value)) {
3236
$collection->addAttributeToSelect($field->name->value);
3337
}

app/code/Magento/CatalogGraphQl/Model/Category/DepthCalculator.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ public function calculate(FieldNode $fieldNode) : int
2626
$depth = count($selections) ? 1 : 0;
2727
$childrenDepth = [0];
2828
foreach ($selections as $node) {
29+
if ($node->kind === 'InlineFragment') {
30+
continue;
31+
}
32+
2933
$childrenDepth[] = $this->calculate($node);
3034
}
3135

app/code/Magento/CatalogGraphQl/Model/Resolver/Products/DataProvider/CategoryTree.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ private function joinAttributesRecursively(Collection $collection, FieldNode $fi
143143

144144
/** @var FieldNode $node */
145145
foreach ($subSelection as $node) {
146+
if ($node->kind === 'InlineFragment') {
147+
continue;
148+
}
149+
146150
$this->joinAttributesRecursively($collection, $node);
147151
}
148152
}

0 commit comments

Comments
 (0)