Skip to content

Commit

Permalink
Fixes returning a raw value as part of a list
Browse files Browse the repository at this point in the history
  • Loading branch information
bbugh committed Apr 5, 2021
1 parent 438dbc4 commit 030ffa4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/graphql/execution/interpreter/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,7 @@ def evaluate_selection_with_args(kwarg_arguments, field_defn, next_path, ast_nod
end
after_lazy(app_result, owner: owner_type, field: field_defn, path: next_path, ast_node: ast_node, scoped_context: context.scoped_context, owner_object: object, arguments: kwarg_arguments) do |inner_result|
continue_value = continue_value(next_path, inner_result, owner_type, field_defn, return_type.non_null?, ast_node)
if RawValue === continue_value
# Write raw value directly to the response without resolving nested objects
write_in_response(next_path, continue_value.resolve)
elsif HALT != continue_value
if HALT != continue_value
continue_field(next_path, continue_value, owner_type, field_defn, return_type, ast_node, next_selections, false, object, kwarg_arguments)
end
end
Expand Down Expand Up @@ -332,6 +329,10 @@ def continue_value(path, value, parent_type, field, is_non_null, ast_node)
continue_value(path, next_value, parent_type, field, is_non_null, ast_node)
elsif GraphQL::Execution::Execute::SKIP == value
HALT
elsif value.is_a?(GraphQL::Execution::Interpreter::RawValue)
# Write raw value directly to the response without resolving nested objects
write_in_response(path, value.resolve)
HALT
else
value
end
Expand Down

0 comments on commit 030ffa4

Please sign in to comment.