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

achievement_type.rb « achievements « types « graphql « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 71f51b9b741c93e11df9dae9c25b6fff98b4a323 (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
49
50
51
52
53
54
55
56
# frozen_string_literal: true

module Types
  module Achievements
    class AchievementType < BaseObject
      graphql_name 'Achievement'

      authorize :read_achievement

      field :id,
            ::Types::GlobalIDType[::Achievements::Achievement],
            null: false,
            description: 'ID of the achievement.'

      field :namespace,
            ::Types::NamespaceType,
            null: false,
            description: 'Namespace of the achievement.'

      field :name,
            GraphQL::Types::String,
            null: false,
            description: 'Name of the achievement.'

      field :avatar_url,
            GraphQL::Types::String,
            null: true,
            description: 'URL to avatar of the achievement.'

      field :description,
            GraphQL::Types::String,
            null: true,
            description: 'Description or notes for the achievement.'

      field :created_at,
            Types::TimeType,
            null: false,
            description: 'Timestamp the achievement was created.'

      field :updated_at,
            Types::TimeType,
            null: false,
            description: 'Timestamp the achievement was last updated.'

      field :user_achievements,
            Types::Achievements::UserAchievementType.connection_type,
            null: true,
            alpha: { milestone: '15.10' },
            description: "Recipients for the achievement."

      def avatar_url
        object.avatar_url(only_path: false)
      end
    end
  end
end