Skip to content

Commit bace1e4

Browse files
author
Robert Mosolgo
authored
Merge pull request #3445 from rmosolgo/ignore-irep-extra-in-interpreter
Skip extras[:irep_node] in the interpreter
2 parents 472651f + 4b0e12b commit bace1e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/graphql/execution/interpreter/runtime.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,17 @@ def evaluate_selection_with_args(kwarg_arguments, field_defn, next_path, ast_nod
246246
# Use this flag to tell Interpreter::Arguments to add itself
247247
# to the keyword args hash _before_ freezing everything.
248248
extra_args[:argument_details] = :__arguments_add_self
249+
when :irep_node
250+
# This is used by `__typename` in order to support the legacy runtime,
251+
# but it has no use here (and it's always `nil`).
252+
# Stop adding it here to avoid the overhead of `.merge_extras` below.
249253
else
250254
extra_args[extra] = field_defn.fetch_extra(extra, context)
251255
end
252256
end
253-
resolved_arguments = resolved_arguments.merge_extras(extra_args)
257+
if extra_args.any?
258+
resolved_arguments = resolved_arguments.merge_extras(extra_args)
259+
end
254260
resolved_arguments.keyword_arguments
255261
end
256262

0 commit comments

Comments
 (0)