lib/graphql/execution/interpreter.rb in graphql-1.11.10 vs lib/graphql/execution/interpreter.rb in graphql-1.12.0
- old
+ new
@@ -1,6 +1,7 @@
# frozen_string_literal: true
+require "fiber"
require "graphql/execution/interpreter/argument_value"
require "graphql/execution/interpreter/arguments"
require "graphql/execution/interpreter/arguments_cache"
require "graphql/execution/interpreter/execution_errors"
require "graphql/execution/interpreter/hash_response"
@@ -20,15 +21,18 @@
sync_lazies(query: query)
runtime.final_value
end
def self.use(schema_class)
- schema_class.interpreter = true
- schema_class.query_execution_strategy(GraphQL::Execution::Interpreter)
- schema_class.mutation_execution_strategy(GraphQL::Execution::Interpreter)
- schema_class.subscription_execution_strategy(GraphQL::Execution::Interpreter)
- schema_class.add_subscription_extension_if_necessary
- GraphQL::Schema::Object.include(HandlesRawValue)
+ if schema_class.interpreter?
+ definition_line = caller(2, 1).first
+ warn("GraphQL::Execution::Interpreter is now the default; remove `use GraphQL::Execution::Interpreter` from the schema definition (#{definition_line})")
+ else
+ schema_class.query_execution_strategy(self)
+ schema_class.mutation_execution_strategy(self)
+ schema_class.subscription_execution_strategy(self)
+ schema_class.add_subscription_extension_if_necessary
+ end
end
def self.begin_multiplex(multiplex)
# Since this is basically the batching context,
# share it for a whole multiplex