NYYU Logo
APIAvatar

Get Components By Group

Retrieve all avatar components within a specific category

Get Components By Group

Retrieve all avatar components within a specific group category

Query

📂
getAvatarComponentsByGroup
Retrieve all components in a specific category

Schema

getAvatarComponentsByGroup(
  groupId: String!
): [AvatarComponent]

Parameters

groupIdRequired
Type: String!
The name of the required components group (e.g., "hats", "accessories", "clothing")

Return Value

📦
Returns Array of AvatarComponent Objects

The query returns a list of all AvatarComponent objects belonging to the specified group

Common Group IDs

🎨
Popular Component Categories
Common groupId values
hats
Headwear and hats
hairColor
Hair color options
facial_features
Eyes, nose, mouth
accessories
Glasses, jewelry
clothing
Outfits and shirts
backgrounds
Avatar backgrounds

Example

💻
Usage Example
Retrieving all hat components
query {
  getAvatarComponentsByGroup(groupId: "hats") {
    groupId
    compId
    tierLevel
    price
    limited
    purchased
    svg
    width
    top
    left
  }
}

Response Example

📤
Sample Response
Example of returned hat components
{
  "data": {
    "getAvatarComponentsByGroup": [
      {
        "groupId": "hats",
        "compId": 1,
        "tierLevel": 1,
        "price": 5.0,
        "limited": 100,
        "purchased": 45,
        "svg": "<svg>...</svg>",
        "width": 30,
        "top": 5,
        "left": 10
      },
      {
        "groupId": "hats",
        "compId": 2,
        "tierLevel": 2,
        "price": 10.0,
        "limited": 50,
        "purchased": 12,
        "svg": "<svg>...</svg>",
        "width": 35,
        "top": 3,
        "left": 8
      },
      {
        "groupId": "hats",
        "compId": 3,
        "tierLevel": 3,
        "price": 20.0,
        "limited": 25,
        "purchased": 8,
        "svg": "<svg>...</svg>",
        "width": 32,
        "top": 6,
        "left": 12
      }
    ]
  }
}

Use Cases

🛍️
Category Browsing

Display all available components in a specific category for shopping

🎨
Customization UI

Build category-based navigation in avatar customization tools

📊
Category Analytics

Analyze component availability and sales within categories

🔄
Component Swapping

Allow users to switch between components in the same category

Filtering Tips

🔧
Client-Side Filtering
Common filtering patterns after fetching
By Tier Level

Show only components accessible to user's tier

By Availability

Filter where purchased < limited

By Price Range

Filter components within budget

Sort by Popularity

Order by purchased count

Typical Workflow

📝
Category-Based Customization
Step-by-step user flow
1
Select Category

User clicks on "Hats" category in avatar builder

2
Fetch Components

Query getAvatarComponentsByGroup(groupId: "hats")

3
Display Options

Show all hats with pricing, tier requirements, and availability

4
User Selection

User selects desired hat component for their avatar

💡
Best Practice
Cache category results to minimize API calls when users browse between different categories