2021-01-29 00:20:46 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Resolvers
|
|
|
|
module Ci
|
|
|
|
class JobsResolver < BaseResolver
|
|
|
|
alias_method :pipeline, :object
|
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
type ::Types::Ci::JobType.connection_type, null: true
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
argument :security_report_types, [Types::Security::ReportTypeEnum],
|
|
|
|
required: false,
|
|
|
|
description: 'Filter jobs by the type of security report they produce'
|
|
|
|
|
|
|
|
def resolve(security_report_types: [])
|
|
|
|
if security_report_types.present?
|
|
|
|
::Security::SecurityJobsFinder.new(
|
|
|
|
pipeline: pipeline,
|
|
|
|
job_types: security_report_types
|
|
|
|
).execute
|
|
|
|
else
|
|
|
|
pipeline.statuses
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|