diff --git a/lib/backend-api/schema.graphql b/lib/backend-api/schema.graphql
index 1ca851e4a04..e07abac007b 100644
--- a/lib/backend-api/schema.graphql
+++ b/lib/backend-api/schema.graphql
@@ -3011,6 +3011,8 @@ type Mutation {
updateUserInfo(input: UpdateUserInfoInput!): UpdateUserInfoPayload
validateUserPassword(input: ValidateUserPasswordInput!): ValidateUserPasswordPayload
generateApiToken(input: GenerateAPITokenInput!): GenerateAPITokenPayload
+
+ """Request To revoke an API token; these start with 'wap_'."""
revokeApiToken(input: RevokeAPITokenInput!): RevokeAPITokenPayload
checkUserExists(input: CheckUserExistsInput!): CheckUserExistsPayload
readNotification(input: ReadNotificationInput!): ReadNotificationPayload
@@ -3656,6 +3658,7 @@ input GenerateAPITokenInput {
clientMutationId: String
}
+"""Request To revoke an API token; these start with 'wap_'."""
type RevokeAPITokenPayload {
token: APIToken
success: Boolean
@@ -3664,7 +3667,7 @@ type RevokeAPITokenPayload {
input RevokeAPITokenInput {
"""The API token ID"""
- tokenId: ID!
+ token: String!
clientMutationId: String
}
diff --git a/lib/backend-api/src/query.rs b/lib/backend-api/src/query.rs
index db0aaccfa16..236e5dd26c5 100644
--- a/lib/backend-api/src/query.rs
+++ b/lib/backend-api/src/query.rs
@@ -15,6 +15,34 @@ use crate::{
GraphQLApiFailure, WasmerClient,
};
+/// Revoke an existing token
+pub async fn revoke_token(
+ client: &WasmerClient,
+ token: String,
+) -> Result