Added in 24.3.
Learn about how an administrator can revoke a badge.
In this guide, you will learn how a badge can be revoked.
Note: Only Administrators can revoke a badge granted to the members.
In this example, as an administrator, you want to revoke the badge (ID: 199) granted to the user (ID: 4).
Here is the GraphQL mutation and the variables to revoke a badge.
Mutation
mutation revokeBadge($badgeId: ID!, $userId: ID!) {
revokeBadge(badgeId: $badgeId, userId: $userId) {
result
errors {
... on Error {
message
fields
}
}
}
}
Variables
{
"userId": "user:4",
"badgeId": "badge:199"
}
Response
{
"data": {
"revokeBadge": {
"result": true,
"errors": null
}
}
}
Re-grant the badge
In this section, you will learn how to re-grant the revoked badge.
Note: Only administrators can regrant the revoked badge.
Here is the GraphQL mutation to regrant the badge (ID: 199) to the user (ID: 4).
Mutation
mutation reGrantBadge($badgeId: ID!, $userId: ID!) {
reGrantBadge(badgeId: $badgeId, userId: $userId) {
result
errors {
... on Error {
message
fields
}
}
}
}
Variables
{
"userId": "user:4",
"badgeId": "badge:199"
}
Response
{
"data": {
"revokeBadge": {
"result": true,
"errors": null
}
}
}
ATLAS
Comments