lib/graphql/execution/interpreter.rb in graphql-2.2.7 vs lib/graphql/execution/interpreter.rb in graphql-2.2.8
- old
+ new
@@ -109,17 +109,17 @@
{ "errors" => query.static_errors.map(&:to_h) }
else
data_result
end
else
- result = {
- "data" => query.context.namespace(:interpreter_runtime)[:runtime].final_result
- }
+ result = {}
if query.context.errors.any?
error_result = query.context.errors.map(&:to_h)
result["errors"] = error_result
end
+
+ result["data"] = query.context.namespace(:interpreter_runtime)[:runtime].final_result
result
end
if query.context.namespace?(:__query_result_extensions__)
query.result_values["extensions"] = query.context.namespace(:__query_result_extensions__)