Fetch the user's original standard attributes by query first.
Change the attributes payload and update the user's standard attributes by mutation.
API Details
Generate the node ID for fetching the user object
Admin GraphQL API allows you to query different type of objects by using the node query with the node id. The node id is an base64url encoded string with format of <NODE_TYPE>:<ID>.
Copy the original standard attributes, change the attributes that you want to update.
The query:
mutation ($userID: ID!, $standardAttributes: UserStandardAttributes!) {
updateUser(input: {userID: $userID, standardAttributes: $standardAttributes}) {
user {
id
standardAttributes
updatedAt
}
}
}
The variables:
{
"userID": "<BASE64URL_ENCODED_USER_NODE_ID>",
"standardAttributes": {
/* Include all the original standard attributes from the previous response */
/* and change the attributes that you want to update */
/* The attributes that are missing in the payload will be deleted */
}
}