2018-09-11 15:08:34 -04:00
|
|
|
# frozen_string_literal: true
|
2020-11-17 13:09:20 -05: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 15:08:34 -04:00
|
|
|
|
2018-06-26 12:31:05 -04:00
|
|
|
module Resolvers
|
|
|
|
class ProjectPipelinesResolver < BaseResolver
|
2020-10-30 02:08:54 -04:00
|
|
|
include LooksAhead
|
2018-06-26 12:31:05 -04:00
|
|
|
include ResolvesPipelines
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
2020-10-30 02:08:54 -04:00
|
|
|
def resolve_with_lookahead(**args)
|
|
|
|
apply_lookahead(resolve_pipelines(project, args))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def preloads
|
|
|
|
{
|
2020-11-03 10:09:05 -05:00
|
|
|
jobs: [:statuses],
|
|
|
|
upstream: [:triggered_by_pipeline],
|
|
|
|
downstream: [:triggered_pipelines]
|
2020-10-30 02:08:54 -04:00
|
|
|
}
|
2018-06-26 12:31:05 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2020-11-17 13:09:20 -05:00
|
|
|
# rubocop: enable Graphql/ResolverType
|