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

award_emoji_type.rb « award_emojis « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1f6f0badcac664491d69c9e1c5c9a7cedd85166d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# frozen_string_literal: true

module Types
  module AwardEmojis
    class AwardEmojiType < BaseObject
      graphql_name 'AwardEmoji'
      description 'An emoji awarded by a user'

      authorize :read_emoji

      present_using AwardEmojiPresenter

      field :name,
            GraphQL::Types::String,
            null: false,
            description: 'The emoji name.'

      field :description,
            GraphQL::Types::String,
            null: false,
            description: 'The emoji description.'

      field :unicode,
            GraphQL::Types::String,
            null: false,
            description: 'The emoji in Unicode.'

      field :emoji,
            GraphQL::Types::String,
            null: false,
            description: 'The emoji as an icon.'

      field :unicode_version,
            GraphQL::Types::String,
            null: false,
            description: 'The Unicode version for this emoji.'

      field :user,
            Types::UserType,
            null: false,
            description: 'The user who awarded the emoji.'

      def user
        Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find
      end
    end
  end
end