remove bff
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user