async fn graphql(
    st: web::Data<Arc<Schema>>,
    data: web::Json<GraphQLRequest>,
) -> Result<HttpResponse, Error> {
    let entity = web::block(move || {
        let res = data.execute(&st, &());
        Ok::<_, serde_json::error::Error>(serde_json::to_string(&res)?)
    })
    .await?;
    Ok(HttpResponse::Ok()
        .content_type("application/json")
        .body(entity))
}
// Create a graphql server handler.
Create a graphql server handler.
Create a graphql server handler .
async fn graphql(
    st: web::Data<Arc<Schema>>,
    data: web::Json<GraphQLRequest>,
) -> Result<HttpResponse, Error> {
    let entity = web::block(move || {
        let res = data.execute(&st, &());
        Ok::<_, serde_json::error::Error>(serde_json::to_string(&res)?)
    })
    .await?;
    Ok(HttpResponse::Ok()
        .content_type("application/json")
        .body(entity))
}
async fn graphql ( st : web :: Data < Arc < Schema > > , data : web :: Json < GraphQLRequest > , ) -> Result < HttpResponse , Error > { let entity = web :: block ( move | | { let res = data . execute ( & st , & ( ) ) ; Ok :: < _ , serde_json :: error :: Error > ( serde_json :: to_string ( & res ) ? ) } ) . await ? ; Ok ( HttpResponse :: Ok ( ) . content_type ( " " ) . body ( entity ) ) }
Create a graphql server handler.
Create a graphql server handler .
st
web::Data<Arc<Schema>>
data
web::Json<GraphQLRequest>