graphql 1.12.0 → 1.12.5
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/generators/graphql/install_generator.rb +4 -1
- data/lib/generators/graphql/loader_generator.rb +1 -0
- data/lib/generators/graphql/mutation_generator.rb +1 -0
- data/lib/generators/graphql/relay.rb +55 -0
- data/lib/generators/graphql/relay_generator.rb +4 -46
- data/lib/generators/graphql/type_generator.rb +1 -0
- data/lib/graphql.rb +2 -2
- data/lib/graphql/analysis/analyze_query.rb +1 -1
- data/lib/graphql/analysis/ast.rb +1 -1
- data/lib/graphql/backtrace/inspect_result.rb +0 -1
- data/lib/graphql/backtrace/table.rb +0 -1
- data/lib/graphql/backtrace/traced_error.rb +0 -1
- data/lib/graphql/backtrace/tracer.rb +4 -8
- data/lib/graphql/backwards_compatibility.rb +1 -1
- data/lib/graphql/base_type.rb +1 -1
- data/lib/graphql/compatibility/execution_specification.rb +1 -1
- data/lib/graphql/compatibility/lazy_execution_specification.rb +1 -1
- data/lib/graphql/compatibility/query_parser_specification.rb +1 -1
- data/lib/graphql/compatibility/schema_parser_specification.rb +1 -1
- data/lib/graphql/dataloader.rb +102 -91
- data/lib/graphql/dataloader/null_dataloader.rb +5 -5
- data/lib/graphql/dataloader/request.rb +1 -6
- data/lib/graphql/dataloader/request_all.rb +1 -4
- data/lib/graphql/dataloader/source.rb +20 -6
- data/lib/graphql/define/instance_definable.rb +1 -1
- data/lib/graphql/deprecated_dsl.rb +4 -4
- data/lib/graphql/deprecation.rb +13 -0
- data/lib/graphql/execution/errors.rb +1 -1
- data/lib/graphql/execution/execute.rb +1 -1
- data/lib/graphql/execution/interpreter.rb +3 -3
- data/lib/graphql/execution/interpreter/arguments_cache.rb +37 -14
- data/lib/graphql/execution/interpreter/resolve.rb +33 -25
- data/lib/graphql/execution/interpreter/runtime.rb +38 -74
- data/lib/graphql/execution/multiplex.rb +22 -23
- data/lib/graphql/function.rb +1 -1
- data/lib/graphql/internal_representation/document.rb +2 -2
- data/lib/graphql/internal_representation/rewrite.rb +1 -1
- data/lib/graphql/object_type.rb +0 -2
- data/lib/graphql/pagination/connection.rb +9 -0
- data/lib/graphql/pagination/connections.rb +1 -1
- data/lib/graphql/parse_error.rb +0 -1
- data/lib/graphql/query.rb +8 -2
- data/lib/graphql/query/arguments.rb +1 -1
- data/lib/graphql/query/arguments_cache.rb +0 -1
- data/lib/graphql/query/context.rb +1 -3
- data/lib/graphql/query/executor.rb +0 -1
- data/lib/graphql/query/null_context.rb +3 -2
- data/lib/graphql/query/serial_execution.rb +1 -1
- data/lib/graphql/query/variable_validation_error.rb +1 -1
- data/lib/graphql/relay/base_connection.rb +2 -2
- data/lib/graphql/relay/mutation.rb +1 -1
- data/lib/graphql/relay/node.rb +3 -3
- data/lib/graphql/relay/range_add.rb +10 -5
- data/lib/graphql/relay/type_extensions.rb +2 -2
- data/lib/graphql/schema.rb +14 -13
- data/lib/graphql/schema/argument.rb +61 -0
- data/lib/graphql/schema/field.rb +12 -7
- data/lib/graphql/schema/find_inherited_value.rb +3 -1
- data/lib/graphql/schema/input_object.rb +6 -2
- data/lib/graphql/schema/member/has_arguments.rb +43 -56
- data/lib/graphql/schema/member/has_fields.rb +1 -4
- data/lib/graphql/schema/member/instrumentation.rb +0 -1
- data/lib/graphql/schema/middleware_chain.rb +1 -1
- data/lib/graphql/schema/resolver.rb +28 -1
- data/lib/graphql/schema/timeout_middleware.rb +1 -1
- data/lib/graphql/schema/validation.rb +2 -2
- data/lib/graphql/static_validation/validator.rb +4 -2
- data/lib/graphql/subscriptions/event.rb +0 -1
- data/lib/graphql/subscriptions/instrumentation.rb +0 -1
- data/lib/graphql/subscriptions/serialize.rb +0 -1
- data/lib/graphql/subscriptions/subscription_root.rb +1 -1
- data/lib/graphql/tracing/skylight_tracing.rb +1 -1
- data/lib/graphql/upgrader/member.rb +1 -1
- data/lib/graphql/upgrader/schema.rb +1 -1
- data/lib/graphql/version.rb +1 -1
- data/readme.md +1 -1
- metadata +22 -90
@@ -236,6 +236,67 @@ module GraphQL
|
|
236
236
|
end
|
237
237
|
end
|
238
238
|
|
239
|
+
# @api private
|
240
|
+
def coerce_into_values(parent_object, values, context, argument_values)
|
241
|
+
arg_name = graphql_name
|
242
|
+
arg_key = keyword
|
243
|
+
has_value = false
|
244
|
+
default_used = false
|
245
|
+
if values.key?(arg_name)
|
246
|
+
has_value = true
|
247
|
+
value = values[arg_name]
|
248
|
+
elsif values.key?(arg_key)
|
249
|
+
has_value = true
|
250
|
+
value = values[arg_key]
|
251
|
+
elsif default_value?
|
252
|
+
has_value = true
|
253
|
+
value = default_value
|
254
|
+
default_used = true
|
255
|
+
end
|
256
|
+
|
257
|
+
if has_value
|
258
|
+
loaded_value = nil
|
259
|
+
coerced_value = context.schema.error_handler.with_error_handling(context) do
|
260
|
+
type.coerce_input(value, context)
|
261
|
+
end
|
262
|
+
|
263
|
+
# TODO this should probably be inside after_lazy
|
264
|
+
if loads && !from_resolver?
|
265
|
+
loaded_value = if type.list?
|
266
|
+
loaded_values = coerced_value.map { |val| owner.load_application_object(self, loads, val, context) }
|
267
|
+
context.schema.after_any_lazies(loaded_values) { |result| result }
|
268
|
+
else
|
269
|
+
owner.load_application_object(self, loads, coerced_value, context)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
coerced_value = if loaded_value
|
274
|
+
loaded_value
|
275
|
+
else
|
276
|
+
coerced_value
|
277
|
+
end
|
278
|
+
|
279
|
+
# If this isn't lazy, then the block returns eagerly and assigns the result here
|
280
|
+
# If it _is_ lazy, then we write the lazy to the hash, then update it later
|
281
|
+
argument_values[arg_key] = context.schema.after_lazy(coerced_value) do |coerced_value|
|
282
|
+
owner.validate_directive_argument(self, coerced_value)
|
283
|
+
prepared_value = context.schema.error_handler.with_error_handling(context) do
|
284
|
+
prepare_value(parent_object, coerced_value, context: context)
|
285
|
+
end
|
286
|
+
|
287
|
+
# TODO code smell to access such a deeply-nested constant in a distant module
|
288
|
+
argument_values[arg_key] = GraphQL::Execution::Interpreter::ArgumentValue.new(
|
289
|
+
value: prepared_value,
|
290
|
+
definition: self,
|
291
|
+
default_used: default_used,
|
292
|
+
)
|
293
|
+
end
|
294
|
+
else
|
295
|
+
# has_value is false
|
296
|
+
owner.validate_directive_argument(self, nil)
|
297
|
+
end
|
298
|
+
end
|
299
|
+
|
239
300
|
private
|
240
301
|
|
241
302
|
def validate_input_type(input_type)
|
data/lib/graphql/schema/field.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
# test_via: ../object.rb
|
3
2
|
require "graphql/schema/field/connection_extension"
|
4
3
|
require "graphql/schema/field/scope_extension"
|
5
4
|
|
@@ -61,6 +60,10 @@ module GraphQL
|
|
61
60
|
@introspection
|
62
61
|
end
|
63
62
|
|
63
|
+
def inspect
|
64
|
+
"#<#{self.class} #{path}#{arguments.any? ? "(...)" : ""}: #{type.to_type_signature}>"
|
65
|
+
end
|
66
|
+
|
64
67
|
alias :mutation :resolver
|
65
68
|
|
66
69
|
# @return [Boolean] Apply tracing to this field? (Default: skip scalars, this is the override value)
|
@@ -83,10 +86,10 @@ module GraphQL
|
|
83
86
|
def self.from_options(name = nil, type = nil, desc = nil, resolver: nil, mutation: nil, subscription: nil,**kwargs, &block)
|
84
87
|
if kwargs[:field]
|
85
88
|
if kwargs[:field].is_a?(GraphQL::Field) && kwargs[:field] == GraphQL::Types::Relay::NodeField.graphql_definition
|
86
|
-
warn("Legacy-style `GraphQL::Relay::Node.field` is being added to a class-based type. See `GraphQL::Types::Relay::NodeField` for a replacement.")
|
89
|
+
GraphQL::Deprecation.warn("Legacy-style `GraphQL::Relay::Node.field` is being added to a class-based type. See `GraphQL::Types::Relay::NodeField` for a replacement.")
|
87
90
|
return GraphQL::Types::Relay::NodeField
|
88
91
|
elsif kwargs[:field].is_a?(GraphQL::Field) && kwargs[:field] == GraphQL::Types::Relay::NodesField.graphql_definition
|
89
|
-
warn("Legacy-style `GraphQL::Relay::Node.plural_field` is being added to a class-based type. See `GraphQL::Types::Relay::NodesField` for a replacement.")
|
92
|
+
GraphQL::Deprecation.warn("Legacy-style `GraphQL::Relay::Node.plural_field` is being added to a class-based type. See `GraphQL::Types::Relay::NodesField` for a replacement.")
|
90
93
|
return GraphQL::Types::Relay::NodesField
|
91
94
|
end
|
92
95
|
end
|
@@ -285,22 +288,24 @@ module GraphQL
|
|
285
288
|
@owner = owner
|
286
289
|
@subscription_scope = subscription_scope
|
287
290
|
|
288
|
-
# Do this last so we have as much context as possible when initializing them:
|
289
291
|
@extensions = EMPTY_ARRAY
|
290
|
-
if extensions.any?
|
291
|
-
self.extensions(extensions)
|
292
|
-
end
|
293
292
|
# This should run before connection extension,
|
294
293
|
# but should it run after the definition block?
|
295
294
|
if scoped?
|
296
295
|
self.extension(ScopeExtension)
|
297
296
|
end
|
297
|
+
|
298
298
|
# The problem with putting this after the definition_block
|
299
299
|
# is that it would override arguments
|
300
300
|
if connection? && connection_extension
|
301
301
|
self.extension(connection_extension)
|
302
302
|
end
|
303
303
|
|
304
|
+
# Do this last so we have as much context as possible when initializing them:
|
305
|
+
if extensions.any?
|
306
|
+
self.extensions(extensions)
|
307
|
+
end
|
308
|
+
|
304
309
|
if directives.any?
|
305
310
|
directives.each do |(dir_class, options)|
|
306
311
|
self.directive(dir_class, **options)
|
@@ -20,7 +20,9 @@ module GraphQL
|
|
20
20
|
if self.is_a?(Class)
|
21
21
|
superclass.respond_to?(method_name, true) ? superclass.send(method_name) : default_value
|
22
22
|
else
|
23
|
-
|
23
|
+
ancestors_except_self = ancestors
|
24
|
+
ancestors_except_self.delete(self)
|
25
|
+
ancestors_except_self.each do |ancestor|
|
24
26
|
if ancestor.respond_to?(method_name, true)
|
25
27
|
return ancestor.send(method_name)
|
26
28
|
end
|
@@ -214,8 +214,12 @@ module GraphQL
|
|
214
214
|
arguments = coerce_arguments(nil, value, ctx)
|
215
215
|
|
216
216
|
ctx.schema.after_lazy(arguments) do |resolved_arguments|
|
217
|
-
|
218
|
-
|
217
|
+
if resolved_arguments.is_a?(GraphQL::Error)
|
218
|
+
raise resolved_arguments
|
219
|
+
else
|
220
|
+
input_obj_instance = self.new(resolved_arguments, ruby_kwargs: resolved_arguments.keyword_arguments, context: ctx, defaults_used: nil)
|
221
|
+
input_obj_instance.prepare
|
222
|
+
end
|
219
223
|
end
|
220
224
|
end
|
221
225
|
|
@@ -81,79 +81,66 @@ module GraphQL
|
|
81
81
|
end
|
82
82
|
|
83
83
|
# @api private
|
84
|
+
# If given a block, it will eventually yield the loaded args to the block.
|
85
|
+
#
|
86
|
+
# If no block is given, it will immediately dataload (but might return a Lazy).
|
87
|
+
#
|
84
88
|
# @param values [Hash<String, Object>]
|
85
89
|
# @param context [GraphQL::Query::Context]
|
86
|
-
# @
|
87
|
-
|
90
|
+
# @yield [Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments>]
|
91
|
+
# @return [Interpreter::Arguments, Execution::Lazy<Interpeter::Arguments>]
|
92
|
+
def coerce_arguments(parent_object, values, context, &block)
|
88
93
|
# Cache this hash to avoid re-merging it
|
89
94
|
arg_defns = self.arguments
|
95
|
+
total_args_count = arg_defns.size
|
90
96
|
|
91
|
-
if
|
92
|
-
GraphQL::Execution::Interpreter::Arguments::EMPTY
|
97
|
+
if total_args_count == 0
|
98
|
+
final_args = GraphQL::Execution::Interpreter::Arguments::EMPTY
|
99
|
+
if block_given?
|
100
|
+
block.call(final_args)
|
101
|
+
nil
|
102
|
+
else
|
103
|
+
final_args
|
104
|
+
end
|
93
105
|
else
|
106
|
+
finished_args = nil
|
94
107
|
argument_values = {}
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
elsif arg_defn.default_value?
|
106
|
-
has_value = true
|
107
|
-
value = arg_defn.default_value
|
108
|
-
default_used = true
|
109
|
-
end
|
110
|
-
|
111
|
-
if has_value
|
112
|
-
loads = arg_defn.loads
|
113
|
-
loaded_value = nil
|
114
|
-
coerced_value = context.schema.error_handler.with_error_handling(context) do
|
115
|
-
arg_defn.type.coerce_input(value, context)
|
116
|
-
end
|
117
|
-
|
118
|
-
# TODO this should probably be inside after_lazy
|
119
|
-
if loads && !arg_defn.from_resolver?
|
120
|
-
loaded_value = if arg_defn.type.list?
|
121
|
-
loaded_values = coerced_value.map { |val| load_application_object(arg_defn, loads, val, context) }
|
122
|
-
context.schema.after_any_lazies(loaded_values) { |result| result }
|
108
|
+
resolved_args_count = 0
|
109
|
+
raised_error = false
|
110
|
+
arg_defns.each do |arg_name, arg_defn|
|
111
|
+
context.dataloader.append_job do
|
112
|
+
begin
|
113
|
+
arg_defn.coerce_into_values(parent_object, values, context, argument_values)
|
114
|
+
rescue GraphQL::ExecutionError, GraphQL::UnauthorizedError => err
|
115
|
+
raised_error = true
|
116
|
+
if block_given?
|
117
|
+
block.call(err)
|
123
118
|
else
|
124
|
-
|
119
|
+
finished_args = err
|
125
120
|
end
|
126
121
|
end
|
127
122
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
123
|
+
resolved_args_count += 1
|
124
|
+
if resolved_args_count == total_args_count && !raised_error
|
125
|
+
finished_args = context.schema.after_any_lazies(argument_values.values) {
|
126
|
+
GraphQL::Execution::Interpreter::Arguments.new(
|
127
|
+
argument_values: argument_values,
|
128
|
+
)
|
129
|
+
}
|
133
130
|
|
134
|
-
|
135
|
-
|
136
|
-
prepared_value = context.schema.error_handler.with_error_handling(context) do
|
137
|
-
arg_defn.prepare_value(parent_object, coerced_value, context: context)
|
131
|
+
if block_given?
|
132
|
+
block.call(finished_args)
|
138
133
|
end
|
139
|
-
|
140
|
-
# TODO code smell to access such a deeply-nested constant in a distant module
|
141
|
-
argument_values[arg_key] = GraphQL::Execution::Interpreter::ArgumentValue.new(
|
142
|
-
value: prepared_value,
|
143
|
-
definition: arg_defn,
|
144
|
-
default_used: default_used,
|
145
|
-
)
|
146
134
|
end
|
147
|
-
else
|
148
|
-
# has_value is false
|
149
|
-
validate_directive_argument(arg_defn, nil)
|
150
135
|
end
|
151
136
|
end
|
152
137
|
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
138
|
+
if block_given?
|
139
|
+
nil
|
140
|
+
else
|
141
|
+
# This API returns eagerly, gotta run it now
|
142
|
+
context.dataloader.run
|
143
|
+
finished_args
|
157
144
|
end
|
158
145
|
end
|
159
146
|
end
|
@@ -74,11 +74,8 @@ module GraphQL
|
|
74
74
|
@field_class = new_field_class
|
75
75
|
elsif defined?(@field_class) && @field_class
|
76
76
|
@field_class
|
77
|
-
elsif self.is_a?(Class)
|
78
|
-
superclass.respond_to?(:field_class) ? superclass.field_class : GraphQL::Schema::Field
|
79
77
|
else
|
80
|
-
|
81
|
-
ancestor ? ancestor.field_class : GraphQL::Schema::Field
|
78
|
+
find_inherited_value(:field_class, GraphQL::Schema::Field)
|
82
79
|
end
|
83
80
|
end
|
84
81
|
|
@@ -71,7 +71,7 @@ module GraphQL
|
|
71
71
|
|
72
72
|
def wrap(callable)
|
73
73
|
if BackwardsCompatibility.get_arity(callable) == 6
|
74
|
-
warn("Middleware that takes a next_middleware parameter is deprecated (#{callable.inspect}); instead, accept a block and use yield.")
|
74
|
+
GraphQL::Deprecation.warn("Middleware that takes a next_middleware parameter is deprecated (#{callable.inspect}); instead, accept a block and use yield.")
|
75
75
|
MiddlewareWrapper.new(callable)
|
76
76
|
else
|
77
77
|
callable
|
@@ -276,8 +276,29 @@ module GraphQL
|
|
276
276
|
end
|
277
277
|
end
|
278
278
|
|
279
|
+
# Get or set the `max_page_size:` which will be configured for fields using this resolver
|
280
|
+
# (`nil` means "unlimited max page size".)
|
281
|
+
# @param max_page_size [Integer, nil] Set a new value
|
282
|
+
# @return [Integer, nil] The `max_page_size` assigned to fields that use this resolver
|
283
|
+
def max_page_size(new_max_page_size = :not_given)
|
284
|
+
if new_max_page_size != :not_given
|
285
|
+
@max_page_size = new_max_page_size
|
286
|
+
elsif defined?(@max_page_size)
|
287
|
+
@max_page_size
|
288
|
+
elsif superclass.respond_to?(:max_page_size)
|
289
|
+
superclass.max_page_size
|
290
|
+
else
|
291
|
+
nil
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
# @return [Boolean] `true` if this resolver or a superclass has an assigned `max_page_size`
|
296
|
+
def has_max_page_size?
|
297
|
+
defined?(@max_page_size) || (superclass.respond_to?(:has_max_page_size?) && superclass.has_max_page_size?)
|
298
|
+
end
|
299
|
+
|
279
300
|
def field_options
|
280
|
-
{
|
301
|
+
field_opts = {
|
281
302
|
type: type_expr,
|
282
303
|
description: description,
|
283
304
|
extras: extras,
|
@@ -289,6 +310,12 @@ module GraphQL
|
|
289
310
|
extensions: extensions,
|
290
311
|
broadcastable: broadcastable?,
|
291
312
|
}
|
313
|
+
|
314
|
+
if has_max_page_size?
|
315
|
+
field_opts[:max_page_size] = max_page_size
|
316
|
+
end
|
317
|
+
|
318
|
+
field_opts
|
292
319
|
end
|
293
320
|
|
294
321
|
# A non-normalized type configuration, without `null` applied
|
@@ -30,7 +30,7 @@ module GraphQL
|
|
30
30
|
def initialize(max_seconds:, context_key: nil, &block)
|
31
31
|
@max_seconds = max_seconds
|
32
32
|
if context_key
|
33
|
-
warn("TimeoutMiddleware's `context_key` is ignored, timeout data is now stored in isolated storage")
|
33
|
+
GraphQL::Deprecation.warn("TimeoutMiddleware's `context_key` is ignored, timeout data is now stored in isolated storage")
|
34
34
|
end
|
35
35
|
@error_handler = block
|
36
36
|
end
|
@@ -203,7 +203,7 @@ module GraphQL
|
|
203
203
|
RESERVED_TYPE_NAME = ->(type) {
|
204
204
|
if type.name.start_with?('__') && !type.introspection?
|
205
205
|
# TODO: make this a hard failure in a later version
|
206
|
-
warn("Name #{type.name.inspect} must not begin with \"__\", which is reserved by GraphQL introspection.")
|
206
|
+
GraphQL::Deprecation.warn("Name #{type.name.inspect} must not begin with \"__\", which is reserved by GraphQL introspection.")
|
207
207
|
nil
|
208
208
|
else
|
209
209
|
# ok name
|
@@ -213,7 +213,7 @@ module GraphQL
|
|
213
213
|
RESERVED_NAME = ->(named_thing) {
|
214
214
|
if named_thing.name.start_with?('__')
|
215
215
|
# TODO: make this a hard failure in a later version
|
216
|
-
warn("Name #{named_thing.name.inspect} must not begin with \"__\", which is reserved by GraphQL introspection.")
|
216
|
+
GraphQL::Deprecation.warn("Name #{named_thing.name.inspect} must not begin with \"__\", which is reserved by GraphQL introspection.")
|
217
217
|
nil
|
218
218
|
else
|
219
219
|
# no worries
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require "timeout"
|
3
|
+
|
2
4
|
module GraphQL
|
3
5
|
module StaticValidation
|
4
6
|
# Initialized with a {GraphQL::Schema}, then it can validate {GraphQL::Language::Nodes::Documents}s based on that schema.
|
@@ -43,8 +45,8 @@ module GraphQL
|
|
43
45
|
unless (legacy_rules = rules_to_use - GraphQL::StaticValidation::ALL_RULES).empty?
|
44
46
|
legacy_rules.each do |rule_class_or_module|
|
45
47
|
if rule_class_or_module.method_defined?(:validate)
|
46
|
-
warn "Legacy validator rules will be removed from GraphQL-Ruby 2.0, use a module instead (see the built-in rules: https://github.com/rmosolgo/graphql-ruby/tree/master/lib/graphql/static_validation/rules)"
|
47
|
-
warn " -> Legacy validator: #{rule_class_or_module}"
|
48
|
+
GraphQL::Deprecation.warn "Legacy validator rules will be removed from GraphQL-Ruby 2.0, use a module instead (see the built-in rules: https://github.com/rmosolgo/graphql-ruby/tree/master/lib/graphql/static_validation/rules)"
|
49
|
+
GraphQL::Deprecation.warn " -> Legacy validator: #{rule_class_or_module}"
|
48
50
|
rule_class_or_module.new.validate(context)
|
49
51
|
end
|
50
52
|
end
|
@@ -6,7 +6,7 @@ module GraphQL
|
|
6
6
|
# @deprecated This module is no longer needed.
|
7
7
|
module SubscriptionRoot
|
8
8
|
def self.extended(child_cls)
|
9
|
-
warn "`extend GraphQL::Subscriptions::SubscriptionRoot` is no longer required; you can remove it from your Subscription type (#{child_cls})"
|
9
|
+
GraphQL::Deprecation.warn "`extend GraphQL::Subscriptions::SubscriptionRoot` is no longer required; you can remove it from your Subscription type (#{child_cls})"
|
10
10
|
child_cls.include(InstanceMethods)
|
11
11
|
end
|
12
12
|
|
@@ -18,7 +18,7 @@ module GraphQL
|
|
18
18
|
# This is not advised if you run more than one query per HTTP request, for example, with `graphql-client` or multiplexing.
|
19
19
|
# It can also be specified per-query with `context[:set_skylight_endpoint_name]`.
|
20
20
|
def initialize(options = {})
|
21
|
-
warn("GraphQL::Tracing::SkylightTracing is deprecated and will be removed in GraphQL-Ruby 2.0, please enable Skylight's GraphQL probe instead: https://www.skylight.io/support/getting-more-from-skylight#graphql.")
|
21
|
+
GraphQL::Deprecation.warn("GraphQL::Tracing::SkylightTracing is deprecated and will be removed in GraphQL-Ruby 2.0, please enable Skylight's GraphQL probe instead: https://www.skylight.io/support/getting-more-from-skylight#graphql.")
|
22
22
|
@set_endpoint_name = options.fetch(:set_endpoint_name, false)
|
23
23
|
super
|
24
24
|
end
|
@@ -771,7 +771,7 @@ module GraphQL
|
|
771
771
|
|
772
772
|
class Member
|
773
773
|
def initialize(member, skip: SkipOnNullKeyword, type_transforms: DEFAULT_TYPE_TRANSFORMS, field_transforms: DEFAULT_FIELD_TRANSFORMS, clean_up_transforms: DEFAULT_CLEAN_UP_TRANSFORMS)
|
774
|
-
warn "#{self.class} will be removed from GraphQL-Ruby 2.0 (but there's no point in using it after you've transformed your code, anyways)"
|
774
|
+
GraphQL::Deprecation.warn "#{self.class} will be removed from GraphQL-Ruby 2.0 (but there's no point in using it after you've transformed your code, anyways)"
|
775
775
|
@member = member
|
776
776
|
@skip = skip
|
777
777
|
@type_transforms = type_transforms
|