10
10
use Magento \Authorization \Model \UserContextInterface ;
11
11
use Magento \GraphQl \Model \Query \ContextParametersInterface ;
12
12
use Magento \GraphQl \Model \Query \ContextParametersProcessorInterface ;
13
- use Magento \Customer \Api \CustomerRepositoryInterface ;
14
- use Magento \Customer \Api \Data \GroupInterface ;
15
13
16
14
/**
17
15
* @inheritdoc
@@ -23,21 +21,13 @@ class AddUserInfoToContext implements ContextParametersProcessorInterface
23
21
*/
24
22
private $ userContext ;
25
23
26
- /**
27
- * @var CustomerRepositoryInterface
28
- */
29
- private $ customerRepository ;
30
-
31
24
/**
32
25
* @param UserContextInterface $userContext
33
- * @param CustomerRepositoryInterface $customerRepository
34
26
*/
35
27
public function __construct (
36
- UserContextInterface $ userContext ,
37
- CustomerRepositoryInterface $ customerRepository
28
+ UserContextInterface $ userContext
38
29
) {
39
30
$ this ->userContext = $ userContext ;
40
- $ this ->customerRepository = $ customerRepository ;
41
31
}
42
32
43
33
/**
@@ -58,15 +48,6 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
58
48
$ contextParameters ->setUserType ($ currentUserType );
59
49
60
50
$ contextParameters ->addExtensionAttribute ('is_customer ' , $ this ->isCustomer ($ currentUserId , $ currentUserType ));
61
-
62
- try {
63
- $ customerGroupId = $ this ->customerRepository ->getById ($ currentUserId )->getGroupId ();
64
- } catch (\Exception $ e ) {
65
- $ customerGroupId = GroupInterface::NOT_LOGGED_IN_ID ;
66
- }
67
-
68
- $ contextParameters ->addExtensionAttribute ('customer_group_id ' , $ customerGroupId );
69
-
70
51
return $ contextParameters ;
71
52
}
72
53
0 commit comments