Class: Skylight::Core::Normalizers::GraphQL::ExecuteQuery Private

Inherits:
Base
  • Object
show all
Defined in:
lib/skylight/core/normalizers/graphql/base.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Direct Known Subclasses

ExecuteQueryLazy

Constant Summary

Constants inherited from Base

Base::ANONYMOUS, Base::CAT

Instance Attribute Summary

Attributes inherited from Normalizer

#config

Instance Method Summary collapse

Methods inherited from Base

inherited, key, register_graphql

Methods inherited from Normalizer

#initialize, #normalize_after, register

Constructor Details

This class inherits a constructor from Skylight::Core::Normalizers::Normalizer

Instance Method Details

#normalize(trace, _name, payload) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/skylight/core/normalizers/graphql/base.rb', line 92

def normalize(trace, _name, payload)
  query_name = payload[:query]&.operation_name || ANONYMOUS

  if query_name == ANONYMOUS
    meta = { mute_children: true }
  end

  # This is probably always overriden by execute_multiplex#normalize_after,
  # but in the case of a single query, it will be the same value anyway.
  trace.endpoint = "graphql:#{query_name}"

  [CAT, "graphql.#{key}: #{query_name}", nil, meta]
end