group_type.rb 1.09 KB
Newer Older
1
2
3
4
5
6
7
8
# frozen_string_literal: true

module EE
  module Types
    module GroupType
      extend ActiveSupport::Concern

      prepended do
9
10
        %i[epics group_timelogs].each do |feature|
          field "#{feature}_enabled", GraphQL::BOOLEAN_TYPE, null: true, resolve: -> (group, args, ctx) do
11
            group.feature_available?(feature)
12
          end, description: "Indicates if #{feature.to_s.humanize} are enabled for namespace"
13
14
        end

Charlie Ablett's avatar
Charlie Ablett committed
15
        field :epic, # rubocop:disable Graphql/Descriptions
16
17
18
19
              ::Types::EpicType,
              null: true,
              resolver: ::Resolvers::EpicResolver.single

Charlie Ablett's avatar
Charlie Ablett committed
20
        field :epics, # rubocop:disable Graphql/Descriptions
21
22
              ::Types::EpicType.connection_type,
              null: true,
Felipe Artur's avatar
Felipe Artur committed
23
              max_page_size: 2000,
24
              resolver: ::Resolvers::EpicResolver
25
26
27
28
29
30

        field :timelogs,
              ::Types::TimelogType.connection_type,
              null: false, complexity: 5,
              resolver: ::Resolvers::TimelogResolver,
              description: 'Time logged in issues by group members'
31
32
33
34
      end
    end
  end
end