Skip to content

Commit a2257de

Browse files
author
Robert Mosolgo
authored
Merge pull request rmosolgo#3292 from rmosolgo/graphql-deprecation-warn
Add GraphQL::Deprecation.warn
2 parents dcaf891 + 8a471af commit a2257de

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+97
-62
lines changed

lib/graphql.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def match?(pattern)
149149
require "graphql/unauthorized_field_error"
150150
require "graphql/load_application_object_failed_error"
151151
require "graphql/dataloader"
152-
152+
require "graphql/deprecation"
153153

154154
module GraphQL
155155
# Ruby has `deprecate_constant`,

lib/graphql/analysis/analyze_query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def analyze_multiplex(multiplex, analyzers)
4343
# @param analyzers [Array<#call>] Objects that respond to `#call(memo, visit_type, irep_node)`
4444
# @return [Array<Any>] Results from those analyzers
4545
def analyze_query(query, analyzers, multiplex_states: [])
46-
warn "Legacy analysis will be removed in GraphQL-Ruby 2.0, please upgrade to AST Analysis: https://graphql-ruby.org/queries/ast_analysis.html (schema: #{query.schema})"
46+
GraphQL::Deprecation.warn "Legacy analysis will be removed in GraphQL-Ruby 2.0, please upgrade to AST Analysis: https://graphql-ruby.org/queries/ast_analysis.html (schema: #{query.schema})"
4747

4848
query.trace("analyze_query", { query: query }) do
4949
analyzers_to_run = analyzers.select do |analyzer|

lib/graphql/analysis/ast.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ module AST
1515
def use(schema_class)
1616
if schema_class.analysis_engine == self
1717
definition_line = caller(2, 1).first
18-
warn("GraphQL::Analysis::AST is now the default; remove `use GraphQL::Analysis::AST` from the schema definition (#{definition_line})")
18+
GraphQL::Deprecation.warn("GraphQL::Analysis::AST is now the default; remove `use GraphQL::Analysis::AST` from the schema definition (#{definition_line})")
1919
else
2020
schema_class.analysis_engine = self
2121
end

lib/graphql/backwards_compatibility.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def wrap_arity(callable, from:, to:, name:, last: false)
2222
backtrace = caller(0, 20)
2323
# Find the first line in the trace that isn't library internals:
2424
user_line = backtrace.find {|l| l !~ /lib\/graphql/ }
25-
warn(message + "\n" + user_line + "\n")
25+
GraphQL::Deprecation.warn(message + "\n" + user_line + "\n")
2626
wrapper = last ? LastArgumentsWrapper : FirstArgumentsWrapper
2727
wrapper.new(callable, from)
2828
else

lib/graphql/base_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def list?
224224
private
225225

226226
def warn_deprecated_coerce(alt_method_name)
227-
warn("Coercing without a context is deprecated; use `#{alt_method_name}` if you don't want context-awareness")
227+
GraphQL::Deprecation.warn("Coercing without a context is deprecated; use `#{alt_method_name}` if you don't want context-awareness")
228228
end
229229
end
230230
end

lib/graphql/compatibility/execution_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module ExecutionSpecification
3232
# @param execution_strategy [<#new, #execute>] An execution strategy class
3333
# @return [Class<Minitest::Test>] A test suite for this execution strategy
3434
def self.build_suite(execution_strategy)
35-
warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
35+
GraphQL::Deprecation.warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
3636
Class.new(Minitest::Test) do
3737
class << self
3838
attr_accessor :counter_schema, :specification_schema

lib/graphql/compatibility/lazy_execution_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module LazyExecutionSpecification
77
# @param execution_strategy [<#new, #execute>] An execution strategy class
88
# @return [Class<Minitest::Test>] A test suite for this execution strategy
99
def self.build_suite(execution_strategy)
10-
warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
10+
GraphQL::Deprecation.warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
1111

1212
Class.new(Minitest::Test) do
1313
class << self

lib/graphql/compatibility/query_parser_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module QueryParserSpecification
1111
# @yieldreturn [GraphQL::Language::Nodes::Document]
1212
# @return [Class<Minitest::Test>] A test suite for this parse function
1313
def self.build_suite(&block)
14-
warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
14+
GraphQL::Deprecation.warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
1515

1616
Class.new(Minitest::Test) do
1717
include QueryAssertions

lib/graphql/compatibility/schema_parser_specification.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module SchemaParserSpecification
88
# @yieldreturn [GraphQL::Language::Nodes::Document]
99
# @return [Class<Minitest::Test>] A test suite for this parse function
1010
def self.build_suite(&block)
11-
warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
11+
GraphQL::Deprecation.warn "#{self} will be removed from GraphQL-Ruby 2.0. There is no replacement, please open an issue on GitHub if you need support."
1212

1313
Class.new(Minitest::Test) do
1414
@@parse_fn = block

lib/graphql/define/assign_global_id_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Define
44
module AssignGlobalIdField
55
def self.call(type_defn, field_name, **field_kwargs)
66
resolve = GraphQL::Relay::GlobalIdResolve.new(type: type_defn)
7-
GraphQL::Define::AssignObjectField.call(type_defn, field_name, **field_kwargs, type: GraphQL::DEPRECATED_ID_TYPE.to_non_null_type, resolve: resolve)
7+
GraphQL::Define::AssignObjectField.call(type_defn, field_name, **field_kwargs, type: GraphQL::Deprecation_ID_TYPE.to_non_null_type, resolve: resolve)
88
end
99
end
1010
end

lib/graphql/define/instance_definable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def define(**kwargs, &block)
1111
end
1212

1313
if deprecated_caller
14-
warn <<-ERR
14+
GraphQL::Deprecation.warn <<-ERR
1515
#{self}.define will be removed in GraphQL-Ruby 2.0; use a class-based definition instead. See https://graphql-ruby.org/schema/class_based_api.html.
1616
-> called from #{deprecated_caller}
1717
ERR

lib/graphql/define/type_definer.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ module Define
77
class TypeDefiner
88
include Singleton
99
# rubocop:disable Naming/MethodName
10-
def Int; GraphQL::DEPRECATED_INT_TYPE; end
11-
def String; GraphQL::DEPRECATED_STRING_TYPE; end
12-
def Float; GraphQL::DEPRECATED_FLOAT_TYPE; end
13-
def Boolean; GraphQL::DEPRECATED_BOOLEAN_TYPE; end
14-
def ID; GraphQL::DEPRECATED_ID_TYPE; end
10+
def Int; GraphQL::Deprecation_INT_TYPE; end
11+
def String; GraphQL::Deprecation_STRING_TYPE; end
12+
def Float; GraphQL::Deprecation_FLOAT_TYPE; end
13+
def Boolean; GraphQL::Deprecation_BOOLEAN_TYPE; end
14+
def ID; GraphQL::Deprecation_ID_TYPE; end
1515
# rubocop:enable Naming/MethodName
1616

1717
# Make a {ListType} which wraps the input type

lib/graphql/deprecated_dsl.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ module GraphQL
44
#
55
# 1. Scoped by file (CRuby only), add to the top of the file:
66
#
7-
# using GraphQL::DeprecatedDSL
7+
# using GraphQL::DeprecationDSL
88
#
99
# (This is a "refinement", there are also other ways to scope it.)
1010
#
1111
# 2. Global application, add before schema definition:
1212
#
13-
# GraphQL::DeprecatedDSL.activate
13+
# GraphQL::DeprecationDSL.activate
1414
#
1515
module DeprecatedDSL
1616
TYPE_CLASSES = [
@@ -24,7 +24,7 @@ module DeprecatedDSL
2424

2525
def self.activate
2626
deprecated_caller = caller(1, 1).first
27-
warn "DeprecatedDSL will be removed from GraphQL-Ruby 2.0, use `.to_non_null_type` instead of `!` and remove `.activate` from #{deprecated_caller}"
27+
GraphQL::Deprecation.warn "DeprecatedDSL will be removed from GraphQL-Ruby 2.0, use `.to_non_null_type` instead of `!` and remove `.activate` from #{deprecated_caller}"
2828
TYPE_CLASSES.each { |c| c.extend(Methods) }
2929
GraphQL::Schema::List.include(Methods)
3030
GraphQL::Schema::NonNull.include(Methods)
@@ -33,7 +33,7 @@ def self.activate
3333
module Methods
3434
def !
3535
deprecated_caller = caller(1, 1).first
36-
warn "DeprecatedDSL will be removed from GraphQL-Ruby 2.0, use `.to_non_null_type` instead of `!` at #{deprecated_caller}"
36+
GraphQL::Deprecation.warn "DeprecatedDSL will be removed from GraphQL-Ruby 2.0, use `.to_non_null_type` instead of `!` at #{deprecated_caller}"
3737
to_non_null_type
3838
end
3939
end

lib/graphql/deprecation.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# frozen_string_literal: true
2+
3+
module GraphQL
4+
module Deprecation
5+
def self.warn(message)
6+
if defined?(ActiveSupport::Deprecation)
7+
ActiveSupport::Deprecation.warn(message)
8+
else
9+
Kernel.warn(message)
10+
end
11+
end
12+
end
13+
end

lib/graphql/execution/errors.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Errors
2020
def self.use(schema)
2121
if schema.plugins.any? { |(plugin, kwargs)| plugin == self }
2222
definition_line = caller(2, 1).first
23-
warn("GraphQL::Execution::Errors is now installed by default, remove `use GraphQL::Execution::Errors` from #{definition_line}")
23+
GraphQL::Deprecation.warn("GraphQL::Execution::Errors is now installed by default, remove `use GraphQL::Execution::Errors` from #{definition_line}")
2424
end
2525
schema.error_handler = self.new(schema)
2626
end

lib/graphql/execution/execute.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def self.use(schema_class)
2525
end
2626

2727
def execute(ast_operation, root_type, query)
28-
warn "#{self.class} will be removed in GraphQL-Ruby 2.0, please upgrade to the Interpreter: https://graphql-ruby.org/queries/interpreter.html"
28+
GraphQL::Deprecation.warn "#{self.class} will be removed in GraphQL-Ruby 2.0, please upgrade to the Interpreter: https://graphql-ruby.org/queries/interpreter.html"
2929
result = resolve_root_selection(query)
3030
lazy_resolve_root_selection(result, **{query: query})
3131
GraphQL::Execution::Flatten.call(query.context)

lib/graphql/execution/interpreter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def execute(_operation, _root_type, query)
2525
def self.use(schema_class)
2626
if schema_class.interpreter?
2727
definition_line = caller(2, 1).first
28-
warn("GraphQL::Execution::Interpreter is now the default; remove `use GraphQL::Execution::Interpreter` from the schema definition (#{definition_line})")
28+
GraphQL::Deprecation.warn("GraphQL::Execution::Interpreter is now the default; remove `use GraphQL::Execution::Interpreter` from the schema definition (#{definition_line})")
2929
else
3030
schema_class.query_execution_strategy(self)
3131
schema_class.mutation_execution_strategy(self)

lib/graphql/execution/multiplex.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def finish_query(data_result, query, multiplex)
156156

157157
# use the old `query_execution_strategy` etc to run this query
158158
def run_one_legacy(schema, query)
159-
warn "Multiplex.run_one_legacy will be removed from GraphQL-Ruby 2.0, upgrade to the Interpreter to avoid this deprecated codepath: https://graphql-ruby.org/queries/interpreter.html"
159+
GraphQL::Deprecation.warn "Multiplex.run_one_legacy will be removed from GraphQL-Ruby 2.0, upgrade to the Interpreter to avoid this deprecated codepath: https://graphql-ruby.org/queries/interpreter.html"
160160

161161
query.result_values = if !query.valid?
162162
all_errors = query.validation_errors + query.analysis_errors + query.context.errors

lib/graphql/function.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module GraphQL
33
# @api deprecated
44
class Function
55
def self.inherited(subclass)
6-
warn "GraphQL::Function (used for #{subclass}) will be removed from GraphQL-Ruby 2.0, please upgrade to resolvers: https://graphql-ruby.org/fields/resolvers.html"
6+
GraphQL::Deprecation.warn "GraphQL::Function (used for #{subclass}) will be removed from GraphQL-Ruby 2.0, please upgrade to resolvers: https://graphql-ruby.org/fields/resolvers.html"
77
end
88

99
# @return [Hash<String => GraphQL::Argument>] Arguments, keyed by name

lib/graphql/internal_representation/document.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ def initialize
1414
end
1515

1616
def [](key)
17-
warn "#{self.class}#[] is deprecated; use `operation_definitions[]` instead"
17+
GraphQL::Deprecation.warn "#{self.class}#[] is deprecated; use `operation_definitions[]` instead"
1818
operation_definitions[key]
1919
end
2020

2121
def each(&block)
22-
warn "#{self.class}#each is deprecated; use `operation_definitions.each` instead"
22+
GraphQL::Deprecation.warn "#{self.class}#each is deprecated; use `operation_definitions.each` instead"
2323
operation_definitions.each(&block)
2424
end
2525
end

lib/graphql/internal_representation/rewrite.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def initialize(*)
6060

6161
# @return [Hash<String, Node>] Roots of this query
6262
def operations
63-
warn "#{self.class}#operations is deprecated; use `document.operation_definitions` instead"
63+
GraphQL::Deprecation.warn "#{self.class}#operations is deprecated; use `document.operation_definitions` instead"
6464
@document.operation_definitions
6565
end
6666

lib/graphql/pagination/connections.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ImplementationMissingError < GraphQL::Error
2323

2424
def self.use(schema_defn)
2525
if schema_defn.plugins.any? { |(plugin, args)| plugin == self }
26-
warn("#{self} is now the default, remove `use #{self}` from #{caller(2,1).first}")
26+
GraphQL::Deprecation.warn("#{self} is now the default, remove `use #{self}` from #{caller(2,1).first}")
2727
end
2828
schema_defn.connections = self.new(schema: schema_defn)
2929
end

lib/graphql/query/arguments.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def self.construct_arguments_class(argument_owner)
2222
method_names.each do |method_name|
2323
# Don't define a helper method if it would override something.
2424
if method_defined?(method_name)
25-
warn(
25+
GraphQL::Deprecation.warn(
2626
"Unable to define a helper for argument with name '#{method_name}' "\
2727
"as this is a reserved name. Add `method_access: false` to stop this warning."
2828
)

lib/graphql/query/serial_execution.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SerialExecution
1616
# @param query_object [GraphQL::Query] the query object for this execution
1717
# @return [Hash] a spec-compliant GraphQL result, as a hash
1818
def execute(ast_operation, root_type, query_object)
19-
warn "#{self.class} will be removed in GraphQL-Ruby 2.0, please upgrade to the Interpreter: https://graphql-ruby.org/queries/interpreter.html"
19+
GraphQL::Deprecation.warn "#{self.class} will be removed in GraphQL-Ruby 2.0, please upgrade to the Interpreter: https://graphql-ruby.org/queries/interpreter.html"
2020
operation_resolution.resolve(
2121
query_object.irep_selection,
2222
root_type,

lib/graphql/relay/base_connection.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ def register_connection_implementation(nodes_class, connection_class)
5959
# @param parent [Object] The object which this collection belongs to
6060
# @param context [GraphQL::Query::Context] The context from the field being resolved
6161
def initialize(nodes, arguments, field: nil, max_page_size: nil, parent: nil, context: nil)
62-
warn "GraphQL::Relay::BaseConnection (used for #{self.class}) will be removed from GraphQL-Ruby 2.0, use GraphQL::Pagination::Connections instead: https://graphql-ruby.org/pagination/overview.html"
62+
GraphQL::Deprecation.warn "GraphQL::Relay::BaseConnection (used for #{self.class}) will be removed from GraphQL-Ruby 2.0, use GraphQL::Pagination::Connections instead: https://graphql-ruby.org/pagination/overview.html"
6363

6464
deprecated_caller = caller(0, 10).find { |c| !c.include?("lib/graphql") }
6565
if deprecated_caller
66-
warn " -> called from #{deprecated_caller}"
66+
GraphQL::Deprecation.warn " -> called from #{deprecated_caller}"
6767
end
6868

6969
@context = context

lib/graphql/relay/connection_instrumentation.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module ConnectionInstrumentation
1010
def self.default_arguments
1111
@default_arguments ||= begin
1212
argument_definitions = [
13-
["first", GraphQL::DEPRECATED_INT_TYPE, "Returns the first _n_ elements from the list."],
14-
["after", GraphQL::DEPRECATED_STRING_TYPE, "Returns the elements in the list that come after the specified cursor."],
15-
["last", GraphQL::DEPRECATED_INT_TYPE, "Returns the last _n_ elements from the list."],
16-
["before", GraphQL::DEPRECATED_STRING_TYPE, "Returns the elements in the list that come before the specified cursor."],
13+
["first", GraphQL::Deprecation_INT_TYPE, "Returns the first _n_ elements from the list."],
14+
["after", GraphQL::Deprecation_STRING_TYPE, "Returns the elements in the list that come after the specified cursor."],
15+
["last", GraphQL::Deprecation_INT_TYPE, "Returns the last _n_ elements from the list."],
16+
["before", GraphQL::Deprecation_STRING_TYPE, "Returns the elements in the list that come before the specified cursor."],
1717
]
1818

1919
argument_definitions.reduce({}) do |memo, arg_defn|

lib/graphql/relay/mutation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class Mutation
3030
alias :input_fields :arguments
3131

3232
def initialize
33-
warn "GraphQL::Relay::Mutation will be removed from GraphQL-Ruby 2.0, use GraphQL::Schema::RelayClassicMutation instead: https://graphql-ruby.org/mutations/mutation_classes"
33+
GraphQL::Deprecation.warn "GraphQL::Relay::Mutation will be removed from GraphQL-Ruby 2.0, use GraphQL::Schema::RelayClassicMutation instead: https://graphql-ruby.org/mutations/mutation_classes"
3434
@fields = {}
3535
@arguments = {}
3636
@has_generated_return_type = false

lib/graphql/relay/node.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module Relay
55
module Node
66
# @return [GraphQL::Field] a field for finding objects by their global ID.
77
def self.field(**kwargs, &block)
8-
warn "GraphQL::Relay::Node.field will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::NodeField instead"
8+
GraphQL::Deprecation.warn "GraphQL::Relay::Node.field will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::NodeField instead"
99
# We have to define it fresh each time because
1010
# its name will be modified and its description
1111
# _may_ be modified.
@@ -19,7 +19,7 @@ def self.field(**kwargs, &block)
1919
end
2020

2121
def self.plural_field(**kwargs, &block)
22-
warn "GraphQL::Relay::Nodes.field will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::NodesField instead"
22+
GraphQL::Deprecation.warn "GraphQL::Relay::Nodes.field will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::NodesField instead"
2323
field = GraphQL::Types::Relay::NodesField.graphql_definition
2424

2525
if kwargs.any? || block
@@ -31,7 +31,7 @@ def self.plural_field(**kwargs, &block)
3131

3232
# @return [GraphQL::InterfaceType] The interface which all Relay types must implement
3333
def self.interface
34-
warn "GraphQL::Relay::Node.interface will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::Node instead"
34+
GraphQL::Deprecation.warn "GraphQL::Relay::Node.interface will be removed from GraphQL-Ruby 2.0, use GraphQL::Types::Relay::Node instead"
3535
@interface ||= GraphQL::Types::Relay::Node.graphql_definition
3636
end
3737
end

lib/graphql/relay/type_extensions.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def connection_type
1212
# Define a custom connection type for this object type
1313
# @return [GraphQL::ObjectType]
1414
def define_connection(**kwargs, &block)
15-
warn ".connection_type and .define_connection will be removed from GraphQL-Ruby 2.0, use class-based type definitions instead: https://graphql-ruby.org/schema/class_based_api.html"
15+
GraphQL::Deprecation.warn ".connection_type and .define_connection will be removed from GraphQL-Ruby 2.0, use class-based type definitions instead: https://graphql-ruby.org/schema/class_based_api.html"
1616
GraphQL::Relay::ConnectionType.create_type(self, **kwargs, &block)
1717
end
1818

@@ -24,7 +24,7 @@ def edge_type
2424
# Define a custom edge type for this object type
2525
# @return [GraphQL::ObjectType]
2626
def define_edge(**kwargs, &block)
27-
warn ".edge_type and .define_edge will be removed from GraphQL-Ruby 2.0, use class-based type definitions instead: https://graphql-ruby.org/schema/class_based_api.html"
27+
GraphQL::Deprecation.warn ".edge_type and .define_edge will be removed from GraphQL-Ruby 2.0, use class-based type definitions instead: https://graphql-ruby.org/schema/class_based_api.html"
2828
GraphQL::Relay::EdgeType.create_type(self, **kwargs, &block)
2929
end
3030
end

0 commit comments

Comments
 (0)