1010use Magento \Authorization \Model \UserContextInterface ;
1111use Magento \Framework \GraphQl \Config \Element \Field ;
1212use Magento \Framework \GraphQl \Exception \GraphQlAuthorizationException ;
13- use Magento \Framework \GraphQl \Query \Resolver \Value ;
14- use Magento \Framework \GraphQl \Query \Resolver \ValueFactory ;
1513use Magento \Framework \GraphQl \Query \ResolverInterface ;
1614use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
1715use Magento \Integration \Api \CustomerTokenServiceInterface ;
@@ -31,24 +29,16 @@ class RevokeCustomerToken implements ResolverInterface
3129 */
3230 private $ customerTokenService ;
3331
34- /**
35- * @var ValueFactory
36- */
37- private $ valueFactory ;
38-
3932 /**
4033 * @param UserContextInterface $userContext
4134 * @param CustomerTokenServiceInterface $customerTokenService
42- * @param ValueFactory $valueFactory
4335 */
4436 public function __construct (
4537 UserContextInterface $ userContext ,
46- CustomerTokenServiceInterface $ customerTokenService ,
47- ValueFactory $ valueFactory
38+ CustomerTokenServiceInterface $ customerTokenService
4839 ) {
4940 $ this ->userContext = $ userContext ;
5041 $ this ->customerTokenService = $ customerTokenService ;
51- $ this ->valueFactory = $ valueFactory ;
5242 }
5343
5444 /**
@@ -60,9 +50,8 @@ public function resolve(
6050 ResolveInfo $ info ,
6151 array $ value = null ,
6252 array $ args = null
63- ): Value {
64-
65- $ customerId = (int ) $ this ->userContext ->getUserId ();
53+ ) {
54+ $ customerId = (int )$ this ->userContext ->getUserId ();
6655
6756 if ($ customerId === 0 ) {
6857 throw new GraphQlAuthorizationException (
@@ -73,10 +62,6 @@ public function resolve(
7362 );
7463 }
7564
76- $ result = function () use ($ customerId ) {
77- return $ this ->customerTokenService ->revokeCustomerAccessToken ($ customerId );
78- };
79-
80- return $ this ->valueFactory ->create ($ result );
65+ return $ this ->customerTokenService ->revokeCustomerAccessToken ($ customerId );
8166 }
8267}
0 commit comments