Skip to content

Commit 5f454e0

Browse files
authored
Move graphiql export location (#615)
This fixes a TODO.
1 parent 2618100 commit 5f454e0

File tree

7 files changed

+11
-7
lines changed

7 files changed

+11
-7
lines changed

juniper/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ See [#569](https://github.com/graphql-rust/juniper/pull/569).
2222

2323
## Breaking Changes
2424

25+
- `juniper::graphiql` has moved to `juniper::http::graphiql`
26+
2527
- remove old `graphql_object!` macro, rename `object` proc macro to `graphql_object`
2628

2729
- Remove deprecated `ScalarValue` custom derive (renamed to GraphQLScalarValue)

juniper/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ mod validation;
142142
// https://github.com/rust-lang/cargo/issues/1520
143143
pub mod http;
144144
pub mod integrations;
145-
// TODO: remove this alias export in 0.10. (breaking change)
146-
pub use crate::http::graphiql;
147145

148146
#[cfg(all(test, not(feature = "expose-test-schema")))]
149147
mod tests;

juniper_hyper/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ async fn parse_post_req<S: ScalarValue>(
117117
pub async fn graphiql(graphql_endpoint: &str) -> Result<Response<Body>, hyper::Error> {
118118
let mut resp = new_html_response(StatusCode::OK);
119119
// XXX: is the call to graphiql_source blocking?
120-
*resp.body_mut() = Body::from(juniper::graphiql::graphiql_source(graphql_endpoint));
120+
*resp.body_mut() = Body::from(juniper::http::graphiql::graphiql_source(graphql_endpoint));
121121
Ok(resp)
122122
}
123123

juniper_iron/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ impl Handler for GraphiQLHandler {
326326
Ok(Response::with((
327327
content_type,
328328
status::Ok,
329-
juniper::graphiql::graphiql_source(&self.graphql_url),
329+
juniper::http::graphiql::graphiql_source(&self.graphql_url),
330330
)))
331331
}
332332
}

juniper_rocket/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ pub struct GraphQLResponse(pub Status, pub String);
7272

7373
/// Generate an HTML page containing GraphiQL
7474
pub fn graphiql_source(graphql_endpoint_url: &str) -> content::Html<String> {
75-
content::Html(juniper::graphiql::graphiql_source(graphql_endpoint_url))
75+
content::Html(juniper::http::graphiql::graphiql_source(
76+
graphql_endpoint_url,
77+
))
7678
}
7779

7880
/// Generate an HTML page containing GraphQL Playground

juniper_rocket_async/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ pub struct GraphQLResponse(pub Status, pub String);
7272

7373
/// Generate an HTML page containing GraphiQL
7474
pub fn graphiql_source(graphql_endpoint_url: &str) -> content::Html<String> {
75-
content::Html(juniper::graphiql::graphiql_source(graphql_endpoint_url))
75+
content::Html(juniper::http::graphiql::graphiql_source(
76+
graphql_endpoint_url,
77+
))
7678
}
7779

7880
/// Generate an HTML page containing GraphQL Playground

juniper_warp/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ pub fn graphiql_filter(
312312
fn graphiql_response(graphql_endpoint_url: &'static str) -> warp::http::Response<Vec<u8>> {
313313
warp::http::Response::builder()
314314
.header("content-type", "text/html;charset=utf-8")
315-
.body(juniper::graphiql::graphiql_source(graphql_endpoint_url).into_bytes())
315+
.body(juniper::http::graphiql::graphiql_source(graphql_endpoint_url).into_bytes())
316316
.expect("response is valid")
317317
}
318318

0 commit comments

Comments
 (0)