NYYU Logo
APIAvatar

Create Avatar Component

Create new avatar components with admin privileges

Create Avatar Component

Add new customizable components to your avatar system

🔐
Admin Access Required

This mutation is accessible only to users with ADMIN privileges

Mutation

createNewComponent
Create a new avatar component with specified attributes

Schema

createNewComponent(
  groupId: String!
  tierLevel: Int!
  price: Float!
  limited: Int!
  svg: String!
  width: Int!
  top: Int!
  left: Int!
): AvatarComponent

Parameters

groupIdRequired
Type: String!
The category name for this component (e.g., "hats", "accessories", "facial_features")
tierLevelRequired
Type: Int!
Minimum user tier level required to purchase this component
priceRequired
Type: Float!
Cost in NDB tokens to purchase this component
limitedRequired
Type: Int!
Maximum number of this component that can be sold (scarcity control)
svgRequired
Type: String!
SVG content of the component for scalable vector rendering
widthRequired
Type: Int!
Width percentage of the avatar for component sizing
topRequired
Type: Int!
Top margin for positioning the component on the avatar
leftRequired
Type: Int!
Left margin for positioning the component on the avatar

Return Value

📦
Returns AvatarComponent Object

The mutation returns the newly created AvatarComponent if successful, otherwise null

Example

💻
Usage Example
Creating a limited edition hat component
mutation {
  createNewComponent(
    groupId: "hats"
    tierLevel: 3
    price: 10.0
    limited: 50
    svg: "<svg>...</svg>"
    width: 30
    top: 5
    left: 10
  ) {
    id
    groupId
    compId
    tierLevel
    price
    limited
    purchased
    svg
    width
    top
    left
  }
}

Component Categories

🎨
Common GroupId Values
Popular component categories
hats
Headwear accessories
hairColor
Hair color variants
facial_features
Eyes, nose, mouth
accessories
Glasses, jewelry
clothing
Outfits and shirts
backgrounds
Avatar backgrounds
💡
Best Practices
Use consistent positioning values for components in the same category and test SVG rendering at multiple sizes