Add New Tier
Create a new tier level in the gamification system (Admin only)
Add New Tier
ADMIN
Create new tier levels for user progression
Admin Access Required
This mutation is accessible only to users with ADMIN privileges. Unauthorized access will be denied.
Overview
The addNewUserTier mutation allows administrators to create new tier levels in the gamification system. Define tier names, point requirements, and visual badges to expand the progression ladder.
GraphQL Schema
addNewUserTier(
level: Int!
name: String!
point: Float!
svg: String!
): TierParameters
levelUnique identifier for the tier (e.g., 1, 2, 3). Must not conflict with existing tiers.
nameDisplay name for the tier (e.g., "Bronze", "Silver", "Gold").
pointMinimum points needed to reach this tier (e.g., 1000.0).
svgSVG markup for the tier badge icon (e.g., "<svg>...</svg>").
Return Type
type Tier {
level: Int!
name: String
point: Float
svg: String
}Example Mutation
Creating Bronze Tier
mutation {
addNewUserTier(
level: 1
name: "Bronze"
point: 1000.0
svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='#CD7F32' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/></svg>"
) {
level
name
point
svg
}
}Example Response
{
"data": {
"addNewUserTier": {
"level": 1,
"name": "Bronze",
"point": 1000,
"svg": "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='#CD7F32' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/></svg>"
}
}
}Complete Tier Examples
level: 1 | name: "Bronze" | point: 1000.0
level: 2 | name: "Silver" | point: 5000.0
level: 3 | name: "Gold" | point: 15000.0
level: 4 | name: "Platinum" | point: 50000.0
level: 5 | name: "Diamond" | point: 150000.0
Use Cases
Create the complete tier structure when launching your gamification system
Add higher tiers as your user base grows and engagement increases
Create limited-time special tiers for events and promotions
Add premium tiers to recognize and reward your most engaged users
Best Practices
Ensure each tier requires significantly more points than the previous one to create meaningful progression (e.g., 1000, 5000, 15000, 50000)
Use consistent SVG dimensions and styling across all tier badges for uniform display (recommended: 24x24 viewBox)
Maintain sequential level numbers without gaps to simplify tier logic and user understanding
Check for level conflicts with getUserTiers before creating new tiers to prevent duplication errors
Choose tier names that convey prestige and achievement (Bronze, Silver, Gold, Platinum, Diamond)
Implementation Example
// Define tier structure
const tiers = [
{ level: 1, name: "Bronze", point: 1000, color: "#CD7F32" },
{ level: 2, name: "Silver", point: 5000, color: "#C0C0C0" },
{ level: 3, name: "Gold", point: 15000, color: "#FFD700" },
{ level: 4, name: "Platinum", point: 50000, color: "#E5E4E2" },
{ level: 5, name: "Diamond", point: 150000, color: "#B9F2FF" }
];
// Generate SVG badge
const createBadgeSVG = (color: string) => {
return `<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'>
<path fill='${color}' d='M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z'/>
</svg>`;
};
// Create each tier
for (const tier of tiers) {
const { data } = await client.mutate({
mutation: gql`
mutation AddTier($level: Int!, $name: String!, $point: Float!, $svg: String!) {
addNewUserTier(
level: $level
name: $name
point: $point
svg: $svg
) {
level
name
point
}
}
`,
variables: {
level: tier.level,
name: tier.name,
point: tier.point,
svg: createBadgeSVG(tier.color)
}
});
console.log(`Created tier: ${data.addNewUserTier.name}`);
}Error Handling
Attempting to create a tier with an existing level number will fail. Check existing tiers first.
Malformed SVG markup may cause rendering issues. Validate SVG syntax before submission.
Non-admin users will receive an authorization error. Ensure proper role verification.
Related Operations
User Tier Overview
Learn about tier types and structures
Get User Tiers
Retrieve all tier configurations
Update User Tier
Modify tier configuration (Admin)
Delete User Tier
Remove tier level (Admin)
Admin Operation
Only administrators can create new tiers. This operation affects the entire gamification system structure.