graphql 2.2.7 → 2.2.8
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 +4 -4
- data/lib/graphql/execution/interpreter.rb +3 -3
- data/lib/graphql/schema/base_64_encoder.rb +3 -5
- data/lib/graphql/schema/unique_within_type.rb +1 -1
- data/lib/graphql/testing/helpers.rb +8 -4
- data/lib/graphql/tracing/sentry_trace.rb +5 -4
- data/lib/graphql/version.rb +1 -1
- metadata +2 -3
- data/lib/graphql/schema/base_64_bp.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a58a3c98ecdee8503c62c2bab39d34c0b91ba0b84401b10e1e5fc80afcf8e81
|
4
|
+
data.tar.gz: 1287f3143845004cde0c7c031ebb6d18ee2370835bca23a6a7c3ed0d6d53c81a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
13
|
+
Base64.urlsafe_decode64(encoded_text)
|
16
14
|
rescue ArgumentError
|
17
15
|
raise GraphQL::ExecutionError, "Invalid input: #{encoded_text.inspect}"
|
18
16
|
end
|
@@ -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
|
-
|
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
|
20
|
-
instrument_execution("#{platform_key}", "#{trace_method}", data
|
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 =
|
68
|
-
span
|
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(", "))
|
data/lib/graphql/version.rb
CHANGED
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.
|
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-
|
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
|