Update user's standard attributes
Overview
To update the user's standard attributes:
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 user node id
Follow the document here to generate the user node id.
Fetch the user's standard attributes by query
The query:
query {
node(id: "<BASE64URL_ENCODED_USER_NODE_ID>") {
... on User {
standardAttributes
}
}
}The sample response:
Update the user's standard attributes by mutation
Make sure to copy the original standard attributes as any attributes that are missing in the payload will be deleted. Next, change the values for attributes that you want to update.
The query:
The variables:
The sample variables:
The sample response:
Updating Custom Attributes
To learn how to update a user's custom attributes, see the update custom attribute example.
Last updated
Was this helpful?