Class: Skylight::Core::Normalizers::GraphQL::ExecuteMultiplex Private
- Inherits:
-
Base
- Object
- Normalizer
- Base
- Skylight::Core::Normalizers::GraphQL::ExecuteMultiplex
- 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.
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Normalizer
Instance Method Summary collapse
Methods inherited from Base
inherited, key, #normalize, register_graphql
Methods inherited from Normalizer
#initialize, #normalize, register
Constructor Details
This class inherits a constructor from Skylight::Core::Normalizers::Normalizer
Instance Method Details
#normalize_after(trace, _span, _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.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/skylight/core/normalizers/graphql/base.rb', line 71 def normalize_after(trace, _span, _name, payload) # This is in normalize_after because the queries may not have # an assigned operation name before they are executed. # For example, if you send a single query with a defined operation name, e.g.: # ```graphql # query MyNamedQuery { user(id: 1) { name } } # ``` # ... but do _not_ send the operationName request param, the GraphQL docs[1] # specify that the executor should use the operation name from the definition. # # In graphql-ruby's case, the calculation of the operation name is lazy, and # has not been done yet at the point where execute_multiplex starts. # [1] https://graphql.org/learn/serving-over-http/#post-request queries, has_errors = payload[:multiplex].queries.each_with_object([Set.new, Set.new]) do |query, (names, errors)| names << extract_query_name(query) errors << query.static_errors.any? end trace.endpoint = "graphql:#{queries.sort.join('+')}" trace.compound_response_error_status = if has_errors.all? :all elsif !has_errors.none? :partial end end |