2018-09-11 15:08:34 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-06-26 12:31:05 -04:00
|
|
|
module ResolvesPipelines
|
|
|
|
extend ActiveSupport::Concern
|
|
|
|
|
|
|
|
included do
|
|
|
|
type [Types::Ci::PipelineType], null: false
|
|
|
|
argument :status,
|
|
|
|
Types::Ci::PipelineStatusEnum,
|
|
|
|
required: false,
|
|
|
|
description: "Filter pipelines by their status"
|
|
|
|
argument :ref,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: "Filter pipelines by the ref they are run for"
|
|
|
|
argument :sha,
|
|
|
|
GraphQL::STRING_TYPE,
|
|
|
|
required: false,
|
|
|
|
description: "Filter pipelines by the sha of the commit they are run for"
|
|
|
|
end
|
|
|
|
|
|
|
|
def resolve_pipelines(project, params = {})
|
|
|
|
PipelinesFinder.new(project, context[:current_user], params).execute
|
|
|
|
end
|
|
|
|
end
|