PHP 7.3 reaches end of support in December 2021 and Adobe Commerce 2.3.x reaches end of support in April 2022. We strongly recommend planning your upgrade now to Adobe Commerce 2.4.x and PHP 7.4.x to help maintain PCI compliance.

revokeCustomerToken mutation

Use the revokeCustomerToken mutation to revokes the customer’s token.

To return or modify information about a customer, Magento recommends you use customer tokens in the header of your GraphQL calls. However, you also can use session authentication.

Syntax

1
2
3
4
5
mutation {
  revokeCustomerToken {
    RevokeCustomerTokenOutput
  }
}

Example usage

The following call revokes the customer’s token.

Request:

1
2
3
4
5
mutation {
  revokeCustomerToken {
    result
  }
}

Response:

1
2
3
4
5
6
7
{
  "data": {
    "revokeCustomerToken": {
      "result": true
    }
  }
}

Output attributes

Attribute Data Type Description
result Boolean! Returns true if the token was successfully revoked

Errors

Error Description
The current customer isn't authorized. The current customer is not currently logged in, or the customer’s token does not exist in the oauth_token table.