graphql 2.2.7 → 2.2.8

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: a49947bd83b909728424ef018fe58f3e4d7a2d1d1e0fd6688fc48fdf12026aae
4
- data.tar.gz: c369b4e0efaa1889cebd8774103e541e2860db4f920962bcc107cdbf3c072ca2
3
+ metadata.gz: 9a58a3c98ecdee8503c62c2bab39d34c0b91ba0b84401b10e1e5fc80afcf8e81
4
+ data.tar.gz: 1287f3143845004cde0c7c031ebb6d18ee2370835bca23a6a7c3ed0d6d53c81a
5
5
  SHA512:
6
- metadata.gz: '059d1323a0bfe78d29bfdcf2523b26cf3d3a82195d1b8f4a490092a61ce074ae232c7e93e6330b9659d07d28b7cd66a0f2d42e0f38040556ec265773d4a34260'
7
- data.tar.gz: 6bd1e3ddc66378e37914fb54806560ca05aeb1294bea4704f53b6445f3b83883ccab45c2d2b0c6b750fd37f4b10aa1351065bb0553f13429ede9343174e1dc62
6
+ metadata.gz: 466e806e15a2084248db753bf2a4b444665dd61750c468f15c182f190bff1f97983a34de2c8715ceb777040c8684563a8048556b28f2e5b6f0b53c817babec6f
7
+ data.tar.gz: 9fab0b39b1d7d0d44f26116bdb6493f18ff735d7d926256a0529060546512c58c50cefb462496c3bdd69fc298b0a9e57b371c6c314b72543dec39d731ebf6e52
@@ -111,15 +111,15 @@ module GraphQL
111
111
  data_result
112
112
  end
113
113
  else
114
- result = {
115
- "data" => query.context.namespace(:interpreter_runtime)[:runtime].final_result
116
- }
114
+ result = {}
117
115
 
118
116
  if query.context.errors.any?
119
117
  error_result = query.context.errors.map(&:to_h)
120
118
  result["errors"] = error_result
121
119
  end
122
120
 
121
+ result["data"] = query.context.namespace(:interpreter_runtime)[:runtime].final_result
122
+
123
123
  result
124
124
  end
125
125
  if query.context.namespace?(:__query_result_extensions__)
@@ -1,18 +1,16 @@
1
1
  # frozen_string_literal: true
2
-
3
- require 'graphql/schema/base_64_bp'
4
-
2
+ require "base64"
5
3
  module GraphQL
6
4
  class Schema
7
5
  # @api private
8
6
  module Base64Encoder
9
7
  def self.encode(unencoded_text, nonce: false)
10
- Base64Bp.urlsafe_encode64(unencoded_text, padding: false)
8
+ Base64.urlsafe_encode64(unencoded_text, padding: false)
11
9
  end
12
10
 
13
11
  def self.decode(encoded_text, nonce: false)
14
12
  # urlsafe_decode64 is for forward compatibility
15
- Base64Bp.urlsafe_decode64(encoded_text)
13
+ Base64.urlsafe_decode64(encoded_text)
16
14
  rescue ArgumentError
17
15
  raise GraphQL::ExecutionError, "Invalid input: #{encoded_text.inspect}"
18
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
- require 'graphql/schema/base_64_bp'
2
+ require "base64"
3
3
 
4
4
  module GraphQL
5
5
  class Schema
@@ -5,10 +5,7 @@ module GraphQL
5
5
  # @param schema_class [Class<GraphQL::Schema>]
6
6
  # @return [Module] A helpers module which always uses the given schema
7
7
  def self.for(schema_class)
8
- Module.new do
9
- include SchemaHelpers
10
- @@schema_class_for_helpers = schema_class
11
- end
8
+ SchemaHelpers.for(schema_class)
12
9
  end
13
10
 
14
11
  class Error < GraphQL::Error
@@ -119,6 +116,13 @@ module GraphQL
119
116
  # schema will be added later
120
117
  super(nil, *args, **kwargs, &block)
121
118
  end
119
+
120
+ def self.for(schema_class)
121
+ Module.new do
122
+ include SchemaHelpers
123
+ @@schema_class_for_helpers = schema_class
124
+ end
125
+ end
122
126
  end
123
127
  end
124
128
  end
@@ -16,8 +16,8 @@ module GraphQL
16
16
  "execute_query_lazy" => "graphql.execute"
17
17
  }.each do |trace_method, platform_key|
18
18
  module_eval <<-RUBY, __FILE__, __LINE__
19
- def #{trace_method}(**data, &block)
20
- instrument_execution("#{platform_key}", "#{trace_method}", data, &block)
19
+ def #{trace_method}(**data)
20
+ instrument_execution("#{platform_key}", "#{trace_method}", data) { super }
21
21
  end
22
22
  RUBY
23
23
  end
@@ -64,9 +64,10 @@ module GraphQL
64
64
  return yield unless Sentry.initialized?
65
65
 
66
66
  Sentry.with_child_span(op: platform_key, start_timestamp: Sentry.utc_now.to_f) do |span|
67
- result = block.call
68
- span.finish
67
+ result = yield
68
+ return result unless span
69
69
 
70
+ span.finish
70
71
  if trace_method == "execute_multiplex" && data.key?(:multiplex)
71
72
  operation_names = data[:multiplex].queries.map{|q| operation_name(q) }
72
73
  span.set_description(operation_names.join(", "))
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.2.7"
3
+ VERSION = "2.2.8"
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.2.7
4
+ version: 2.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-29 00:00:00.000000000 Z
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -386,7 +386,6 @@ files:
386
386
  - lib/graphql/schema/addition.rb
387
387
  - lib/graphql/schema/always_visible.rb
388
388
  - lib/graphql/schema/argument.rb
389
- - lib/graphql/schema/base_64_bp.rb
390
389
  - lib/graphql/schema/base_64_encoder.rb
391
390
  - lib/graphql/schema/build_from_definition.rb
392
391
  - lib/graphql/schema/build_from_definition/resolve_map.rb
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'base64'
4
-
5
- # backport from ruby v2.5 to v2.2 that has no `padding` things
6
- # @api private
7
- module Base64Bp
8
- extend Base64
9
-
10
- module_function
11
-
12
- def urlsafe_encode64(bin, padding:)
13
- str = strict_encode64(bin)
14
- str.tr!("+/", "-_")
15
- str.delete!("=") unless padding
16
- str
17
- end
18
-
19
- def urlsafe_decode64(str)
20
- str = str.tr("-_", "+/")
21
- if !str.end_with?("=") && str.length % 4 != 0
22
- str = str.ljust((str.length + 3) & ~3, "=")
23
- end
24
- strict_decode64(str)
25
- end
26
- end