diff --git a/juniper_rocket/src/lib.rs b/juniper_rocket/src/lib.rs index aa27fdab..6e7bae58 100644 --- a/juniper_rocket/src/lib.rs +++ b/juniper_rocket/src/lib.rs @@ -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 { diff --git a/juniper_rocket/tests/custom_response_tests.rs b/juniper_rocket/tests/custom_response_tests.rs new file mode 100644 index 00000000..aeb29d4b --- /dev/null +++ b/juniper_rocket/tests/custom_response_tests.rs @@ -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()); +}