summaryrefslogtreecommitdiff
path: root/app/graphql/types/error_tracking/sentry_error_stack_trace_entry_type.rb
blob: c9915d052f94d12cd787d8cd6c30c2795c613837 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# frozen_string_literal: true

module Types
  module ErrorTracking
    # rubocop: disable Graphql/AuthorizeTypes
    class SentryErrorStackTraceEntryType < ::Types::BaseObject
      graphql_name 'SentryErrorStackTraceEntry'
      description 'An object containing a stack trace entry for a Sentry error'

      field :function, GraphQL::STRING_TYPE,
            null: true,
            description: 'Function in which the Sentry error occurred.'
      field :col, GraphQL::STRING_TYPE,
            null: true,
            description: 'Function in which the Sentry error occurred.'
      field :line, GraphQL::STRING_TYPE,
            null: true,
            description: 'Function in which the Sentry error occurred.'
      field :file_name, GraphQL::STRING_TYPE,
            null: true,
            description: 'File in which the Sentry error occurred.'
      field :trace_context, [Types::ErrorTracking::SentryErrorStackTraceContextType],
            null: true,
            description: 'Context of the Sentry error.'

      def function
        object['function']
      end

      def col
        object['colNo']
      end

      def line
        object['lineNo']
      end

      def file_name
        object['filename']
      end

      def trace_context
        object['context']
      end
    end
    # rubocop: enable Graphql/AuthorizeTypes
  end
end