1
0
mirror of https://github.com/actix/examples synced 2025-06-26 17:17:42 +02:00

refactor: use graduated Html responder

This commit is contained in:
Rob Ede
2024-07-07 00:23:03 +01:00
parent 10aff3cdb1
commit a67c7803e6
13 changed files with 27 additions and 40 deletions

View File

@ -1,6 +1,5 @@
use actix_cors::Cors;
use actix_web::{get, middleware::Logger, route, web, App, HttpServer, Responder};
use actix_web_lab::respond::Html;
use async_graphql::{
http::{playground_source, GraphQLPlaygroundConfig},
EmptyMutation, EmptySubscription, Schema,
@ -19,7 +18,7 @@ async fn graphql(schema: web::Data<StarWarsSchema>, req: GraphQLRequest) -> Grap
/// GraphiQL playground UI
#[get("/graphiql")]
async fn graphql_playground() -> impl Responder {
Html(playground_source(
web::Html::new(playground_source(
GraphQLPlaygroundConfig::new("/graphql").subscription_endpoint("/graphql"),
))
}