@@ -20,10 +20,10 @@ def fetch(ops)
2020 origin_set . select! { _1 [ TypeResolver ::TYPENAME_EXPORT_NODE . alias ] == op . if_type }
2121 end
2222
23- memo [ op ] = origin_set if origin_set . any ?
23+ memo [ op ] = origin_set unless origin_set . empty ?
2424 end
2525
26- if origin_sets_by_operation . any ?
26+ unless origin_sets_by_operation . empty ?
2727 query_document , variable_names = build_document (
2828 origin_sets_by_operation ,
2929 @executor . request . operation_name ,
@@ -105,7 +105,7 @@ def build_document(origin_sets_by_operation, operation_name = nil, operation_dir
105105 end
106106 end
107107
108- if variable_defs . any ?
108+ unless variable_defs . empty ?
109109 doc_buffer << "("
110110 variable_defs . each_with_index do |( k , v ) , i |
111111 doc_buffer << "," unless i . zero?
@@ -135,10 +135,11 @@ def merge_results!(origin_sets_by_operation, raw_result)
135135 origin_set . map . with_index { |_ , index | raw_result [ "_#{ batch_index } _#{ index } _result" ] }
136136 end
137137
138- next unless results &. any ?
138+ next if results . nil? || results . empty ?
139139
140140 origin_set . each_with_index do |origin_obj , index |
141- origin_obj . merge! ( results [ index ] ) if results [ index ]
141+ result = results [ index ]
142+ origin_obj . merge! ( result ) if result
142143 end
143144 end
144145 end
0 commit comments