2018-12-05 23:21:45 +05:30
|
|
|
# frozen_string_literal: true
|
2021-01-29 00:20:46 +05:30
|
|
|
# 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-12-05 23:21:45 +05:30
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
module Resolvers
|
|
|
|
class ProjectPipelinesResolver < BaseResolver
|
2021-01-29 00:20:46 +05:30
|
|
|
include LooksAhead
|
2018-11-08 19:23:39 +05:30
|
|
|
include ResolvesPipelines
|
|
|
|
|
|
|
|
alias_method :project, :object
|
|
|
|
|
2021-01-29 00:20:46 +05:30
|
|
|
def resolve_with_lookahead(**args)
|
|
|
|
apply_lookahead(resolve_pipelines(project, args))
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def preloads
|
|
|
|
{
|
|
|
|
jobs: [:statuses],
|
|
|
|
upstream: [:triggered_by_pipeline],
|
|
|
|
downstream: [:triggered_pipelines]
|
|
|
|
}
|
2018-11-08 19:23:39 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2021-01-29 00:20:46 +05:30
|
|
|
# rubocop: enable Graphql/ResolverType
|
2021-11-18 22:05:49 +05:30
|
|
|
|
|
|
|
Resolvers::ProjectPipelinesResolver.prepend_mod
|