graphql 2.0.25 → 2.0.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 289b06689b36a3673c053d13d2ce0835a089e92db60e3e24e8af791fdd934d81
4
- data.tar.gz: 3c5257c0732d0729b97ac92376427ccba26ef66397f9b9d07c18e9792ea03251
3
+ metadata.gz: b25908e65f82d9c17e76e1f38b874e882c124b7102dc7ae2cb3caf4e819aa370
4
+ data.tar.gz: d3933abea4a559db3767c6a1ea3f37401432a7fd67842df6c9bd3e28e4034a8d
5
5
  SHA512:
6
- metadata.gz: 72ad503ed008aa168a63c1a40ac9e44dbb9b2d6a7871f1cd6191a692d6275506ce17f0df3135ae0a2ef95fe695a457d76239a2623f477cf7cd7f27cc124888c7
7
- data.tar.gz: 90976b77a4230bf8a7d3fe5470deae70082e6caac1d3b30c799e958621cd2177283d0f83eb06128081e7e2179e33e718a1ba9353ab388fac83553e0988e7b4bc
6
+ metadata.gz: a8a85cb8ee54143b1ed00b6aa030479a1b48e164142e93e6b1e95f0f8cb44da36fcd1f3b53470f8edb783f43d469fd4e2dafa505217440832eb0d92165107239
7
+ data.tar.gz: dc61c951d84cc9199910145230cf55691d4fdb3a8f243b0e9f5dd9ee78c498a739de3d0bb72a65ade0cab07a9310a072dc7855ad5943425e778bd9b79f182e67
@@ -76,7 +76,7 @@ module GraphQL
76
76
  RUBY
77
77
  end
78
78
 
79
- def execute_field(span_key = "execute_field", query:, field:, ast_node:, arguments:, object:)
79
+ def execute_field_span(span_key, query, field, ast_node, arguments, object)
80
80
  return_type = field.type.unwrap
81
81
  trace_field = if return_type.kind.scalar? || return_type.kind.enum?
82
82
  (field.trace.nil? && @trace_scalars) || field.trace
@@ -99,18 +99,31 @@ module GraphQL
99
99
  prepare_span_data = { query: query, field: field, ast_node: ast_node, arguments: arguments, object: object }
100
100
  prepare_span(span_key, prepare_span_data, span)
101
101
  end
102
- super(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
102
+ yield
103
103
  end
104
104
  else
105
+ yield
106
+ end
107
+ end
108
+ def execute_field(query:, field:, ast_node:, arguments:, object:)
109
+ execute_field_span("execute_field", query, field, ast_node, arguments, object) do
105
110
  super(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
106
111
  end
107
112
  end
108
113
 
109
114
  def execute_field_lazy(query:, field:, ast_node:, arguments:, object:)
110
- execute_field("execute_field_lazy", query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
115
+ execute_field_span("execute_field_lazy", query, field, ast_node, arguments, object) do
116
+ super(query: query, field: field, ast_node: ast_node, arguments: arguments, object: object)
117
+ end
111
118
  end
112
119
 
113
- def authorized(object:, type:, query:, span_key: "authorized")
120
+ def authorized(query:, type:, object:)
121
+ authorized_span("authorized", object, type, query) do
122
+ super(query: query, type: type, object: object)
123
+ end
124
+ end
125
+
126
+ def authorized_span(span_key, object, type, query)
114
127
  platform_key = @platform_key_cache[DataDogTrace].platform_authorized_key_cache[type]
115
128
  @tracer.trace(platform_key, service: @service_name) do |span|
116
129
  span.span_type = 'custom'
@@ -121,15 +134,29 @@ module GraphQL
121
134
  if @has_prepare_span
122
135
  prepare_span(span_key, {object: object, type: type, query: query}, span)
123
136
  end
137
+ yield
138
+ end
139
+ end
140
+
141
+ def authorized_lazy(object:, type:, query:)
142
+ authorized_span("authorized_lazy", object, type, query) do
124
143
  super(query: query, type: type, object: object)
125
144
  end
126
145
  end
127
146
 
128
- def authorized_lazy(**kwargs, &block)
129
- authorized(span_key: "authorized_lazy", **kwargs, &block)
147
+ def resolve_type(object:, type:, query:)
148
+ resolve_type_span("resolve_type", object, type, query) do
149
+ super(object: object, query: query, type: type)
150
+ end
130
151
  end
131
152
 
132
- def resolve_type(object:, type:, query:, span_key: "resolve_type")
153
+ def resolve_type_lazy(object:, type:, query:)
154
+ resolve_type_span("resolve_type_lazy", object, type, query) do
155
+ super(object: object, query: query, type: type)
156
+ end
157
+ end
158
+
159
+ def resolve_type_span(span_key, object, type, query)
133
160
  platform_key = @platform_key_cache[DataDogTrace].platform_resolve_type_key_cache[type]
134
161
  @tracer.trace(platform_key, service: @service_name) do |span|
135
162
  span.span_type = 'custom'
@@ -140,14 +167,10 @@ module GraphQL
140
167
  if @has_prepare_span
141
168
  prepare_span(span_key, {object: object, type: type, query: query}, span)
142
169
  end
143
- super(query: query, type: type, object: object)
170
+ yield
144
171
  end
145
172
  end
146
173
 
147
- def resolve_type_lazy(**kwargs, &block)
148
- resolve_type(span_key: "resolve_type_lazy", **kwargs, &block)
149
- end
150
-
151
174
  include PlatformTrace
152
175
 
153
176
  # Implement this method in a subclass to apply custom tags to datadog spans
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.0.25"
3
+ VERSION = "2.0.26"
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: 2.0.25
4
+ version: 2.0.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-07 00:00:00.000000000 Z
11
+ date: 2023-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips