[juniper_rocket] Expose GraphQLResponse fields (#238)

This commit is contained in:
Marshall Bowers 2018-08-31 21:46:27 -04:00 committed by Christian Legnitto
parent 45004f77a3
commit facb0d2f5d
2 changed files with 12 additions and 1 deletions

View file

@ -121,7 +121,7 @@ impl<'a> GraphQLBatchResponse<'a> {
pub struct GraphQLRequest(GraphQLBatchRequest);
/// Simple wrapper around the result of executing a GraphQL query
pub struct GraphQLResponse(Status, String);
pub struct GraphQLResponse(pub Status, pub String);
/// Generate an HTML page containing GraphiQL
pub fn graphiql_source(graphql_endpoint_url: &str) -> content::Html<String> {

View file

@ -0,0 +1,11 @@
extern crate juniper_rocket;
extern crate rocket;
use rocket::http::Status;
use juniper_rocket::GraphQLResponse;
#[test]
fn test_graphql_response_is_public() {
let _ = GraphQLResponse(Status::Unauthorized, "Unauthorized".to_string());
}