Skip to content

Commit b248cbf

Browse files
authored
ENGCOM-4080: Changed hard coded "configurable" to Configurable::TYPE_CODE #328
2 parents 2929dfa + 12c178a commit b248cbf

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

app/code/Magento/ConfigurableProductGraphQl/Model/ConfigurableProductTypeResolver.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,26 @@
88
namespace Magento\ConfigurableProductGraphQl\Model;
99

1010
use Magento\Framework\GraphQl\Query\Resolver\TypeResolverInterface;
11+
use Magento\ConfigurableProduct\Model\Product\Type\Configurable as Type;
1112

1213
/**
1314
* {@inheritdoc}
1415
*/
1516
class ConfigurableProductTypeResolver implements TypeResolverInterface
1617
{
18+
/**
19+
* Configurable product type resolver code
20+
*/
21+
const TYPE_RESOLVER = 'ConfigurableProduct';
22+
1723
/**
1824
* {@inheritdoc}
1925
*/
2026
public function resolveType(array $data) : string
2127
{
22-
if (isset($data['type_id']) && $data['type_id'] == 'configurable') {
23-
return 'ConfigurableProduct';
28+
if (isset($data['type_id']) && $data['type_id'] == Type::TYPE_CODE) {
29+
return self::TYPE_RESOLVER;
30+
2431
}
2532
return '';
2633
}

0 commit comments

Comments
 (0)