[juniper_rocket] Expose GraphQLResponse fields (#238)
This commit is contained in:
parent
45004f77a3
commit
facb0d2f5d
2 changed files with 12 additions and 1 deletions
|
@ -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> {
|
||||
|
|
11
juniper_rocket/tests/custom_response_tests.rs
Normal file
11
juniper_rocket/tests/custom_response_tests.rs
Normal 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());
|
||||
}
|
Loading…
Reference in a new issue