mod account;
mod calendar;
mod customer;
mod event;
mod invoice;
mod messaging;
mod notification;
mod profile;
mod project;
mod project_scope_template;
mod report;
mod service;
mod service_scope_template;
mod session;
mod wave;

use async_graphql::{MergedObject, Object};

use account::AccountQuery;
use calendar::CalendarQuery;
use customer::CustomerQuery;
use event::EventQuery;
use invoice::InvoiceQuery;
use messaging::MessagingQuery;
use notification::NotificationQuery;
use profile::ProfileQuery;
use project::ProjectQuery;
use project_scope_template::ProjectScopeTemplateQuery;
use report::ReportQuery;
use service::ServiceQuery;
use service_scope_template::ServiceScopeTemplateQuery;
use session::SessionQuery;
use wave::WaveQuery;

#[derive(Default)]
pub struct BaseQuery;

#[Object]
impl BaseQuery {
    /// API version
    async fn version(&self) -> &str {
        env!("CARGO_PKG_VERSION")
    }

    /// Health check
    async fn health(&self) -> &str {
        "ok"
    }
}

#[derive(MergedObject, Default)]
pub struct QueryRoot(BaseQuery, ProfileQuery, CustomerQuery, AccountQuery, ServiceQuery, ProjectQuery, ServiceScopeTemplateQuery, ProjectScopeTemplateQuery, ReportQuery, InvoiceQuery, CalendarQuery, WaveQuery, SessionQuery, MessagingQuery, EventQuery, NotificationQuery);
