2021-03-11 19:13:27 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
class GroupLabelsResolver < LabelsResolver
|
|
|
|
type Types::LabelType.connection_type, null: true
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
argument :include_descendant_groups, GraphQL::Types::Boolean,
|
2021-03-11 19:13:27 +05:30
|
|
|
required: false,
|
|
|
|
description: 'Include labels from descendant groups.',
|
|
|
|
default_value: false
|
|
|
|
|
2021-10-27 15:23:28 +05:30
|
|
|
argument :only_group_labels, GraphQL::Types::Boolean,
|
2021-03-11 19:13:27 +05:30
|
|
|
required: false,
|
|
|
|
description: 'Include only group level labels.',
|
|
|
|
default_value: false
|
2023-06-20 00:43:36 +05:30
|
|
|
|
|
|
|
before_connection_authorization do |nodes, current_user|
|
2023-07-09 08:55:56 +05:30
|
|
|
Preloaders::LabelsPreloader.new(nodes, current_user).preload_all
|
2023-06-20 00:43:36 +05:30
|
|
|
end
|
2021-03-11 19:13:27 +05:30
|
|
|
end
|
|
|
|
end
|