1# frozen_string_literal: true
2# The GraphQL type here gets defined in
3# https://gitlab.com/gitlab-org/gitlab/blob/master/app/graphql/resolvers/concerns/resolves_pipelines.rb#L7
4# rubocop: disable Graphql/ResolverType
5
6module Resolvers
7  class ProjectPipelinesResolver < BaseResolver
8    include LooksAhead
9    include ResolvesPipelines
10
11    alias_method :project, :object
12
13    def resolve_with_lookahead(**args)
14      apply_lookahead(resolve_pipelines(project, args))
15    end
16
17    private
18
19    def preloads
20      {
21        jobs: { statuses_order_id_desc: [:needs] },
22        upstream: [:triggered_by_pipeline],
23        downstream: [:triggered_pipelines]
24      }
25    end
26  end
27end
28# rubocop: enable Graphql/ResolverType
29
30Resolvers::ProjectPipelinesResolver.prepend_mod
31