Class: Mutations::DependencyProxy::ImageTtlGroupPolicy::Update

Inherits:
BaseMutation
  • Object
show all
Includes:
ResolvesGroup
Defined in:
app/graphql/mutations/dependency_proxy/image_ttl_group_policy/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 ResolvesGroup

#group_resolver, #resolve_group

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(group_path:, **args) ⇒ Object



39
40
41
42
43
44
45
46
47
48
49
50
# File 'app/graphql/mutations/dependency_proxy/image_ttl_group_policy/update.rb', line 39

def resolve(group_path:, **args)
  group = authorized_find!(group_path: group_path)

  result = ::DependencyProxy::ImageTtlGroupPolicies::UpdateService
    .new(container: group, current_user: current_user, params: args)
    .execute

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