@@ -11,6 +11,7 @@ use crate::{
1111 validation:: { ValidatorContext , Visitor , multi_visitor:: MultiVisitorCons } ,
1212 value:: ScalarValue ,
1313} ;
14+ use crate :: ast:: BorrowedType ;
1415
1516#[ doc( hidden) ]
1617pub fn visit < ' a , A , B , S > (
@@ -40,15 +41,17 @@ where
4041 ..
4142 } ,
4243 ..
43- } ) => Some ( Type :: named ( * name) . wrap_non_null ( ) ) ,
44+ } ) => Some ( BorrowedType :: non_null ( name) ) ,
4445 Definition :: Operation ( Spanning {
4546 item :
4647 Operation {
4748 operation_type : OperationType :: Query ,
4849 ..
4950 } ,
5051 ..
51- } ) => Some ( ctx. schema . concrete_query_type ( ) . as_type ( ) ) ,
52+ } ) => Some ( BorrowedType :: non_null (
53+ ctx. schema . concrete_query_type ( ) . name ( ) . unwrap ( ) ,
54+ ) ) ,
5255 Definition :: Operation ( Spanning {
5356 item :
5457 Operation {
5962 } ) => ctx
6063 . schema
6164 . concrete_mutation_type ( )
62- . map ( |t| t . as_type ( ) ) ,
65+ . map ( |t| BorrowedType :: non_null ( t . name ( ) . unwrap ( ) ) ) ,
6366 Definition :: Operation ( Spanning {
6467 item :
6568 Operation {
@@ -70,10 +73,10 @@ where
7073 } ) => ctx
7174 . schema
7275 . concrete_subscription_type ( )
73- . map ( |t| t . as_type ( ) ) ,
76+ . map ( |t| BorrowedType :: non_null ( t . name ( ) . unwrap ( ) ) ) ,
7477 } ;
7578
76- ctx. with_pushed_type ( def_type. as_ref ( ) , |ctx| {
79+ ctx. with_pushed_type ( def_type, |ctx| {
7780 enter_definition ( v, ctx, def) ;
7881 visit_definition ( v, ctx, def) ;
7982 exit_definition ( v, ctx, def) ;
@@ -306,7 +309,7 @@ fn visit_inline_fragment<'a, S, V>(
306309 item : type_name, ..
307310 } ) = fragment. item . type_condition
308311 {
309- ctx. with_pushed_type ( Some ( & Type :: < & str > :: named ( type_name) . wrap_non_null ( ) ) , visit_fn) ;
312+ ctx. with_pushed_type ( Some ( BorrowedType :: non_null ( type_name) ) , visit_fn) ;
310313 } else {
311314 visit_fn ( ctx) ;
312315 }
0 commit comments