2019-06-21 04:45:27 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
module AwardEmojis
|
|
|
|
class AwardEmojiType < BaseObject
|
|
|
|
graphql_name 'AwardEmoji'
|
2020-09-16 06:09:24 +00:00
|
|
|
description 'An emoji awarded by a user'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
authorize :read_emoji
|
|
|
|
|
|
|
|
present_using AwardEmojiPresenter
|
|
|
|
|
|
|
|
field :name,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
null: false,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'The emoji name.'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
field :description,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
null: false,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'The emoji description.'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
field :unicode,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
null: false,
|
2021-02-02 12:10:15 +00:00
|
|
|
description: 'The emoji in Unicode.'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
field :emoji,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
null: false,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'The emoji as an icon.'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
field :unicode_version,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
null: false,
|
2021-02-02 12:10:15 +00:00
|
|
|
description: 'The Unicode version for this emoji.'
|
2019-06-21 04:45:27 +00:00
|
|
|
|
|
|
|
field :user,
|
|
|
|
Types::UserType,
|
|
|
|
null: false,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'The user who awarded the emoji.'
|
2020-12-01 12:09:17 +00:00
|
|
|
|
|
|
|
def user
|
|
|
|
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.user_id).find
|
|
|
|
end
|
2019-06-21 04:45:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|