NYYU Logo
APIAvatar

Get Avatar Components By Sets

Retrieve avatar components based on specific component sets

Get Components By Sets

Retrieve avatar components based on a provided component set

Query

🎯
getAvatarComponentsBySet
Retrieve components associated with a specific avatar profile set

Schema

getAvatarComponentsBySet(
  set: [AvatarSetInput]
): [AvatarComponent]

Parameters

setOptional
Type: [AvatarSetInput]
The list of components that the profile has. Each component includes:
groupId (String) - The group ID of the component
compId (Int) - The component ID

Return Value

📦
Returns Array of AvatarComponent Objects

The query returns a list of AvatarComponent objects that match the provided set

Example

💻
Usage Example
Retrieving components for multiple sets
query {
  getAvatarComponentsBySet(
    set: [
      { groupId: "engineers", compId: 101 }
      { groupId: "hats", compId: 5 }
      { groupId: "accessories", compId: 12 }
    ]
  ) {
    groupId
    compId
    tierLevel
    price
    limited
    purchased
    svg
    width
    top
    left
  }
}

Response Example

📤
Sample Response
Example of returned component data
{
  "data": {
    "getAvatarComponentsBySet": [
      {
        "groupId": "engineers",
        "compId": 101,
        "tierLevel": 2,
        "price": 15.0,
        "limited": 100,
        "purchased": 45,
        "svg": "<svg>...</svg>",
        "width": 30,
        "top": 10,
        "left": 15
      },
      {
        "groupId": "hats",
        "compId": 5,
        "tierLevel": 1,
        "price": 8.0,
        "limited": 200,
        "purchased": 78,
        "svg": "<svg>...</svg>",
        "width": 35,
        "top": 5,
        "left": 12
      },
      {
        "groupId": "accessories",
        "compId": 12,
        "tierLevel": 3,
        "price": 20.0,
        "limited": 50,
        "purchased": 23,
        "svg": "<svg>...</svg>",
        "width": 25,
        "top": 18,
        "left": 8
      }
    ]
  }
}

Use Cases

🎨
Avatar Rendering

Retrieve all components needed to render a complete avatar

📊
Profile Analysis

Analyze component combinations used by specific avatars

💎
Value Calculation

Calculate total value of components in an avatar profile

🔍
Component Validation

Verify component existence and availability before assignment

Query Behavior

📋
How It Works
Understanding the query behavior
Batch Lookup

Retrieves full component details for multiple groupId/compId pairs at once

Exact Matching

Only returns components that exactly match the provided groupId and compId combinations

Missing Components

If a component in the set doesn't exist, it's simply excluded from results

Order Preserved

Results typically maintain the order of the input set

Practical Example

🎯
Complete Avatar Workflow
Typical usage pattern
1
Get Avatar Profile

Query getAvatar to retrieve profile with avatarSet field

2
Extract Component References

Pull groupId and compId values from avatarSet array

3
Fetch Full Component Details

Use getAvatarComponentsBySet to get SVG, positioning, and metadata

4
Render Avatar

Use SVG and positioning data to compose the complete avatar visual

💡
Performance Tip
Use this query instead of multiple individual component queries to reduce API calls and improve performance