Skip to content

Commit 2f85a0d

Browse files
committed
Removed usage of GraphQLBatchRequest in get handler on juniper_actix
1 parent 5480d18 commit 2f85a0d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

juniper_actix/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ Check the LICENSE file for details.
4444
use actix_web::{web, Error, HttpResponse};
4545
use juniper::{
4646
graphiql::graphiql_source,
47-
http::{playground::playground_source, GraphQLBatchRequest},
47+
http::{playground::playground_source, GraphQLBatchRequest, GraphQLRequest},
4848
ScalarValue,
4949
};
5050

5151
/// Actix GraphQL Handler for GET requests
5252
pub async fn get_graphql_handler<Query, Mutation, Subscription, Context, S>(
5353
schema: &juniper::RootNode<'static, Query, Mutation, Subscription, S>,
5454
context: &Context,
55-
req: web::Query<GraphQLBatchRequest<S>>,
55+
req: web::Query<GraphQLRequest<S>>,
5656
) -> Result<HttpResponse, Error>
5757
where
5858
S: ScalarValue + Send + Sync + 'static,
@@ -64,12 +64,12 @@ where
6464
Subscription: juniper::GraphQLSubscriptionType<S, Context = Context> + Send + Sync + 'static,
6565
Subscription::TypeInfo: Send + Sync,
6666
{
67-
let gql_batch_response = req.execute(schema, context).await;
67+
let gql_response = req.execute(schema, context).await;
6868

69-
let gql_response = serde_json::to_string(&gql_batch_response)?;
69+
let response = serde_json::to_string(&gql_response)?;
7070
Ok(HttpResponse::Ok()
7171
.content_type("application/json")
72-
.body(gql_response))
72+
.body(response))
7373
}
7474
/// Actix GraphQL Handler for POST requests
7575
pub async fn post_graphql_handler<Query, Mutation, Subscription, Context, S>(

0 commit comments

Comments
 (0)