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 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2025 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
8
8
namespace Magento \EavGraphQl \Model \TypeResolver ;
9
9
10
10
use Magento \Eav \Model \Attribute ;
11
11
use Magento \Eav \Model \AttributeRepository ;
12
+ use Magento \Framework \Exception \NoSuchEntityException ;
12
13
use Magento \Framework \GraphQl \Query \Resolver \TypeResolverInterface ;
14
+ use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
13
15
14
16
/**
15
17
* @inheritdoc
@@ -42,14 +44,20 @@ public function __construct(
42
44
43
45
/**
44
46
* @inheritdoc
47
+ *
48
+ * @throws GraphQlNoSuchEntityException
45
49
*/
46
50
public function resolveType (array $ data ): string
47
51
{
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
+ }
53
61
54
62
if (in_array ($ attr ->getFrontendInput (), $ this ->frontendInputs )) {
55
63
return 'AttributeSelectedOptions ' ;
You can’t perform that action at this time.
0 commit comments