@@ -24,7 +24,7 @@ def perform
2424 end
2525
2626 def steps
27- @steps_by_entrypoint . values . sort_by! ( &:index )
27+ @steps_by_entrypoint . each_value . select { _1 . selections . any? } . sort_by! ( &:index )
2828 end
2929
3030 private
@@ -238,6 +238,7 @@ def extract_locale_selections(
238238 selection_set = extract_locale_selections ( current_location , field_type , parent_index , node . selections , path , locale_variables )
239239 path . pop
240240
241+ next if selection_set . empty?
241242 locale_selections << node . merge ( selections : selection_set )
242243 end
243244
@@ -250,6 +251,7 @@ def extract_locale_selections(
250251 extract_locale_selections ( current_location , fragment_type , parent_index , node . selections , path , locale_variables , selection_set )
251252
252253 unless is_same_scope
254+ next if selection_set . empty?
253255 locale_selections << node . merge ( selections : selection_set )
254256 requires_typename = true
255257 end
@@ -265,6 +267,7 @@ def extract_locale_selections(
265267 extract_locale_selections ( current_location , fragment_type , parent_index , fragment . selections , path , locale_variables , selection_set )
266268
267269 unless is_same_scope
270+ next if selection_set . empty?
268271 locale_selections << GraphQL ::Language ::Nodes ::InlineFragment . new ( type : fragment . type , selections : selection_set )
269272 end
270273
@@ -284,7 +287,7 @@ def extract_locale_selections(
284287 remote_selections_by_location = delegate_remote_selections ( parent_type , remote_selections )
285288
286289 # D) Create paths routing to new entrypoint locations via resolver queries.
287- routes = @supergraph . route_type_to_locations ( parent_type . graphql_name , current_location , remote_selections_by_location . keys )
290+ routes = @supergraph . route_type_to_locations ( parent_type . graphql_name , current_location , remote_selections_by_location . each_key )
288291
289292 # E) Translate resolver pathways into new entrypoints.
290293 routes . each_value do |route |
0 commit comments