debian-mirror-gitlab/app/graphql/resolvers/project_pipeline_resolver.rb
2020-06-23 00:09:42 +05:30

17 lines
476 B
Ruby

# frozen_string_literal: true
module Resolvers
class ProjectPipelineResolver < BaseResolver
alias_method :project, :object
argument :iid, GraphQL::ID_TYPE,
required: true,
description: 'IID of the Pipeline, e.g., "1"'
def resolve(iid:)
BatchLoader::GraphQL.for(iid).batch(key: project) do |iids, loader, args|
args[:key].ci_pipelines.for_iid(iids).each { |pl| loader.call(pl.iid.to_s, pl) }
end
end
end
end