@@ -38,10 +38,9 @@ def setup
3838 end
3939
4040 def test_expands_interface_selections_for_target_location
41- plan = GraphQL ::Stitching ::Request . new (
42- @supergraph ,
43- %|{ buyable(id:"1") { id name price } }| ,
44- ) . plan
41+ plan = with_static_resolver_version do
42+ GraphQL ::Stitching ::Request . new ( @supergraph , %|{ buyable(id:"1") { id name price } }| ) . plan
43+ end
4544
4645 expected_root_selection = %|
4746 {
@@ -77,11 +76,7 @@ def test_expands_interface_selections_for_target_location
7776 selections : "{ name price }" ,
7877 path : [ "buyable" ] ,
7978 if_type : "Product" ,
80- resolver : resolver_version ( "Product" , {
81- location : "a" ,
82- field : "products" ,
83- key : "id" ,
84- } ) ,
79+ resolver : "a.products.id.Product" ,
8580 }
8681 end
8782
@@ -224,7 +219,9 @@ def test_plan_merged_union_types
224219
225220 @supergraph = compose_definitions ( { "a" => a , "b" => b , "c" => c } )
226221
227- plan = GraphQL ::Stitching ::Request . new ( @supergraph , document ) . plan
222+ plan = with_static_resolver_version do
223+ GraphQL ::Stitching ::Request . new ( @supergraph , document ) . plan
224+ end
228225
229226 expected_root_selection = %|
230227 {
@@ -260,10 +257,7 @@ def test_plan_merged_union_types
260257 selections : "{ b }" ,
261258 path : [ "fruit" ] ,
262259 if_type : "Apple" ,
263- resolver : resolver_version ( "Apple" , {
264- location : "b" ,
265- key : "id" ,
266- } ) ,
260+ resolver : "b.apple.id.Apple" ,
267261 }
268262
269263 assert_keys plan . ops [ 2 ] . as_json , {
@@ -272,10 +266,7 @@ def test_plan_merged_union_types
272266 selections : "{ c }" ,
273267 path : [ "fruit" ] ,
274268 if_type : "Apple" ,
275- resolver : resolver_version ( "Apple" , {
276- location : "c" ,
277- key : "id" ,
278- } ) ,
269+ resolver : "c.apple.id.Apple" ,
279270 }
280271
281272 assert_keys plan . ops [ 3 ] . as_json , {
@@ -284,19 +275,7 @@ def test_plan_merged_union_types
284275 selections : "{ b }" ,
285276 path : [ "fruit" ] ,
286277 if_type : "Banana" ,
287- resolver : resolver_version ( "Banana" , {
288- location : "b" ,
289- key : "id" ,
290- } ) ,
278+ resolver : "b.banana.id.Banana" ,
291279 }
292280 end
293-
294- private
295-
296- def resolver_version ( type_name , criteria )
297- @supergraph . resolvers [ type_name ] . find do |resolver |
298- json = resolver . as_json
299- criteria . all? { |k , v | json [ k ] == v }
300- end . version
301- end
302281end
0 commit comments