Class: Resolvers::MergeRequestPipelinesResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
CachingArrayResolver, ResolvesPipelines
Defined in:
app/graphql/resolvers/merge_request_pipelines_resolver.rb

Constant Summary

Constants included from CachingArrayResolver

CachingArrayResolver::MAX_UNION_SIZE

Class Method Summary collapse

Instance Method Summary collapse

Methods included from CachingArrayResolver

#allowed?, #item_found, #max_union_size, #preload

Methods included from ResolvesPipelines

#resolve_pipelines

Methods inherited from BaseResolver

as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calls_gitaly!, complexity, complexity_multiplier, #current_user, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, single, #single?, single_definition_blocks, singular_type, when_single

Methods included from Gitlab::Utils::Override

#extended, extensions, #included, #method_added, #override, #prepended, #queue_verification, verify!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Class Method Details

.field_optionsObject

Return at most 500 pipelines for each MR. Merge requests generally have many fewer pipelines than this.


14
15
16
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 14

def self.field_options
  super.merge(max_page_size: 500)
end

Instance Method Details

#model_classObject


29
30
31
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 29

def model_class
  ::Ci::Pipeline
end

#projectObject


37
38
39
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 37

def project
  merge_request.source_project
end

#query_for(input) ⇒ Object


24
25
26
27
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 24

def query_for(input)
  mr, args = input
  resolve_pipelines(mr.source_project, args).merge(mr.all_pipelines)
end

#query_input(**args) ⇒ Object


33
34
35
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 33

def query_input(**args)
  [merge_request, args]
end

#resolve(**args) ⇒ Object


18
19
20
21
22
# File 'app/graphql/resolvers/merge_request_pipelines_resolver.rb', line 18

def resolve(**args)
  return unless project

  super
end