@@ -170,16 +170,16 @@ impl GraphQLResponse {
170
170
/// #[rocket::get("/graphql?<request..>")]
171
171
/// fn get_graphql_handler(
172
172
/// cookies: &CookieJar,
173
- /// context: State<Database>,
173
+ /// context: & State<Database>,
174
174
/// request: juniper_rocket_async::GraphQLRequest,
175
- /// schema: State<Schema>,
175
+ /// schema: & State<Schema>,
176
176
/// ) -> juniper_rocket_async::GraphQLResponse {
177
177
/// if cookies.get("user_id").is_none() {
178
178
/// let err = FieldError::new("User is not logged in", Value::null());
179
179
/// return juniper_rocket_async::GraphQLResponse::error(err);
180
180
/// }
181
181
///
182
- /// request.execute_sync(&schema, &context)
182
+ /// request.execute_sync(&* schema, &* context)
183
183
/// }
184
184
/// ```
185
185
pub fn error ( error : FieldError ) -> Self {
@@ -528,20 +528,20 @@ mod tests {
528
528
529
529
#[ get( "/?<request..>" ) ]
530
530
fn get_graphql_handler (
531
- context : State < Database > ,
531
+ context : & State < Database > ,
532
532
request : super :: GraphQLRequest ,
533
- schema : State < Schema > ,
533
+ schema : & State < Schema > ,
534
534
) -> super :: GraphQLResponse {
535
- request. execute_sync ( & schema, & context)
535
+ request. execute_sync ( & * schema, & * context)
536
536
}
537
537
538
538
#[ post( "/" , data = "<request>" ) ]
539
539
fn post_graphql_handler (
540
- context : State < Database > ,
540
+ context : & State < Database > ,
541
541
request : super :: GraphQLRequest ,
542
- schema : State < Schema > ,
542
+ schema : & State < Schema > ,
543
543
) -> super :: GraphQLResponse {
544
- request. execute_sync ( & schema, & context)
544
+ request. execute_sync ( & * schema, & * context)
545
545
}
546
546
547
547
struct TestRocketIntegration {
@@ -585,12 +585,12 @@ mod tests {
585
585
async fn test_operation_names ( ) {
586
586
#[ post( "/" , data = "<request>" ) ]
587
587
fn post_graphql_assert_operation_name_handler (
588
- context : State < Database > ,
588
+ context : & State < Database > ,
589
589
request : super :: GraphQLRequest ,
590
- schema : State < Schema > ,
590
+ schema : & State < Schema > ,
591
591
) -> super :: GraphQLResponse {
592
592
assert_eq ! ( request. operation_names( ) , vec![ Some ( "TestQuery" ) ] ) ;
593
- request. execute_sync ( & schema, & context)
593
+ request. execute_sync ( & * schema, & * context)
594
594
}
595
595
596
596
let rocket = make_rocket_without_routes ( )
0 commit comments