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: fe7affa50ccac67c651bb88f62655d709bc028cc (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
# 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::STRING_TYPE,
            null: false,
            description: 'The emoji name'

      field :description,
            GraphQL::STRING_TYPE,
            null: false,
            description: 'The emoji description'

      field :unicode,
            GraphQL::STRING_TYPE,
            null: false,
            description: 'The emoji in unicode'

      field :emoji,
            GraphQL::STRING_TYPE,
            null: false,
            description: 'The emoji as an icon'

      field :unicode_version,
            GraphQL::STRING_TYPE,
            null: false,
            description: 'The unicode version for this emoji'

      field :user,
            Types::UserType,
            null: false,
            description: 'The user who awarded the emoji',
            resolve: -> (award_emoji, _args, _context) {
              Gitlab::Graphql::Loaders::BatchModelLoader.new(User, award_emoji.user_id).find
            }
    end
  end
end