Class: Mutations::Achievements::Create
- Inherits:
-
BaseMutation
- Object
- GraphQL::Schema::RelayClassicMutation
- BaseMutation
- Mutations::Achievements::Create
- Defined in:
- app/graphql/mutations/achievements/create.rb
Constant Summary
Constants included from Gitlab::Graphql::Authorize::AuthorizeResource
Gitlab::Graphql::Authorize::AuthorizeResource::ConfigurationError, Gitlab::Graphql::Authorize::AuthorizeResource::RESOURCE_ACCESS_ERROR
Constants inherited from BaseMutation
Instance Method Summary collapse
Methods included from Gitlab::Graphql::Authorize::AuthorizeResource
#authorize!, #authorized_find!, #authorized_resource?, #find_object, #raise_resource_not_available_error!
Methods inherited from BaseMutation
#api_user?, authorization, authorization_scopes, authorized?, authorizes_object?, #current_user, #errors_on_object, #load_application_object, #read_only?, #ready?, #unauthorized_object
Instance Method Details
#resolve(args) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 |
# File 'app/graphql/mutations/achievements/create.rb', line 33 def resolve(args) namespace = (id: args[:namespace_id]) raise Gitlab::Graphql::Errors::ResourceNotAvailable, '`achievements` feature flag is disabled.' \ if Feature.disabled?(:achievements, namespace) result = ::Achievements::CreateService.new(namespace: namespace, current_user: current_user, params: args).execute { achievement: result.payload, errors: result.errors } end |