Skip to main content

userUpdate Mutation

Description

Updates the current user's account information.

mutation userUpdate(
$email: String
$password: String
$firstName: String
$lastName: String
$telephone: String
$organisation: String
$taxNumber: String
$addresses: [AddressInput]
$preferences: JSON
) {
userUpdate(
email: $email
password: $password
firstName: $firstName
lastName: $lastName
telephone: $telephone
organisation: $organisation
taxNumber: $taxNumber
addresses: $addresses
preferences: $preferences
) {
_id
id
firstName
lastName
name
email
telephone
taxNumber
organisation
addresses {
_id
description
firstName
lastName
addressLine1
addressLine2
streetNumber
city
state
stateCode
postCode
country
alpha2
type
}
isSubscribed
preferences {
preferredLanguage
}
}
}

Variables

{
"email": "email@example.com",
"password": "password",
"firstName": "John",
"lastName": "Doe",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber",
"addresses": [
{
"_id": "213033da9a709f8b1c04d726",
"description": "A description",
"firstName": "John",
"lastName": "Doe",
"addressLine1": "addressLine1",
"addressLine2": "addressLine2",
"streetNumber": "streetNumber",
"city": "Montreal",
"state": "Quebec",
"stateCode": "stateCode",
"postCode": "postCode",
"country": "Canada",
"alpha2": "alpha2",
"type": "type"
}
],
"preferences": {}
}

Response

{
"userUpdate": {
"_id": "0cad1d54f245d23a3149e746",
"id": 1.23,
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"telephone": "example",
"taxNumber": "example",
"organisation": "example",
"addresses": [
{
"_id": "3503730d214775d7b3fd8f5a",
"description": "example",
"firstName": "example",
"lastName": "example",
"addressLine1": "example",
"addressLine2": "example",
"streetNumber": "example",
"city": "example",
"state": "example",
"stateCode": "example",
"postCode": "example",
"country": "example",
"alpha2": "example",
"type": "example"
}
],
"isSubscribed": true,
"preferences": {
"preferredLanguage": "example"
}
}
}

Arguments

NameTypeDescription
emailStringNew email address.
passwordStringNew password.
firstNameStringUpdated first name.
lastNameStringUpdated last name.
telephoneStringUpdated telephone number.
organisationStringUpdated organization name.
taxNumberStringUpdated tax identification number.
addresses[AddressInput]Updated addresses.
preferencesJSONUpdated preferences in JSON format.

Returns

User