use axum::{
Router,
routing::{get, post},
};
pub mod admin;
#[cfg(feature = "admin-sql")]
pub mod admin_sql;
pub mod design;
#[cfg(feature = "federation")]
pub mod federation;
pub mod metadata;
pub mod openapi;
pub mod query;
pub mod query_stats;
pub mod schema;
pub mod storage_policies;
pub mod tenant_admin;
pub mod types;
pub mod usage;
pub use types::{ApiError, ApiResponse};
pub fn routes(state: crate::routes::graphql::AppState) -> Router {
#[allow(unused_mut)]
let mut router = Router::new()
.route("/query/validate", post(query::validate_handler))
.route("/query/stats", get(query::stats_handler));
#[cfg(feature = "federation")]
{
router = router
.route("/federation/subgraphs", get(federation::subgraphs_handler))
.route("/federation/graph", get(federation::graph_handler))
.route("/federation/plan", get(federation::plan_handler));
}
router.with_state(state)
}
#[cfg(test)]
mod tests;