Skip to main content

assignUserToRole

Requires permission settings:role:update.

Assigns a user to a role. Returns true on success. Needs settings:role:update.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation AssignUserToRole($input: AssignUserToRoleInput!) {
assignUserToRole(input: $input)
}

Variables:

{
"input": {
"roleId": "id",
"userId": "id"
}
}

Response:

{
"data": {
"assignUserToRole": true
}
}
assignUserToRole(
input: AssignUserToRoleInput!
): Boolean!

Arguments​

assignUserToRole.input ● AssignUserToRoleInput! non-null input​

The user and the role to assign them to.

Type​

Boolean scalar​

The Boolean scalar type represents true or false.