From 5e9001b9985310eb6498055fea530e25ba897bb7 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Tue, 4 Oct 2022 11:07:14 +0200 Subject: [PATCH] Removed unused imports --- como_bin/src/main.rs | 25 +++++++------------------ como_gql/src/graphql.rs | 8 ++++---- como_gql/src/lib.rs | 25 ++++++++++--------------- 3 files changed, 21 insertions(+), 37 deletions(-) diff --git a/como_bin/src/main.rs b/como_bin/src/main.rs index d1d7f91..ef178ce 100644 --- a/como_bin/src/main.rs +++ b/como_bin/src/main.rs @@ -1,33 +1,22 @@ use std::{ - env::{self, current_dir}, sync::Arc, }; mod error; -use axum::{ - extract::Extension, - http::{Method, StatusCode}, - response::{Html, IntoResponse}, - routing::{get, post}, - Json, Router, -}; -use axum_extra::extract::cookie::Key; + + use clap::Parser; use anyhow::Context; -use axum_sessions::{ - async_session::MemoryStore, - extractors::{ReadableSession, WritableSession}, - SessionLayer, -}; + use como_api::router::Api; use como_infrastructure::{ configs::AppConfig, database::ConnectionPoolManager, register::ServiceRegister, }; -use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; -use sqlx::PgPool; -use tower_http::{cors::CorsLayer, trace::TraceLayer}; + + + + use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; #[tokio::main] diff --git a/como_gql/src/graphql.rs b/como_gql/src/graphql.rs index 679ac26..3b10e29 100644 --- a/como_gql/src/graphql.rs +++ b/como_gql/src/graphql.rs @@ -1,8 +1,8 @@ -use async_graphql::{Context, EmptySubscription, Object, Schema, SimpleObject}; +use async_graphql::{Context, EmptySubscription, Object, Schema}; -use como_domain::item::{requests::CreateItemDto, responses::CreatedItemDto, ItemState}; +use como_domain::item::{requests::CreateItemDto, responses::CreatedItemDto}; use como_infrastructure::register::ServiceRegister; -use uuid::Uuid; + pub type CibusSchema = Schema; @@ -63,7 +63,7 @@ pub struct QueryRoot; #[Object] impl QueryRoot { - async fn hello(&self, ctx: &Context<'_>) -> String { + async fn hello(&self, _ctx: &Context<'_>) -> String { "hello".into() } } diff --git a/como_gql/src/lib.rs b/como_gql/src/lib.rs index c5d5638..47a5563 100644 --- a/como_gql/src/lib.rs +++ b/como_gql/src/lib.rs @@ -1,35 +1,30 @@ use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use axum::{ extract::Extension, - http::{Method, StatusCode}, + http::{StatusCode}, response::{Html, IntoResponse}, - routing::{get, post}, - Json, Router, }; -use axum_extra::extract::cookie::Key; + use async_graphql::{ http::{playground_source, GraphQLPlaygroundConfig}, - EmptySubscription, Schema, }; use axum_sessions::{ - async_session::MemoryStore, - extractors::{ReadableSession, WritableSession}, - SessionLayer, + extractors::{ReadableSession}, }; use graphql::CibusSchema; -use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; -use sqlx::PgPool; -use tower_http::{cors::CorsLayer, trace::TraceLayer}; -use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt}; -use crate::graphql::{MutationRoot, QueryRoot}; + + + + + + pub mod graphql; pub async fn graphql_handler( schema: Extension, - session: ReadableSession, + _session: ReadableSession, req: GraphQLRequest, ) -> Result { let req = req.into_inner();