summaryrefslogtreecommitdiff
path: root/app/graphql/types/ci/group_type.rb
blob: 3da183cb842d674c494bf49594dd3d0ec58a7e9e (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
# frozen_string_literal: true

module Types
  module Ci
    # rubocop: disable Graphql/AuthorizeTypes
    class GroupType < BaseObject
      graphql_name 'CiGroup'

      field :id, GraphQL::STRING_TYPE, null: false,
            description: 'ID for a group.'
      field :name, GraphQL::STRING_TYPE, null: true,
            description: 'Name of the job group.'
      field :size, GraphQL::INT_TYPE, null: true,
            description: 'Size of the group.'
      field :jobs, Ci::JobType.connection_type, null: true,
            description: 'Jobs in group.'
      field :detailed_status, Types::Ci::DetailedStatusType, null: true,
            description: 'Detailed status of the group.'

      def detailed_status
        object.detailed_status(context[:current_user])
      end
    end
  end
end