6
6
7
7
namespace Magento \CustomerGraphQl \Model \Resolver ;
8
8
9
+ use Magento \Authorization \Model \UserContextInterface ;
10
+ use Magento \CustomerGraphQl \Model \Resolver \Customer \CustomerDataProvider ;
9
11
use Magento \Framework \Exception \NoSuchEntityException ;
10
12
use Magento \Framework \GraphQl \Exception \GraphQlAuthorizationException ;
11
13
use Magento \Framework \GraphQl \Exception \GraphQlNoSuchEntityException ;
12
14
use Magento \GraphQl \Model \ResolverInterface ;
13
- use Magento \Framework \GraphQl \Exception \GraphQlInputException ;
14
15
use Magento \GraphQl \Model \ResolverContextInterface ;
15
16
16
17
/**
@@ -24,10 +25,10 @@ class Customer implements ResolverInterface
24
25
private $ customerResolver ;
25
26
26
27
/**
27
- * @param \Magento\CustomerGraphQl\Model\Resolver\Customer\ CustomerDataProvider $customerResolver
28
+ * @param CustomerDataProvider $customerResolver
28
29
*/
29
30
public function __construct (
30
- \ Magento \ CustomerGraphQl \ Model \ Resolver \ Customer \ CustomerDataProvider $ customerResolver
31
+ CustomerDataProvider $ customerResolver
31
32
) {
32
33
$ this ->customerResolver = $ customerResolver ;
33
34
}
@@ -37,7 +38,7 @@ public function __construct(
37
38
*/
38
39
public function resolve (array $ args , ResolverContextInterface $ context )
39
40
{
40
- if ((!$ context ->getUserId ()) || $ context ->getUserType () == 4 ) {
41
+ if ((!$ context ->getUserId ()) || $ context ->getUserType () == UserContextInterface:: USER_TYPE_GUEST ) {
41
42
throw new GraphQlAuthorizationException (
42
43
__ (
43
44
'Current customer does not have access to the resource "%1" ' ,
0 commit comments