blob: 83bb144017c802319fa9e7ce10bd4357812b413e (
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
|
# frozen_string_literal: true
module Resolvers
module DataTransfer
class GroupDataTransferResolver < BaseResolver
include DataTransferArguments
include Gitlab::Graphql::Authorize::AuthorizeResource
authorizes_object!
authorize :read_usage_quotas
type Types::DataTransfer::GroupDataTransferType, null: false
alias_method :group, :object
def resolve(**args)
return { egress_nodes: [] } unless Feature.enabled?(:data_transfer_monitoring, group)
results = if Feature.enabled?(:data_transfer_monitoring_mock_data, group)
::DataTransfer::MockedTransferFinder.new.execute
else
::DataTransfer::GroupDataTransferFinder.new(
group: group,
from: args[:from],
to: args[:to],
user: current_user
).execute.map(&:attributes)
end
{ egress_nodes: results.to_a }
end
end
end
end
|