Class: Mutations::Achievements::Revoke
- Inherits:
-
BaseMutation
- Object
- GraphQL::Schema::RelayClassicMutation
- BaseMutation
- Mutations::Achievements::Revoke
- Defined in:
- app/graphql/mutations/achievements/revoke.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?, #raise_resource_not_available_error!
Methods inherited from BaseMutation
#api_user?, authorization, authorized?, authorizes_object?, #current_user, #errors_on_object, #load_application_object, #read_only?, #ready?, #unauthorized_object
Instance Method Details
#find_object(id:) ⇒ Object
28 29 30 |
# File 'app/graphql/mutations/achievements/revoke.rb', line 28 def find_object(id:) GitlabSchema.object_from_id(id, expected_type: ::Achievements::UserAchievement) end |
#resolve(args) ⇒ Object
21 22 23 24 25 26 |
# File 'app/graphql/mutations/achievements/revoke.rb', line 21 def resolve(args) user_achievement = (id: args[:user_achievement_id]) result = ::Achievements::RevokeService.new(current_user, user_achievement).execute { user_achievement: result.payload, errors: result.errors } end |