@@ -184,7 +184,7 @@ def execute
184184 result
185185 else
186186 data = result [ "data" ]
187- data = propagate_errors ( data , query )
187+ data = run_finalizers ( data , query )
188188 errors = [ ]
189189 query . context . errors . each do |err |
190190 if err . respond_to? ( :to_h )
@@ -252,8 +252,8 @@ def lazy?(object)
252252
253253 private
254254
255- def propagate_errors ( data , query )
256- paths_to_check = query . context . errors . map ( &:path )
255+ def run_finalizers ( data , query )
256+ paths_to_check = query . finalizers . map ( &:path )
257257 paths_to_check . compact! # root-level auth errors currently come without a path
258258 # TODO dry with above?
259259 # This is also where a query-level "Step" would be used?
@@ -287,7 +287,7 @@ def check_object_result(query, result_h, static_type, ast_selections, current_ex
287287 result_type = result_type . of_type
288288 end
289289
290- new_result_value = if result_value . is_a? ( GraphQL :: Error )
290+ new_result_value = if result_value . is_a? ( Finalizer )
291291 result_value . path = current_result_path . dup
292292 result_value . assign_graphql_result ( query , result_h , key )
293293 result_h . key? ( key ) ? result_h [ key ] : :unassigned
@@ -340,7 +340,7 @@ def check_list_result(query, result_arr, inner_type, ast_selections, current_exe
340340 new_invalid_null = false
341341 result_arr . each_with_index do |result_item , idx |
342342 current_result_path << idx
343- new_result = if result_item . is_a? ( GraphQL :: Error )
343+ new_result = if result_item . is_a? ( Finalizer )
344344 result_item . path = current_result_path . dup
345345 result_item . assign_graphql_result ( query , result_arr , idx )
346346 result_arr [ idx ]
0 commit comments