diff --git a/README.md b/README.md index 90d6226..beeaff9 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ The main use case is for [Medkit](https://github.com/kayteh/medkit2) bot to have - Backup will connect to Census. It will wait for 60 seconds before deciding the primary is dead, and then start processing events. - API - Serves https://saerro.harasse.rs + - Built on axum and async-graphql - Redis - Using ZADD with score as timestamp, ZCOUNTBYSCORE by timestamp in 15 minute windows, and cleaned up with SCAN+ZREMBYSCORE, population data is tracked. - There is deliberately no persistence. diff --git a/services/api/src/main.rs b/services/api/src/main.rs index 12b247e..c0b5278 100644 --- a/services/api/src/main.rs +++ b/services/api/src/main.rs @@ -42,10 +42,11 @@ async fn graphql_handler_get( Extension(schema): Extension>, query: Query, ) -> axum::response::Response { - match query.operation_name { - Some(_) => Json(schema.execute(query.0).await).into_response(), - None => Redirect::to("/graphql/playground").into_response(), + if query.query == "" { + return Redirect::to("/graphql/playground").into_response(); } + + Json(schema.execute(query.0).await).into_response() } async fn graphql_playground() -> impl IntoResponse { Html(playground_source(GraphQLPlaygroundConfig::new("/graphql")))