Skip to content

Commit 9d6481f

Browse files
committed
Rename execution_next_mode -> execution_mode
1 parent c011759 commit 9d6481f

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

lib/graphql/execution/next/field_resolve_step.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -718,31 +718,31 @@ def build_graphql_result(graphql_result, key, field_result, return_type, is_nn,
718718

719719
def resolve_batch(objects, context, args_hash)
720720
method_receiver = @field_definition.dynamic_introspection ? @field_definition.owner : @parent_type
721-
case @field_definition.execution_next_mode
721+
case @field_definition.execution_mode
722722
when :resolve_batch
723723
begin
724-
method_receiver.public_send(@field_definition.execution_next_mode_key, objects, context, **args_hash)
724+
method_receiver.public_send(@field_definition.execution_mode_key, objects, context, **args_hash)
725725
rescue GraphQL::ExecutionError => exec_err
726726
Array.new(objects.size, exec_err)
727727
end
728728
when :resolve_static
729729
result = begin
730-
method_receiver.public_send(@field_definition.execution_next_mode_key, context, **args_hash)
730+
method_receiver.public_send(@field_definition.execution_mode_key, context, **args_hash)
731731
rescue GraphQL::ExecutionError => err
732732
err
733733
end
734734
Array.new(objects.size, result)
735735
when :resolve_each
736736
objects.map do |o|
737-
method_receiver.public_send(@field_definition.execution_next_mode_key, o, context, **args_hash)
737+
method_receiver.public_send(@field_definition.execution_mode_key, o, context, **args_hash)
738738
rescue GraphQL::ExecutionError => err
739739
err
740740
end
741741
when :hash_key
742-
k = @field_definition.execution_next_mode_key
742+
k = @field_definition.execution_mode_key
743743
objects.map { |o| o[k] }
744744
when :direct_send
745-
m = @field_definition.execution_next_mode_key
745+
m = @field_definition.execution_mode_key
746746
objects.map do |o|
747747
o.public_send(m, **args_hash)
748748
rescue GraphQL::ExecutionError => err
@@ -755,9 +755,9 @@ def resolve_batch(objects, context, args_hash)
755755
end
756756
end
757757
when :dig
758-
objects.map { |o| o.dig(*@field_definition.execution_next_mode_key) }
758+
objects.map { |o| o.dig(*@field_definition.execution_mode_key) }
759759
when :dataload
760-
if (k = @field_definition.execution_next_mode_key).is_a?(Class)
760+
if (k = @field_definition.execution_mode_key).is_a?(Class)
761761
context.dataload_all(k, objects)
762762
elsif (source_class = k[:with])
763763
if (batch_args = k[:by])
@@ -796,12 +796,12 @@ def resolve_batch(objects, context, args_hash)
796796
if @field_definition.dynamic_introspection
797797
obj_inst = @owner.wrap(obj_inst, context)
798798
end
799-
obj_inst.public_send(@field_definition.execution_next_mode_key, **args_hash)
799+
obj_inst.public_send(@field_definition.execution_mode_key, **args_hash)
800800
rescue GraphQL::ExecutionError => exec_err
801801
exec_err
802802
end
803803
else
804-
raise "Batching execution for #{path} not implemented (execution_next_mode: #{@execution_next_mode.inspect}); provide `resolve_static:`, `resolve_batch:`, `hash_key:`, `method:`, or use a compatibility plug-in"
804+
raise "Batching execution for #{path} not implemented (execution_mode: #{@execution_mode.inspect}); provide `resolve_static:`, `resolve_batch:`, `hash_key:`, `method:`, or use a compatibility plug-in"
805805
end
806806
end
807807
end

lib/graphql/schema/field.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -270,32 +270,32 @@ def initialize(type: nil, name: nil, owner: nil, null: nil, description: NOT_CON
270270
@resolver_method = (resolver_method || name_s).to_sym
271271

272272
if resolve_static
273-
@execution_next_mode = :resolve_static
274-
@execution_next_mode_key = resolve_static == true ? @method_sym : resolve_static
273+
@execution_mode = :resolve_static
274+
@execution_mode_key = resolve_static == true ? @method_sym : resolve_static
275275
elsif resolve_batch
276-
@execution_next_mode = :resolve_batch
277-
@execution_next_mode_key = resolve_batch == true ? @method_sym : resolve_batch
276+
@execution_mode = :resolve_batch
277+
@execution_mode_key = resolve_batch == true ? @method_sym : resolve_batch
278278
elsif resolve_each
279-
@execution_next_mode = :resolve_each
280-
@execution_next_mode_key = resolve_each == true ? @method_sym : resolve_each
279+
@execution_mode = :resolve_each
280+
@execution_mode_key = resolve_each == true ? @method_sym : resolve_each
281281
elsif hash_key
282-
@execution_next_mode = :hash_key
283-
@execution_next_mode_key = hash_key
282+
@execution_mode = :hash_key
283+
@execution_mode_key = hash_key
284284
elsif dig
285-
@execution_next_mode = :dig
286-
@execution_next_mode_key = dig
285+
@execution_mode = :dig
286+
@execution_mode_key = dig
287287
elsif resolver_class
288-
@execution_next_mode = :resolver_class
289-
@execution_next_mode_key = resolver_class
288+
@execution_mode = :resolver_class
289+
@execution_mode_key = resolver_class
290290
elsif resolve_legacy_instance_method
291-
@execution_next_mode = :resolve_legacy_instance_method
292-
@execution_next_mode_key = resolve_legacy_instance_method == true ? @method_sym : resolve_legacy_instance_method
291+
@execution_mode = :resolve_legacy_instance_method
292+
@execution_mode_key = resolve_legacy_instance_method == true ? @method_sym : resolve_legacy_instance_method
293293
elsif dataload
294-
@execution_next_mode = :dataload
295-
@execution_next_mode_key = dataload
294+
@execution_mode = :dataload
295+
@execution_mode_key = dataload
296296
else
297-
@execution_next_mode = :direct_send
298-
@execution_next_mode_key = @method_sym
297+
@execution_mode = :direct_send
298+
@execution_mode_key = @method_sym
299299
end
300300

301301
@complexity = complexity
@@ -369,7 +369,7 @@ def initialize(type: nil, name: nil, owner: nil, null: nil, description: NOT_CON
369369
end
370370

371371
# @api private
372-
attr_reader :execution_next_mode_key, :execution_next_mode
372+
attr_reader :execution_mode_key, :execution_mode
373373

374374
# Calls the definition block, if one was given.
375375
# This is deferred so that references to the return type

lib/graphql/subscriptions/default_subscription_resolve_extension.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def resolve(context:, object:, arguments:)
1818
end
1919

2020
def resolve_next(context:, objects:, arguments:)
21-
has_override_implementation = @field.execution_next_mode != :direct_send
21+
has_override_implementation = @field.execution_mode != :direct_send
2222

2323
if !has_override_implementation
2424
if context.query.subscription_update?

0 commit comments

Comments
 (0)