Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/clients.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::fmt;

use crate::schemas::tiled_metadata::Metadata;
use crate::model::metadata::Metadata;

#[cfg(test)]
pub(crate) mod mock_tiled_client;
Expand Down
2 changes: 1 addition & 1 deletion src/clients/mock_tiled_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::path::PathBuf;
use serde::de::DeserializeOwned;

use crate::clients::{Client, ClientResult};
use crate::schemas::tiled_metadata::Metadata;
use crate::model::metadata::Metadata;
pub struct MockTiledClient {
pub dir_path: PathBuf,
}
Expand Down
2 changes: 1 addition & 1 deletion src/clients/tiled_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use reqwest::Url;
use serde::de::DeserializeOwned;

use crate::clients::{Client, ClientResult};
use crate::schemas::tiled_metadata::Metadata;
use crate::model::metadata::Metadata;

pub struct TiledClient {
pub address: Url,
Expand Down
2 changes: 1 addition & 1 deletion src/handlers/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use axum::Extension;
use axum::response::{Html, IntoResponse};

use crate::clients::Client;
use crate::schemas::TiledQuery;
use crate::model::TiledQuery;

pub async fn graphql_handler<T: Client + Send + Sync + 'static>(
schema: Extension<Schema<TiledQuery<T>, EmptyMutation, EmptySubscription>>,
Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ mod cli;
mod clients;
mod config;
mod handlers;
mod schemas;
mod model;

use cli::{Cli, Commands};

use crate::clients::tiled_client::TiledClient;
use crate::config::GlazedConfig;
use crate::handlers::graphql::{graphiql_handler, graphql_handler};
use crate::schemas::TiledQuery;
use crate::model::TiledQuery;

#[tokio::main]
async fn main() -> Result<(), Box<dyn error::Error>> {
Expand Down
4 changes: 2 additions & 2 deletions src/schemas.rs → src/model.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pub(crate) mod tiled_metadata;
pub(crate) mod metadata;

use async_graphql::Object;

Expand All @@ -8,7 +8,7 @@ pub(crate) struct TiledQuery<T>(pub T);

#[Object]
impl<T: Client + Send + Sync + 'static> TiledQuery<T> {
async fn metadata(&self) -> async_graphql::Result<tiled_metadata::Metadata, ClientError> {
async fn metadata(&self) -> async_graphql::Result<metadata::Metadata, ClientError> {
self.0.metadata().await
}
}
File renamed without changes.