Delete User Tier
Remove a tier level from the gamification system (Admin only)
Delete User Tier
ADMIN
Remove tier levels from the progression system
Destructive Operation
This mutation permanently removes a tier level. This operation cannot be undone and may affect users currently at this tier.
Overview
The deleteUserTier mutation allows administrators to remove tier levels from the gamification system. Use with extreme caution as this operation is irreversible and impacts user progression structure.
GraphQL Schema
deleteUserTier(
level: Int!
): IntParameters
levelThe unique level identifier of the tier to delete (e.g., 1, 2, 3).
Return Type
IntReturns: The integer value of the deleted tier's level on success.
Example Mutation
mutation {
deleteUserTier(level: 1)
}Example Response
{
"data": {
"deleteUserTier": 1
}
}Critical Warnings
Deleted tiers cannot be recovered. All tier configuration data is permanently lost.
Users currently at this tier will need to be reassigned or may lose tier status.
Deleting middle tiers creates gaps in the progression ladder (e.g., levels 1, 2, 4, 5).
Export tier configuration before deletion if you may need to restore it later.
Safe Deletion Workflow
Check how many users are currently at the tier level you plan to delete
Save tier details (name, points, SVG) in case you need to recreate it
Inform users at this tier about the upcoming change and what it means for them
Decide how users will be reassigned to remaining tiers (nearest lower tier, manual assignment, etc.)
Perform the deletion during low-traffic periods to minimize user disruption
Confirm all users are properly assigned to valid tiers and progression logic still works
Use Cases
Remove excessive tiers to streamline progression and reduce complexity
Remove test or experimental tiers that are no longer needed
Delete obsolete tiers when completely redesigning the progression system
Remove limited-time special tiers after promotional events end
Implementation Example
// Step 1: Fetch and backup tier configuration
const { data: tiers } = await client.query({
query: gql`
query GetTiers {
getUserTiers {
level
name
point
svg
}
}
`
});
const tierToDelete = tiers.getUserTiers.find(t => t.level === 1);
// Create backup
const backup = {
...tierToDelete,
deletedAt: new Date().toISOString()
};
console.log('Tier backup:', JSON.stringify(backup, null, 2));
// Step 2: Validate deletion won't break progression
const validateDeletion = (level: number) => {
const sortedTiers = tiers.getUserTiers.sort((a, b) => a.level - b.level);
const tierIndex = sortedTiers.findIndex(t => t.level === level);
// Don't allow deleting first or last tier
if (tierIndex === 0) {
throw new Error('Cannot delete the lowest tier - users need a baseline tier');
}
if (tierIndex === sortedTiers.length - 1) {
throw new Error('Cannot delete the highest tier - maintain progression cap');
}
return true;
};
// Step 3: Execute deletion with confirmation
try {
validateDeletion(1);
const confirmDelete = confirm(
`โ ๏ธ Delete tier "${tierToDelete.name}" (Level ${tierToDelete.level})?\n\n` +
`This action cannot be undone.\n\n` +
`Click OK to proceed with deletion.`
);
if (!confirmDelete) {
console.log('Deletion cancelled by admin');
return;
}
const { data } = await client.mutate({
mutation: gql`
mutation DeleteTier($level: Int!) {
deleteUserTier(level: $level)
}
`,
variables: {
level: 1
}
});
console.log(`Successfully deleted tier level ${data.deleteUserTier}`);
console.log('Backup available:', backup);
} catch (error) {
console.error('Deletion failed:', error.message);
}Alternative: Disable Instead of Delete
Set the tier's point requirement to an unreachable value (e.g., 999999999) to effectively disable it
If your system supports it, use a 'hidden' or 'disabled' flag instead of deletion
Filter out specific tiers in your application code rather than removing from database
Related Operations
User Tier Overview
Learn about tier types and structures
Get User Tiers
Retrieve all tier configurations
Add New Tier
Create new tier level (Admin)
Update User Tier
Modify tier configuration (Admin)
Permanent Deletion
This operation is irreversible. Always create backups and notify affected users before deleting tier levels. Consider using updateUserTier to disable tiers instead of deletion.