diff --git a/src/main.rs b/src/main.rs index b631822..8673104 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,8 @@ +use async_graphql::http::GraphiQLSource; use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use axum::{ Router, + response::Html, routing::{get, post}, }; use std::net::SocketAddr; @@ -29,6 +31,10 @@ async fn main() -> anyhow::Result<()> { let schema = schema.clone(); move || async move { axum::Json(schema.sdl()) } }), + ) + .route( + "/graphiql", + get(Html(GraphiQLSource::build().endpoint("/graphql").finish())), ); let addr = SocketAddr::from(([0, 0, 0, 0], 3000));