Removed unused imports

This commit is contained in:
Kasper Juul Hermansen 2022-10-04 11:07:14 +02:00
parent ae74f66c3a
commit 5e9001b998
Signed by: kjuulh
GPG Key ID: 57B6E1465221F912
3 changed files with 21 additions and 37 deletions

View File

@ -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]

View File

@ -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<QueryRoot, MutationRoot, EmptySubscription>;
@ -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()
}
}

View File

@ -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<CibusSchema>,
session: ReadableSession,
_session: ReadableSession,
req: GraphQLRequest,
) -> Result<GraphQLResponse, StatusCode> {
let req = req.into_inner();