From 96330e13e4a6175b62dfcc17753433836e2ee386 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Wed, 9 Jun 2021 15:56:20 +0000 Subject: [PATCH] Remove some warnings in API --- api/src/api.rs | 3 +-- api/src/main.rs | 33 --------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/api/src/api.rs b/api/src/api.rs index 6a4a4be..7c18342 100644 --- a/api/src/api.rs +++ b/api/src/api.rs @@ -1,8 +1,7 @@ -use crate::config::{create_config, Config}; +use crate::config::create_config; use crate::schema::{self, Context, Schema}; use log::info; use rocket::http::Method; -use rocket::serde::{json::Json, Deserialize}; use rocket::{response::content, Rocket, State}; use rocket_cors::AllowedOrigins; use std::env; diff --git a/api/src/main.rs b/api/src/main.rs index 403b6c7..d54eb02 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -1,36 +1,3 @@ -use log::info; -use rocket::http::Method; -use rocket::serde::{json::Json, Deserialize}; -use rocket::{response::content, Rocket, State}; -use rocket_cors::AllowedOrigins; -use std::env; -use tenebrous_api::config::{create_config, Config}; -use tenebrous_api::schema::{self, Context, Schema}; -use tracing_subscriber::filter::EnvFilter; - -#[rocket::get("/")] -fn graphiql() -> content::Html { - juniper_rocket_async::graphiql_source("/graphql", None) -} - -#[rocket::get("/graphql?")] -async fn get_graphql_handler( - context: &State, - request: juniper_rocket_async::GraphQLRequest, - schema: &State, -) -> juniper_rocket_async::GraphQLResponse { - request.execute(&*schema, &*context).await -} - -#[rocket::post("/graphql", data = "")] -async fn post_graphql_handler( - context: &State, - request: juniper_rocket_async::GraphQLRequest, - schema: &State, -) -> juniper_rocket_async::GraphQLResponse { - request.execute(&*schema, &*context).await -} - #[rocket::main] pub async fn main() -> Result<(), Box> { tenebrous_api::api::run().await?;