Function juniper_rocket::playground_source
source · pub fn playground_source<'a>(
graphql_endpoint_url: &str,
subscriptions_endpoint_url: impl Into<Option<&'a str>>
) -> RawHtml<String>
Expand description
Generates a RawHtml
page containing GraphQL Playground.
This does not handle routing, so you can mount it on any endpoint.
§Example
use rocket::{response::content::RawHtml, routes};
#[rocket::get("/playground")]
fn playground() -> RawHtml<String> {
juniper_rocket::playground_source("/graphql", "/subscriptions")
}
let rocket = rocket::build().mount("/", routes![playground]);