Skip to main content

register Mutation

Description

Registers a new user account.

mutation register(
$email: String!
$password: String!
$firstName: String!
$lastName: String!
$telephone: String
$organisation: String
$taxNumber: String
$withVerificationCode: Boolean
$addresses: [AddressInput!]
) {
register(
email: $email
password: $password
firstName: $firstName
lastName: $lastName
telephone: $telephone
organisation: $organisation
taxNumber: $taxNumber
withVerificationCode: $withVerificationCode
addresses: $addresses
) {
user {
_id
id
firstName
lastName
name
email
telephone
taxNumber
organisation
isSubscribed
}
session {
_id
jwt
expires
}
message
}
}

Variables

{
"email": "email@example.com",
"password": "password",
"firstName": "John",
"lastName": "Doe",
"telephone": "telephone",
"organisation": "organisation",
"taxNumber": "taxNumber",
"withVerificationCode": true,
"addresses": [
{
"_id": "be950229f9027624408247d5",
"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"
}
]
}

Response

{
"register": {
"user": {
"_id": "2897d4fbb55e20a2ba5bb0b4",
"id": 1.23,
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"telephone": "example",
"taxNumber": "example",
"organisation": "example",
"isSubscribed": true
},
"session": {
"_id": "32284ca3b70c9174d357d9dc",
"jwt": "example",
"expires": 1734525888615
},
"message": "example"
}
}

Arguments

NameTypeDescription
emailString!Email address for the account.
passwordString!Password for the account.
firstNameString!User's first name.
lastNameString!User's last name.
telephoneStringTelephone number.
organisationStringOrganization or company name.
taxNumberStringTax identification number.
withVerificationCodeBooleanWhether to send a verification code via email.
addresses[AddressInput!]Initial addresses for the user.

Returns

RegisterResponse