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: 'Emoji name.'
field :description,
GraphQL::Types::String,
null: false,
description: 'Emoji description.'
field :unicode,
GraphQL::Types::String,
null: false,
description: 'Emoji in Unicode.'
field :emoji,
GraphQL::Types::String,
null: false,
description: 'Emoji as an icon.'
field :unicode_version,
GraphQL::Types::String,
null: false,
description: 'Unicode version for this emoji.'
field :user,
Types::UserType,
null: false,
description: 'User who awarded the emoji.'
def user
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find
end
end
end
end
|