This is a beta release of documentation for Magento 2.4, published for previewing soon-to-be-released functionality. Content in this version is subject to change. Links to the v2.4 code base may not properly resolve until the code is officially released.

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

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.