Welcome to mirror list, hosted at ThFree Co, Russian Federation.

up_votes_count_resolver.rb « resolvers « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1c78facb6943c433cf7c5a22b66c2d2c8f51ac0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

module Resolvers
  class UpVotesCountResolver < BaseResolver
    include Gitlab::Graphql::Authorize::AuthorizeResource
    include BatchLoaders::AwardEmojiVotesBatchLoader

    type GraphQL::Types::Int, null: true

    def resolve
      authorize!(object)
      load_votes(object, AwardEmoji::UPVOTE_NAME)
    end
  end
end