Class: Resolvers::UserMergeRequestsResolver

Inherits:
MergeRequestsResolver show all
Includes:
ResolvesProject
Defined in:
app/graphql/resolvers/user_merge_requests_resolver.rb

Constant Summary

Constants included from LooksAhead

LooksAhead::FEATURE_FLAG

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ResolvesProject

#resolve_project

Methods inherited from MergeRequestsResolver

single, #some_argument_is_empty?

Methods included from ResolvesMergeRequests

#early_return, #resolve_with_lookahead

Methods included from LooksAhead

#apply_lookahead

Methods inherited from BaseResolver

complexity, complexity_multiplier, #current_user, last, #object, resolver_complexity, #select_result, single, #single?, #synchronized_object

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?

Instance Attribute Details

#projectObject (readonly)

Returns the value of attribute project


15
16
17
# File 'app/graphql/resolvers/user_merge_requests_resolver.rb', line 15

def project
  @project
end

Instance Method Details

#ready?(project_id: nil, project_path: nil, **args) ⇒ Boolean

Returns:

  • (Boolean)

18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'app/graphql/resolvers/user_merge_requests_resolver.rb', line 18

def ready?(project_id: nil, project_path: nil, **args)
  return early_return unless can_read_profile?

  if project_id || project_path
    load_project(project_path, project_id)
    return early_return unless can_read_project?
  elsif args[:iids].present?
    raise ::Gitlab::Graphql::Errors::ArgumentError,
      'iids requires projectPath or projectId'
  end

  super(**args)
end

#resolve(**args) ⇒ Object


32
33
34
35
36
# File 'app/graphql/resolvers/user_merge_requests_resolver.rb', line 32

def resolve(**args)
  prepare_args(args)
  key = :"#{user_role}_id"
  super(key => user.id, **args)
end

#user_roleObject

Raises:

  • (NotImplementedError)

38
39
40
# File 'app/graphql/resolvers/user_merge_requests_resolver.rb', line 38

def user_role
  raise NotImplementedError
end