Skip to content

Commit

Permalink
Move query mod to handler::graphql::query
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Nov 20, 2023
1 parent 95c3945 commit 0978734
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion rust/crates/web/src/app.rs
Expand Up @@ -3,9 +3,9 @@ use std::sync::Arc;
use async_graphql::{EmptySubscription, Schema};

use crate::{
handler::graphql::query::QueryRoot,
infra::store::InMemoryStore,
mutation::MutationRoot,
query::QueryRoot,
use_case::{HasSchema, HasStore, Store},
};

Expand Down
2 changes: 1 addition & 1 deletion rust/crates/web/src/handler.rs
@@ -1,4 +1,4 @@
mod graphql;
pub mod graphql;
mod root;

use axum::Router;
Expand Down
2 changes: 2 additions & 0 deletions rust/crates/web/src/handler/graphql.rs
@@ -1,3 +1,5 @@
pub mod query;

use std::sync::Arc;

use async_graphql::http::GraphiQLSource;
Expand Down
Expand Up @@ -3,7 +3,6 @@ mod check_list;
mod item;

use async_graphql::Context;
use axum::headers::authorization::Bearer;

use crate::handler::Data;

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion rust/crates/web/src/main.rs
Expand Up @@ -3,7 +3,6 @@ mod handler;
mod infra;
mod model;
mod mutation;
mod query;
#[cfg(test)]
mod test_utils;
mod use_case;
Expand Down
6 changes: 4 additions & 2 deletions rust/crates/web/src/use_case.rs
Expand Up @@ -3,7 +3,7 @@ use std::sync::Arc;
use async_graphql::{EmptySubscription, Schema};
use axum::async_trait;

use crate::{model, mutation, query};
use crate::{model, mutation};

#[derive(Clone, Debug, thiserror::Error)]
pub enum Error {
Expand All @@ -24,7 +24,9 @@ pub trait Store {

pub trait HasSchema {
// TODO: query, mutation, subscription
fn schema(&self) -> &Schema<query::QueryRoot, mutation::MutationRoot, EmptySubscription>;
fn schema(
&self,
) -> &Schema<crate::handler::graphql::query::QueryRoot, mutation::MutationRoot, EmptySubscription>;
}

pub trait HasStore {
Expand Down

0 comments on commit 0978734

Please sign in to comment.