Class: Mutations::Achievements::Award
- Inherits:
-
BaseMutation
- Object
- GraphQL::Schema::RelayClassicMutation
- BaseMutation
- Mutations::Achievements::Award
- Defined in:
- app/graphql/mutations/achievements/award.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
25 26 27 28 29 30 31 |
# File 'app/graphql/mutations/achievements/award.rb', line 25 def resolve(args) achievement = (id: args[:achievement_id]) recipient_id = args[:user_id].model_id result = ::Achievements::AwardService.new(current_user, achievement.id, recipient_id).execute { user_achievement: result.payload, errors: result.errors } end |