Skip to content

Delete Role (GraphQL)

Deletes a role and returns a snapshot of the record that was removed, so you can confirm exactly what was deleted. The role no longer appears in the listing afterward.

Operation

OperationTypePurpose
deleteAdminSettingsRoleMutationDelete a role

Quirks

  • input.id is the IRI form (/api/admin/settings/roles/{id}).
  • The mutation returns a snapshot of the just-deleted role — id, _id, name, description, permissionType, and permissions all resolve (a role with permissionType: all has permissions: null). The record itself is gone from the store.
  • message carries the success confirmation (Role deleted successfully.). It resolves only on the delete result — it is null on list / detail / create / update.

Guards

Deletion is refused (returns an errors[] message) when:

  • The role is assigned to one or more admins — reassign those admins to a different role first.
  • It is the last remaining role — at least one role must always exist.

TIP

All operations require an admin Bearer token — see Authentication.

Released under the MIT License.