@@ -6,7 +6,7 @@ use rocket::{
6
6
data:: { self , FromData , ToByteUnit } ,
7
7
form:: { error:: ErrorKind , DataField , Error , Errors , FromForm , Options , ValueField } ,
8
8
http:: { ContentType , Status } ,
9
- outcome:: Outcome :: { Failure , Forward , Success } ,
9
+ outcome:: Outcome ,
10
10
response:: { self , content, Responder , Response } ,
11
11
Data , Request ,
12
12
} ;
@@ -307,7 +307,7 @@ where
307
307
let is_json = match content_type {
308
308
Some ( ( "application" , "json" ) ) => true ,
309
309
Some ( ( "application" , "graphql" ) ) => false ,
310
- _ => return Box :: pin ( async move { Forward ( data) } ) . await ,
310
+ _ => return Outcome :: Forward ( ( data, Status :: UnsupportedMediaType ) ) ,
311
311
} ;
312
312
313
313
Box :: pin ( async move {
@@ -318,13 +318,13 @@ where
318
318
let mut reader = data. open ( limit) ;
319
319
let mut body = String :: new ( ) ;
320
320
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:?}" ) ) ) ;
322
322
}
323
323
324
- Success ( GraphQLRequest ( if is_json {
324
+ Outcome :: Success ( GraphQLRequest ( if is_json {
325
325
match serde_json:: from_str ( & body) {
326
326
Ok ( req) => req,
327
- Err ( e) => return Failure ( ( Status :: BadRequest , e. to_string ( ) ) ) ,
327
+ Err ( e) => return Outcome :: Error ( ( Status :: BadRequest , e. to_string ( ) ) ) ,
328
328
}
329
329
} else {
330
330
GraphQLBatchRequest :: Single ( http:: GraphQLRequest :: new ( body, None , None ) )
0 commit comments