graphql 1.13.14 → 1.13.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of graphql might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '032739327be4e27b1c7d2dbc3d24a5db771a713ec683238da1e9cd850993ff73'
4
- data.tar.gz: b8c12e62126d761283086ccda4095812db080611b463bb0770603ea85c965c02
3
+ metadata.gz: cc7b2a76a8b1650e6669a7f266ff580a3cb78f214307f26527197944441516c9
4
+ data.tar.gz: 9d12f456ee5699eaccc7956ee942ca8165fcca61437b5f9f841abd70b245c52b
5
5
  SHA512:
6
- metadata.gz: c1a66366e1cceae9717bf8a4dc902cf9a670cee49e5017d45d7b9375149f579fa54f31ed0d47b73f71552c4b9c62de108f29eaa2ad59a6bc5fcf8cff7bc2bbc8
7
- data.tar.gz: d83ce36125d77157290b60d0b66dbb01a7a3c8eac6d5f99c4c025e0e4cc511917d04c01a53357f74fd7554fcbf3ec91d5ead5b25c7a718565a6bf8b198de50fc
6
+ metadata.gz: 00b5e6d26cdb8f62002e66aef32e8b905091f6fdb9f8066cc4537a4747478764bc919b172dd0085e9ab076c7e796158c24de0d2d2483b22dc494d7b96e4f309c
7
+ data.tar.gz: 1dd5c023bccaa8b9f6de3ca6cf9a7153c937ca74fb47c31fd29da9d5dce9942fd779bdd38d5526ef7f107c5bd91eabdaa2c8b74df75c1b57836f3068a085526e
@@ -16,10 +16,9 @@ module GraphQL
16
16
  class ValidationPipeline
17
17
  attr_reader :max_depth, :max_complexity
18
18
 
19
- def initialize(query:, validate:, parse_error:, operation_name_error:, max_depth:, max_complexity:)
19
+ def initialize(query:, parse_error:, operation_name_error:, max_depth:, max_complexity:)
20
20
  @validation_errors = []
21
21
  @internal_representation = nil
22
- @validate = validate
23
22
  @parse_error = parse_error
24
23
  @operation_name_error = operation_name_error
25
24
  @query = query
@@ -72,7 +71,7 @@ module GraphQL
72
71
  elsif @operation_name_error
73
72
  @validation_errors << @operation_name_error
74
73
  else
75
- validation_result = @schema.static_validator.validate(@query, validate: @validate, timeout: @schema.validate_timeout, max_errors: @schema.validate_max_errors)
74
+ validation_result = @schema.static_validator.validate(@query, validate: @query.validate, timeout: @schema.validate_timeout, max_errors: @schema.validate_max_errors)
76
75
  @validation_errors.concat(validation_result[:errors])
77
76
  @internal_representation = validation_result[:irep]
78
77
 
data/lib/graphql/query.rb CHANGED
@@ -434,7 +434,6 @@ module GraphQL
434
434
 
435
435
  @validation_pipeline = GraphQL::Query::ValidationPipeline.new(
436
436
  query: self,
437
- validate: @validate,
438
437
  parse_error: parse_error,
439
438
  operation_name_error: operation_name_error,
440
439
  max_depth: @max_depth,
@@ -9,7 +9,6 @@ require "graphql/tracing/scout_tracing"
9
9
  require "graphql/tracing/skylight_tracing"
10
10
  require "graphql/tracing/statsd_tracing"
11
11
  require "graphql/tracing/prometheus_tracing"
12
- require "graphql/tracing/opentelemetry_tracing"
13
12
 
14
13
  if defined?(PrometheusExporter::Server)
15
14
  require "graphql/tracing/prometheus_tracing/graphql_collector"
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.13.14"
3
+ VERSION = "1.13.15"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.14
4
+ version: 1.13.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-06-20 00:00:00.000000000 Z
11
+ date: 2022-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -659,7 +659,6 @@ files:
659
659
  - lib/graphql/tracing/data_dog_tracing.rb
660
660
  - lib/graphql/tracing/new_relic_tracing.rb
661
661
  - lib/graphql/tracing/notifications_tracing.rb
662
- - lib/graphql/tracing/opentelemetry_tracing.rb
663
662
  - lib/graphql/tracing/platform_tracing.rb
664
663
  - lib/graphql/tracing/prometheus_tracing.rb
665
664
  - lib/graphql/tracing/prometheus_tracing/graphql_collector.rb
@@ -1,101 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Tracing
5
- class OpenTelemetryTracing < PlatformTracing
6
- self.platform_keys = {
7
- 'lex' => 'graphql.lex',
8
- 'parse' => 'graphql.parse',
9
- 'validate' => 'graphql.validate',
10
- 'analyze_query' => 'graphql.analyze_query',
11
- 'analyze_multiplex' => 'graphql.analyze_multiplex',
12
- 'execute_query' => 'graphql.execute_query',
13
- 'execute_query_lazy' => 'graphql.execute_query_lazy',
14
- 'execute_multiplex' => 'graphql.execute_multiplex'
15
- }
16
-
17
- def platform_trace(platform_key, key, data)
18
- return yield if platform_key.nil?
19
-
20
- tracer.in_span(platform_key, attributes: attributes_for(key, data)) do |span, _context|
21
- yield.tap do |response|
22
- errors = response[:errors]&.compact&.map { |e| e.to_h }&.to_json if key == 'validate'
23
- unless errors.nil?
24
- span.add_event(
25
- 'graphql.validation.error',
26
- attributes: {
27
- 'message' => errors
28
- }
29
- )
30
- end
31
- end
32
- end
33
- end
34
-
35
- def platform_field_key(type, field)
36
- "#{type.graphql_name}.#{field.graphql_name}"
37
- end
38
-
39
- def platform_authorized_key(type)
40
- "#{type.graphql_name}.authorized"
41
- end
42
-
43
- def platform_resolve_type_key(type)
44
- "#{type.graphql_name}.resolve_type"
45
- end
46
-
47
- private
48
-
49
- def tracer
50
- OpenTelemetry::Instrumentation::GraphQL::Instrumentation.instance.tracer
51
- end
52
-
53
- def config
54
- OpenTelemetry::Instrumentation::GraphQL::Instrumentation.instance.config
55
- end
56
-
57
- def platform_key_enabled?(ctx, key)
58
- return false unless config[key]
59
-
60
- ns = ctx.namespace(:opentelemetry)
61
- return true if ns.empty? # restores original behavior so that keys are returned if tracing is not set in context.
62
- return false unless ns.key?(key) && ns[key]
63
-
64
- return true
65
- end
66
-
67
- def attributes_for(key, data)
68
- attributes = {}
69
- case key
70
- when 'execute_query'
71
- attributes['selected_operation_name'] = data[:query].selected_operation_name if data[:query].selected_operation_name
72
- attributes['selected_operation_type'] = data[:query].selected_operation.operation_type
73
- attributes['query_string'] = data[:query].query_string
74
- end
75
- attributes
76
- end
77
-
78
- def cached_platform_key(ctx, key, trace_phase)
79
- cache = ctx.namespace(self.class)[:platform_key_cache] ||= {}
80
-
81
- cache.fetch(key) do
82
- cache[key] = if trace_phase == :field
83
- return unless platform_key_enabled?(ctx, :enable_platform_field)
84
-
85
- yield
86
- elsif trace_phase == :authorized
87
- return unless platform_key_enabled?(ctx, :enable_platform_authorized)
88
-
89
- yield
90
- elsif trace_phase == :resolve_type
91
- return unless platform_key_enabled?(ctx, :enable_platform_resolve_type)
92
-
93
- yield
94
- else
95
- raise "Unknown trace phase"
96
- end
97
- end
98
- end
99
- end
100
- end
101
- end