Class: Resolvers::AlertManagement::AlertResolver

Inherits:
BaseResolver
  • Object
show all
Includes:
LooksAhead
Defined in:
app/graphql/resolvers/alert_management/alert_resolver.rb

Constant Summary

Constants included from LooksAhead

LooksAhead::FEATURE_FLAG

Instance Method Summary collapse

Methods included from LooksAhead

#apply_lookahead, #resolve

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 Method Details

#preloadsObject


34
35
36
37
38
39
# File 'app/graphql/resolvers/alert_management/alert_resolver.rb', line 34

def preloads
  {
    assignees: [:assignees],
    notes: [:ordered_notes, { ordered_notes: [:system_note_metadata, :project, :noteable] }]
  }
end

#resolve_with_lookahead(**args) ⇒ Object


27
28
29
30
31
32
# File 'app/graphql/resolvers/alert_management/alert_resolver.rb', line 27

def resolve_with_lookahead(**args)
  parent = object.respond_to?(:sync) ? object.sync : object
  return ::AlertManagement::Alert.none if parent.nil?

  apply_lookahead(::AlertManagement::AlertsFinder.new(context[:current_user], parent, args).execute)
end