NYYU Logo
APIAvatar

Update Avatar Profile

Update existing avatar profile attributes and metadata

Update Avatar Profile

Modify avatar profile details, skills, and components

🔐
Admin Access Required

This mutation is accessible only to users with ADMIN privileges

Mutation

✏️
updateAvatarProfile
Update an existing avatar profile's attributes

Schema

updateAvatarProfile(
  id: Int!
  fname: String
  surname: String
  skillSet: [SkillSetInput]
  avatarSet: [AvatarSetInput]
  factsSet: [FactsInput]
  hairColor: String
  details: String
): Boolean

Parameters

idRequired
Type: Int!
The unique ID of the avatar profile to update
fnameOptional
Type: String
The first name of the avatar
surnameOptional
Type: String
The surname of the avatar
skillSetOptional
Type: [SkillSetInput]
The skill set of the avatar (name and rate)
avatarSetOptional
Type: [AvatarSetInput]
The avatar component set (groupId and compId)
factsSetOptional
Type: [FactsInput]
Facts set related to the avatar (topic and detail)
hairColorOptional
Type: String
The hair color of the avatar
detailsOptional
Type: String
Additional details about the avatar

Return Value

Returns Boolean
true - Update was successful
false - Update failed

Example

💻
Usage Example
Updating an avatar profile with new skills and details
mutation {
  updateAvatarProfile(
    id: 123
    fname: "Nicola"
    surname: "Tesla"
    skillSet: [
      { name: "Inventing", rate: 5 }
      { name: "Electrical Engineering", rate: 5 }
      { name: "Physics", rate: 4 }
    ]
    avatarSet: [
      { groupId: "engineers", compId: 101 }
      { groupId: "hats", compId: 5 }
    ]
    factsSet: [
      {
        topic: "Achievements"
        detail: "Developed the modern AC electricity supply system"
      }
      {
        topic: "Legacy"
        detail: "Over 300 patents worldwide"
      }
    ]
    hairColor: "Black"
    details: "A visionary inventor and electrical engineer who revolutionized modern electricity."
  )
}

Update Behavior

🔄
Partial Updates Supported
You can update specific fields without affecting others
Selective Updates

Only provide the fields you want to update; other fields remain unchanged

Array Replacement

Skills, facts, and avatar sets are replaced entirely when updated (not merged)

Automatic Timestamps

The updateDate field is automatically updated

Use Cases

📝
Profile Enhancement

Add new skills, facts, or components to enrich avatar profiles

🔧
Corrections

Fix errors or update outdated information in existing profiles

🎨
Visual Updates

Change avatar appearance by updating components or hair color

Skill Adjustments

Update skill ratings or add new skills as avatar evolves

💡
Important Note
Arrays (skillSet, avatarSet, factsSet) are replaced completely when updated. Include all items you want to keep.