APIAvatar
Update Avatar Component
Update existing avatar component attributes and properties
Update Avatar Component
Modify existing avatar component attributes and pricing
🔐
Admin Access Required
This mutation is accessible only to users with ADMIN privileges
Mutation
✏️
updateComponent
Update an existing avatar component's details
Schema
updateComponent(
groupId: String!
compId: String!
tierLevel: Int
price: Float
limited: Int
svg: String
width: Int
top: Int
left: Int
): AvatarComponentParameters
groupIdRequiredType:
String!The group ID of the component to update
compIdRequiredType:
String!The unique ID of the component to update
tierLevelOptionalType:
IntThe tier level requirement of the component
priceOptionalType:
FloatThe price of the component in NDB tokens
limitedOptionalType:
IntThe limit on number of components available
svgOptionalType:
StringThe SVG content of the component
widthOptionalType:
IntThe width percentage of the component
topOptionalType:
IntThe top position of the component
leftOptionalType:
IntThe left position of the component
Return Value
📦
Returns Updated AvatarComponent
The mutation returns the updated AvatarComponent if successful, otherwise null
Example
💻
Usage Example
Updating component pricing and availability
mutation {
updateComponent(
groupId: "hats"
compId: "5"
tierLevel: 2
price: 12.5
limited: 75
svg: "<svg width='100' height='100'>...</svg>"
width: 35
top: 8
left: 12
) {
groupId
compId
tierLevel
price
limited
purchased
svg
width
top
left
}
}Use Cases
💰
Price Adjustments
Update component pricing based on market demand or promotions
📊
Inventory Management
Adjust availability limits for limited edition components
🎨
Visual Updates
Modify SVG content or positioning to improve appearance
🔧
Tier Adjustments
Change tier requirements as game balance evolves
Update Behavior
🔄
Partial Updates Supported
Update specific attributes without affecting others
Selective Updates
Only provide the fields you want to update; other fields remain unchanged
Purchase Count Preserved
The purchased count is not affected by updates
Component Identification
Both groupId and compId are required to identify the component
💡
Best Practice
Test visual changes (SVG, positioning) in a staging environment before applying to production