lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb in opentelemetry-instrumentation-graphql-0.21.0 vs lib/opentelemetry/instrumentation/graphql/tracers/graphql_tracer.rb in opentelemetry-instrumentation-graphql-0.21.1

- old
+ new

@@ -22,15 +22,15 @@ 'execute_query' => 'graphql.execute_query', 'execute_query_lazy' => 'graphql.execute_query_lazy', 'execute_multiplex' => 'graphql.execute_multiplex' } - def platform_trace(platform_key, key, data) + def platform_trace(platform_key, key, data) # rubocop:disable Metrics/CyclomaticComplexity return yield if platform_key.nil? tracer.in_span(platform_key, attributes: attributes_for(key, data)) do |span| yield.tap do |response| - errors = response[:errors]&.compact&.map { |e| e.to_h }&.to_json if key == 'validate' + errors = response[:errors]&.compact&.map(&:to_h)&.to_json if key == 'validate' unless errors.nil? span.add_event( 'graphql.validation.error', attributes: { 'message' => errors