class Skylight::Core::Normalizers::GraphQL::Base

Some AS::N events in GraphQL are not super useful. We are purposefully ignoring the following keys (and you probably shouldn't add them):

- "graphql.analyze_multiplex"
- "graphql.execute_field" (very frequently called)
- "graphql.execute_field_lazy"

Constants

ANONYMOUS
CAT

Public Class Methods

inherited(klass) click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 26
def self.inherited(klass)
  klass.const_set(
    :KEY,
    ActiveSupport::Inflector.underscore(
      ActiveSupport::Inflector.demodulize(klass.name)
    ).freeze
  )
end
key() click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 35
def self.key
  self::KEY
end
register_graphql() click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 17
def self.register_graphql
  register("#{key}.graphql")
end

Public Instance Methods

normalize(_trace, _name, _payload) click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 39
def normalize(_trace, _name, _payload)
  [CAT, "graphql.#{key}", nil]
end

Private Instance Methods

extract_query_name(query) click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 49
def extract_query_name(query)
  query&.context&.[](:skylight_endpoint) ||
    query&.operation_name ||
    ANONYMOUS
end
key() click to toggle source
# File lib/skylight/core/normalizers/graphql/base.rb, line 45
def key
  self.class.key
end