Class: Resolvers::MergeRequestsResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
ResolvesMergeRequests
Defined in:
app/graphql/resolvers/merge_requests_resolver.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ResolvesMergeRequests

#early_return, #ready?, #resolve_with_lookahead

Methods included from LooksAhead

#apply_lookahead, #resolve

Methods inherited from BaseResolver

as_single, complexity, complexity_multiplier, #current_user, field_options, last, #object, #offset_pagination, requires_argument!, resolver_complexity, #select_result, #single?, single_definition_blocks, singular_type, #synchronized_object, when_single

Methods included from Gitlab::Utils::Override

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

Methods included from Gitlab::Graphql::GlobalIDCompatibility

#coerce_global_id_arguments!

Methods included from Gitlab::Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Class Method Details

.accept_assigneeObject


9
10
11
12
13
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 9

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

.accept_authorObject


15
16
17
18
19
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 15

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

.singleObject


57
58
59
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 57

def self.single
  ::Resolvers::MergeRequestResolver
end

Instance Method Details

#no_results_possible?(args) ⇒ Boolean

Returns:

  • (Boolean)

61
62
63
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 61

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

#some_argument_is_empty?(args) ⇒ Boolean

Returns:

  • (Boolean)

65
66
67
# File 'app/graphql/resolvers/merge_requests_resolver.rb', line 65

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