User Details

Viewer#

To get the authenticated user's data, you can call the viewer query:

query {
viewer {
id
fullName
}
}
// returns
{
"data": {
"viewer": {
"id": "21",
"fullName": "James Edmonston"
}
}
}

Update Viewer#

To update the authenticated user, you can call the updateViewer mutation:

mutation {
updateViewer (
firstName: "Jerry"
lastName: "Jackson"
# also supports custom fields
) {
id
fullName
}
}
// returns
{
"data": {
"updateViewer": {
"id": "21",
"fullName": "Jerry Jackson"
}
}
}

Update Password#

To update the authenticated user's password, you can call the updatePassword mutation:

mutation {
updatePassword(
currentPassword: "testing123"
newPassword: "testing1234"
confirmPassword: "testing1234"
)
}
// returns
{
"data": {
"updatePassword": "Successfully updated password"
}
}