@@ -15,6 +15,12 @@ mod for_tests_only {
1515
1616use std:: { borrow:: Cow , io:: Cursor } ;
1717
18+ use derive_more:: with_trait:: { AsMut , AsRef } ;
19+ use juniper:: {
20+ DefaultScalarValue , FieldError , GraphQLSubscriptionType , GraphQLType , GraphQLTypeAsync ,
21+ InputValue , RootNode , ScalarValue ,
22+ http:: { self , GraphQLBatchRequest } ,
23+ } ;
1824use rocket:: {
1925 Data , Request ,
2026 data:: { self , FromData , ToByteUnit } ,
@@ -24,12 +30,6 @@ use rocket::{
2430 response:: { self , Responder , Response , content:: RawHtml } ,
2531} ;
2632
27- use juniper:: {
28- DefaultScalarValue , FieldError , GraphQLSubscriptionType , GraphQLType , GraphQLTypeAsync ,
29- InputValue , RootNode , ScalarValue ,
30- http:: { self , GraphQLBatchRequest } ,
31- } ;
32-
3333/// Simple wrapper around an incoming GraphQL request.
3434///
3535/// See the [`http`] module for more information. This type can be constructed automatically from
@@ -74,23 +74,11 @@ use juniper::{
7474/// .manage(Schema::new(Query, EmptyMutation::new(), EmptySubscription::new()))
7575/// .mount("/", routes![get_graphql_handler, post_graphql_handler]);
7676/// ```
77- #[ derive( Debug , PartialEq ) ]
77+ #[ derive( AsRef , AsMut , Debug , PartialEq ) ]
7878pub struct GraphQLRequest < S = DefaultScalarValue > ( GraphQLBatchRequest < S > )
7979where
8080 S : ScalarValue ;
8181
82- impl < S : ScalarValue > AsRef < GraphQLBatchRequest < S > > for GraphQLRequest < S > {
83- fn as_ref ( & self ) -> & GraphQLBatchRequest < S > {
84- & self . 0
85- }
86- }
87-
88- impl < S : ScalarValue > AsMut < GraphQLBatchRequest < S > > for GraphQLRequest < S > {
89- fn as_mut ( & mut self ) -> & mut GraphQLBatchRequest < S > {
90- & mut self . 0
91- }
92- }
93-
9482/// Simple wrapper around the result of executing a GraphQL query
9583pub struct GraphQLResponse ( pub Status , pub String ) ;
9684
0 commit comments