remove bff

This commit is contained in:
2022-10-03 22:08:25 +02:00
parent d88abefa9a
commit 8c51b68523
21 changed files with 105 additions and 138 deletions

View File

@@ -13,7 +13,7 @@ use axum::{
routing::{get, post},
Json, Router,
};
use axum_extra::extract::{cookie::Key};
use axum_extra::extract::cookie::Key;
use async_graphql::{
http::{playground_source, GraphQLPlaygroundConfig},
@@ -40,17 +40,17 @@ async fn graphql_handler(
session: ReadableSession,
req: GraphQLRequest,
) -> Result<GraphQLResponse, StatusCode> {
let mut req = req.into_inner();
if let Some(user_id) = session.get::<String>("userId") {
req = req.data(user_id);
return Ok(schema.execute(req).await.into());
} else if let Some(on) = &req.operation_name {
if on == "IntrospectionQuery" {
return Ok(schema.execute(req).await.into());
}
}
let req = req.into_inner();
//if let Some(user_id) = session.get::<String>("userId") {
// req = req.data(user_id);
return Ok(schema.execute(req).await.into());
//} else if let Some(on) = &req.operation_name {
// if on == "IntrospectionQuery" {
// return Ok(schema.execute(req).await.into());
// }
//}
Err(StatusCode::FORBIDDEN)
//Err(StatusCode::FORBIDDEN)
}
async fn graphql_playground() -> impl IntoResponse {