Class: Resolvers::IssuesResolver

Inherits:
BaseResolver
  • Object
show all
Defined in:
app/graphql/resolvers/issues_resolver.rb

Direct Known Subclasses

GroupIssuesResolver

Constant Summary collapse

NON_STABLE_CURSOR_SORTS =
%i[priority_asc priority_desc
label_priority_asc label_priority_desc
milestone_due_asc milestone_due_desc].freeze

Instance Method Summary collapse

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?, 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?

Instance Method Details

#continue_issue_resolve(parent, finder, **args) ⇒ Object


21
22
23
24
25
26
27
28
29
30
31
# File 'app/graphql/resolvers/issues_resolver.rb', line 21

def continue_issue_resolve(parent, finder, **args)
  issues = apply_lookahead(Gitlab::Graphql::Loaders::IssuableLoader.new(parent, finder).batching_find_all)

  if non_stable_cursor_sort?(args[:sort])
    # Certain complex sorts are not supported by the stable cursor pagination yet.
    # In these cases, we use offset pagination, so we return the correct connection.
    offset_pagination(issues)
  else
    issues
  end
end