@@ -6,7 +6,7 @@ use rocket::{
66 data:: { self , FromData , ToByteUnit } ,
77 form:: { error:: ErrorKind , DataField , Error , Errors , FromForm , Options , ValueField } ,
88 http:: { ContentType , Status } ,
9- outcome:: Outcome :: { Failure , Forward , Success } ,
9+ outcome:: Outcome ,
1010 response:: { self , content, Responder , Response } ,
1111 Data , Request ,
1212} ;
@@ -307,7 +307,7 @@ where
307307 let is_json = match content_type {
308308 Some ( ( "application" , "json" ) ) => true ,
309309 Some ( ( "application" , "graphql" ) ) => false ,
310- _ => return Box :: pin ( async move { Forward ( data) } ) . await ,
310+ _ => return Outcome :: Forward ( ( data, Status :: UnsupportedMediaType ) ) ,
311311 } ;
312312
313313 Box :: pin ( async move {
@@ -318,13 +318,13 @@ where
318318 let mut reader = data. open ( limit) ;
319319 let mut body = String :: new ( ) ;
320320 if let Err ( e) = reader. read_to_string ( & mut body) . await {
321- return Failure ( ( Status :: InternalServerError , format ! ( "{e:?}" ) ) ) ;
321+ return Outcome :: Error ( ( Status :: InternalServerError , format ! ( "{e:?}" ) ) ) ;
322322 }
323323
324- Success ( GraphQLRequest ( if is_json {
324+ Outcome :: Success ( GraphQLRequest ( if is_json {
325325 match serde_json:: from_str ( & body) {
326326 Ok ( req) => req,
327- Err ( e) => return Failure ( ( Status :: BadRequest , e. to_string ( ) ) ) ,
327+ Err ( e) => return Outcome :: Error ( ( Status :: BadRequest , e. to_string ( ) ) ) ,
328328 }
329329 } else {
330330 GraphQLBatchRequest :: Single ( http:: GraphQLRequest :: new ( body, None , None ) )
0 commit comments