File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
app/code/Magento/EavGraphQl/Model/TypeResolver Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2025 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
88namespace Magento \EavGraphQl \Model \TypeResolver ;
99
1010use Magento \Eav \Model \Attribute ;
1111use Magento \Eav \Model \AttributeRepository ;
12+ use Magento \Framework \Exception \NoSuchEntityException ;
1213use Magento \Framework \GraphQl \Query \Resolver \TypeResolverInterface ;
14+ use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
1315
1416/**
1517 * @inheritdoc
@@ -42,14 +44,20 @@ public function __construct(
4244
4345 /**
4446 * @inheritdoc
47+ *
48+ * @throws GraphQlNoSuchEntityException
4549 */
4650 public function resolveType (array $ data ): string
4751 {
48- /** @var Attribute $attr */
49- $ attr = $ this ->attributeRepository ->get (
50- $ data ['entity_type ' ],
51- $ data ['code ' ],
52- );
52+ try {
53+ /** @var Attribute $attr */
54+ $ attr = $ this ->attributeRepository ->get (
55+ $ data ['entity_type ' ],
56+ $ data ['code ' ],
57+ );
58+ } catch (NoSuchEntityException $ e ) {
59+ throw new GraphQlNoSuchEntityException (__ ($ e ->getMessage ()), $ e );
60+ }
5361
5462 if (in_array ($ attr ->getFrontendInput (), $ this ->frontendInputs )) {
5563 return 'AttributeSelectedOptions ' ;
You can’t perform that action at this time.
0 commit comments