2018-09-11 19:08:34 +00:00
|
|
|
# frozen_string_literal: true
|
2020-11-17 18:09:20 +00:00
|
|
|
# The GraphQL type here gets defined in
|
|
|
|
# https://gitlab.com/gitlab-org/gitlab/blob/master/app/graphql/resolvers/concerns/resolves_pipelines.rb#L7
|
|
|
|
# rubocop: disable Graphql/ResolverType
|
2018-09-11 19:08:34 +00:00
|
|
|
|
2018-06-26 16:31:05 +00:00
|
|
|
module Resolvers
|
|
|
|
class ProjectPipelinesResolver < BaseResolver
|
2020-10-30 06:08:54 +00:00
|
|
|
include LooksAhead
|
2018-06-26 16:31:05 +00:00
|
|
|
include ResolvesPipelines
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
2020-10-30 06:08:54 +00:00
|
|
|
def resolve_with_lookahead(**args)
|
|
|
|
apply_lookahead(resolve_pipelines(project, args))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def preloads
|
|
|
|
{
|
2020-11-03 15:09:05 +00:00
|
|
|
jobs: [:statuses],
|
|
|
|
upstream: [:triggered_by_pipeline],
|
|
|
|
downstream: [:triggered_pipelines]
|
2020-10-30 06:08:54 +00:00
|
|
|
}
|
2018-06-26 16:31:05 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-11-17 18:09:20 +00:00
|
|
|
# rubocop: enable Graphql/ResolverType
|