File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
app/code/Magento/CustomerGraphQl Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,10 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
49
49
{
50
50
$ customerSession = $ this ->customerSession ;
51
51
$ customerGroupId = null ;
52
+ $ extensionAttributes = $ contextParameters ->getExtensionAttributesData ();
52
53
if ($ contextParameters ->getUserType () === UserContextInterface::USER_TYPE_GUEST ) {
53
54
$ customerGroupId = Group::NOT_LOGGED_IN_ID ;
54
- } elseif ($ contextParameters -> getExtensionAttributes ()-> getIsCustomer () === true ) {
55
+ } elseif (! empty ( $ extensionAttributes ) && $ extensionAttributes [ ' is_customer ' ] === true ) {
55
56
try {
56
57
$ customer = $ this ->customerRepository ->getById ($ contextParameters ->getUserId ());
57
58
$ customerGroupId = (int ) $ customer ->getGroupId ();
@@ -61,7 +62,7 @@ public function execute(ContextParametersInterface $contextParameters): ContextP
61
62
}
62
63
if ($ customerGroupId !== null ) {
63
64
$ customerSession ->setCustomerGroupId ($ customerGroupId );
64
- $ contextParameters ->addExtensionAttribute ('customer_group ' , (int ) $ customerGroupId );
65
+ $ contextParameters ->addExtensionAttribute ('id_customer_group ' , (int ) $ customerGroupId );
65
66
}
66
67
return $ contextParameters ;
67
68
}
Original file line number Diff line number Diff line change 9
9
<extension_attributes for =" Magento\GraphQl\Model\Query\ContextInterface" >
10
10
<attribute code =" is_customer" type =" boolean" />
11
11
<attribute code =" id_customer_group" type =" integer" />
12
- <attribute code =" customer_group" type =" integer" />
13
12
</extension_attributes >
14
13
</config >
You can’t perform that action at this time.
0 commit comments