NYYU Logo
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
): AvatarComponent

Parameters

groupIdRequired
Type: String!
The group ID of the component to update
compIdRequired
Type: String!
The unique ID of the component to update
tierLevelOptional
Type: Int
The tier level requirement of the component
priceOptional
Type: Float
The price of the component in NDB tokens
limitedOptional
Type: Int
The limit on number of components available
svgOptional
Type: String
The SVG content of the component
widthOptional
Type: Int
The width percentage of the component
topOptional
Type: Int
The top position of the component
leftOptional
Type: Int
The 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