debian-mirror-gitlab/app/graphql/resolvers/error_tracking/sentry_detailed_error_resolver.rb

29 lines
711 B
Ruby
Raw Normal View History

2020-01-01 13:55:28 +05:30
# frozen_string_literal: true
module Resolvers
module ErrorTracking
class SentryDetailedErrorResolver < BaseResolver
argument :id, GraphQL::ID_TYPE,
required: true,
description: 'ID of the Sentry issue'
def resolve(**args)
project = object
current_user = context[:current_user]
issue_id = GlobalID.parse(args[:id]).model_id
# Get data from Sentry
response = ::ErrorTracking::IssueDetailsService.new(
project,
current_user,
{ issue_id: issue_id }
).execute
issue = response[:issue]
issue.gitlab_project = project if issue
issue
end
end
end
end