NYYU Logo
APIAvatar

Get Avatar By Name

Retrieve avatar profiles by unique surname

Get Avatar By Name

Search and retrieve avatar profiles using surname identifiers

Query

🔍
getAvatarByName
Retrieve an avatar profile by surname

Schema

getAvatarByName(
  surname: String!
): AvatarProfile

Parameters

surnameRequired
Type: String!
The unique surname of the avatar profile to retrieve

Return Value

📦
Returns AvatarProfile Object

The query returns an AvatarProfile object that corresponds to the specified surname

Example

💻
Usage Example
Searching for an avatar by surname
query {
  getAvatarByName(surname: "Tesla") {
    id
    fname
    surname
    hairColor
    details
    skillSet {
      id
      name
      rate
    }
    avatarSet {
      id
      groupId
      compId
    }
    factsSet {
      id
      topic
      detail
    }
    regDate
    updateDate
  }
}

Response Example

📤
Sample Response
Example of returned data when searching for "Tesla"
{
  "data": {
    "getAvatarByName": {
      "id": 123,
      "fname": "Nicola",
      "surname": "Tesla",
      "hairColor": "Black",
      "details": "A visionary inventor known for contributions to AC electricity",
      "skillSet": [
        {
          "id": 1,
          "name": "Inventing",
          "rate": 5
        }
      ],
      "avatarSet": [
        {
          "id": 10,
          "groupId": "engineers",
          "compId": 101
        }
      ],
      "factsSet": [
        {
          "id": 1,
          "topic": "Achievements",
          "detail": "Developed the modern AC electricity supply system"
        }
      ],
      "regDate": 1625247600000.0,
      "updateDate": 1625334000000.0
    }
  }
}

Use Cases

🔎
Name Search

Enable users to search for avatars by surname in search interfaces

📇
Directory Lookup

Build avatar directories and browsing features organized by name

🎭
Character Selection

Allow users to select predefined avatar characters by name

🔗
Profile Linking

Link to avatar profiles using human-readable surname identifiers

Important Notes

⚠️
Uniqueness Requirement
Important considerations when querying by surname
Unique Surnames

Each avatar profile should have a unique surname for this query to work correctly

Case Sensitivity

The surname search may be case-sensitive depending on backend implementation

Null Response

Returns null if no avatar profile matches the provided surname

💡
Best Practice
For searching by ID, use getAvatar query instead for guaranteed uniqueness