Class: Resolvers::ErrorTracking::SentryErrorStackTraceResolver

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

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

#resolve(id:) ⇒ Object


12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/graphql/resolvers/error_tracking/sentry_error_stack_trace_resolver.rb', line 12

def resolve(id:)
  # TODO: remove this line when the compatibility layer is removed
  # See: https://gitlab.com/gitlab-org/gitlab/-/issues/257883
  id = ::Types::GlobalIDType[::Gitlab::ErrorTracking::DetailedError].coerce_isolated_input(id)

  # Get data from Sentry
  response = ::ErrorTracking::IssueLatestEventService.new(
    project,
    current_user,
    { issue_id: id.model_id }
  ).execute

  event = response[:latest_event]
  event.gitlab_project = project if event

  event
end