Class: Resolvers::MergeRequestsResolver

Inherits:
BaseResolver
  • Object
show all
Extended by:
Gitlab::Graphql::NegatableArguments
Includes:
ResolvesMergeRequests
Defined in:
app/graphql/resolvers/merge_requests_resolver.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Gitlab::Graphql::NegatableArguments

negated

Methods included from ResolvesMergeRequests

#early_return, #ready?, #resolve_with_lookahead

Methods included from LooksAhead

#apply_lookahead, #resolve

Methods inherited from BaseResolver

as_single, authorization, authorized?, before_connection_authorization, before_connection_authorization_block, calls_gitaly!, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, #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

.accept_assigneeObject


12
13
14
15
16
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 12

def self.accept_assignee
  argument :assignee_username, GraphQL::Types::String,
           required: false,
           description: 'Username of the assignee.'
end

.accept_authorObject


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

def self.accept_author
  argument :author_username, GraphQL::Types::String,
           required: false,
           description: 'Username of the author.'
end

.accept_reviewerObject


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

def self.accept_reviewer
  argument :reviewer_username, GraphQL::Types::String,
           required: false,
           description: 'Username of the reviewer.'
end

.singleObject


99
100
101
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 99

def self.single
  ::Resolvers::MergeRequestResolver
end

Instance Method Details

#no_results_possible?(args) ⇒ Boolean

Returns:

  • (Boolean)

103
104
105
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 103

def no_results_possible?(args)
  project.nil? || some_argument_is_empty?(args)
end

#some_argument_is_empty?(args) ⇒ Boolean

Returns:

  • (Boolean)

107
108
109
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 107

def some_argument_is_empty?(args)
  args.values.any? { |v| v.is_a?(Array) && v.empty? }
end