Class: Mutations::Namespace::PackageSettings::Update

Inherits:
BaseMutation
  • Object
show all
Includes:
ResolvesNamespace
Defined in:
app/graphql/mutations/namespace/package_settings/update.rb

Constant Summary

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 included from ResolvesNamespace

#namespace_resolver, #resolve_namespace

Methods inherited from BaseMutation

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

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

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

Instance Method Details

#resolve(namespace_path:, **args) ⇒ Object


43
44
45
46
47
48
49
50
51
52
53
54
# File 'app/graphql/mutations/namespace/package_settings/update.rb', line 43

def resolve(namespace_path:, **args)
  namespace = authorized_find!(namespace_path: namespace_path)

  result = ::Namespaces::PackageSettings::UpdateService
    .new(container: namespace, current_user: current_user, params: args)
    .execute

  {
    package_settings: result.payload[:package_settings],
    errors: result.errors
  }
end