Skip to content

Commit d09b624

Browse files
author
Prabhu Ram
committed
PWA-1720: Expose storefront properties of Catalog attributes
- Fixed broken test
1 parent 35ba942 commit d09b624

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

app/code/Magento/EavGraphQl/Model/Resolver/CustomAttributeMetadata.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,11 @@ public function resolve(
5555
) {
5656
$attributes['items'] = null;
5757
$attributeInputs = $args['attributes'];
58-
$this->validateInputFields($attributeInputs);
5958
foreach ($attributeInputs as $attributeInput) {
59+
if (!isset($attributeInput['attribute_code']) || !isset($attributeInput['entity_type'])) {
60+
$attributes['items'][] = $this->createInputException($attributeInput);
61+
continue;
62+
}
6063
try {
6164
$attribute = $this->attribute->getAttribute(
6265
$attributeInput['attribute_code'],
@@ -129,21 +132,6 @@ private function getLayeredNavigationPropertiesEnum() {
129132
];
130133
}
131134

132-
/**
133-
* Validate input
134-
*
135-
* @param array $attributeInputs
136-
*/
137-
private function validateInputFields(array $attributeInputs)
138-
{
139-
foreach ($attributeInputs as $attribute) {
140-
if (!isset($attribute['attribute_code']) || !isset($attribute['entity_type'])) {
141-
$attributes['items'][] = $this->createInputException($attribute);
142-
continue;
143-
}
144-
}
145-
}
146-
147135
/**
148136
* Create GraphQL input exception for an invalid attribute input
149137
*

0 commit comments

Comments
 (0)