diff --git a/examples/juniper/src/main.rs b/examples/juniper/src/main.rs index 26f63de9..97319afe 100644 --- a/examples/juniper/src/main.rs +++ b/examples/juniper/src/main.rs @@ -14,7 +14,7 @@ extern crate env_logger; use actix::prelude::*; use actix_web::{ - middleware, http, server, + middleware, http::{self, header::CONTENT_TYPE}, server, App, AsyncResponder, HttpRequest, HttpResponse, HttpMessage, Error}; use juniper::http::graphiql::graphiql_source; use juniper::http::GraphQLRequest; @@ -79,7 +79,7 @@ fn graphql(req: HttpRequest) -> Box Ok(HttpResponse::Ok().body(user)), + Ok(user) => Ok(HttpResponse::Ok().header(CONTENT_TYPE, "application/json").body(user)), Err(_) => Ok(HttpResponse::InternalServerError().into()) } })