Class: Mutations::Ci::RunnersRegistrationToken::Reset

Inherits:
BaseMutation
  • Object
show all
Defined in:
app/graphql/mutations/ci/runners_registration_token/reset.rb

Constant Summary collapse

ScopeID =
::GraphQL::Types::ID

Constants inherited from BaseMutation

BaseMutation::ERROR_MESSAGE

Constants included from Gitlab::Graphql::Authorize::AuthorizeResource

Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR

Instance Method Summary collapse

Methods inherited from BaseMutation

#api_user?, authorization, authorized?, authorizes_object?, #current_user, #errors_on_object, #load_application_object, #read_only?, #ready?, #unauthorized_object

Methods included from Gitlab::Graphql::Authorize::AuthorizeResource

#authorize!, #authorized_find!, #authorized_resource?, #raise_resource_not_available_error!

Instance Method Details

#resolve(type:, id: nil) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'app/graphql/mutations/ci/runners_registration_token/reset.rb', line 26

def resolve(type:, id: nil)
  scope = authorized_find!(type: type, id: id)
  new_token = reset_token(scope)

  {
    token: new_token,
    errors: errors_on_object(scope)
  }
end