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": "3d85a4ba6197f0cd41774581",
"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": "fe5f96ba9a50140849f82e94",
"id": 1.23,
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"telephone": "example",
"taxNumber": "example",
"organisation": "example",
"addresses": [
{
"_id": "f35d534e0b13757ae084a86d",
"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
| Name | Type | Description |
|---|---|---|
email | String | New email address. |
password | String | New password. |
firstName | String | Updated first name. |
lastName | String | Updated last name. |
telephone | String | Updated telephone number. |
organisation | String | Updated organization name. |
taxNumber | String | Updated tax identification number. |
addresses | [AddressInput] | Updated addresses. |
preferences | JSON | Updated preferences in JSON format. |