Class: Mutations::Labels::Create
- Inherits:
-
BaseMutation
- Object
- GraphQL::Schema::RelayClassicMutation
- BaseMutation
- Mutations::Labels::Create
- Includes:
- ResolvesResourceParent
- Defined in:
- app/graphql/mutations/labels/create.rb
Constant Summary
Constants inherited from BaseMutation
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 ResolvesResourceParent
Methods included from ResolvesProject
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?, #find_object, #raise_resource_not_available_error!
Instance Method Details
#resolve(args) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 |
# File 'app/graphql/mutations/labels/create.rb', line 37 def resolve(args) parent = (args) parent_key = parent.is_a?(Project) ? :project : :group label = ::Labels::CreateService.new(args).execute(parent_key => parent) { label: label.persisted? ? label : nil, errors: errors_on_object(label) } end |