From 95319754a1bdf450402c784bec5369578cb18917 Mon Sep 17 00:00:00 2001 From: Emmanuel Keller Date: Sun, 20 Sep 2020 18:24:14 +0100 Subject: [PATCH] Removing namespace usage for clarity (#369) --- juniper-advanced/src/handlers.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/juniper-advanced/src/handlers.rs b/juniper-advanced/src/handlers.rs index edc06c17..5ac2a29f 100644 --- a/juniper-advanced/src/handlers.rs +++ b/juniper-advanced/src/handlers.rs @@ -1,5 +1,3 @@ -use std::sync::Arc; - use actix_web::{web, Error, HttpResponse}; use juniper::http::graphiql::graphiql_source; use juniper::http::GraphQLRequest; @@ -9,7 +7,7 @@ use crate::schemas::root::{create_schema, Context, Schema}; pub async fn graphql( pool: web::Data, - schema: web::Data>, + schema: web::Data, data: web::Json, ) -> Result { let ctx = Context { @@ -34,9 +32,8 @@ pub async fn graphql_playground() -> HttpResponse { } pub fn register(config: &mut web::ServiceConfig) { - let schema = std::sync::Arc::new(create_schema()); config - .data(schema) + .data(create_schema()) .route("/graphql", web::post().to(graphql)) .route("/graphiql", web::get().to(graphql_playground)); }