Class: Resolvers::AlertManagement::AlertResolver

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

Instance Method Summary collapse

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

#preloadsObject


38
39
40
41
42
43
# File 'app/graphql/resolvers/alert_management/alert_resolver.rb', line 38

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

#resolve_with_lookahead(**args) ⇒ Object


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

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