diff --git a/src/catchers.rs b/src/catchers.rs index 371982b..e80d2c3 100644 --- a/src/catchers.rs +++ b/src/catchers.rs @@ -1,4 +1,4 @@ -//! The application error catchers +//! The application error catchers. use rocket::catch; use rocket_contrib::json; diff --git a/src/graphql.rs b/src/graphql.rs index 889865f..b4cbe90 100644 --- a/src/graphql.rs +++ b/src/graphql.rs @@ -1,3 +1,6 @@ +//! The GraphQL schema implementation. +//! +//! Provides the schema with the root query and mutation. use crate::models::{ CompanyInfo, Customer, Invoice, NewCustomer, NewInvoice, NewTimeEntry, TimeEntry, }; @@ -8,9 +11,10 @@ use juniper::{object, Context, FieldResult, RootNode}; impl Context for DbConn {} +/// The GraphQL schema. pub type Schema = RootNode<'static, Query, Mutation>; -/// The query root. +/// The GraphQL query root. pub struct Query; #[object(Context = DbConn)] @@ -61,7 +65,7 @@ impl Query { } } -/// The mutation root. +/// The GraphQL mutation root. pub struct Mutation; #[object(Context = DbConn)] diff --git a/src/handlers.rs b/src/handlers.rs index 333efbd..cf9716e 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -1,4 +1,4 @@ -//! The root handlers +//! The request handlers. use crate::graphql::Schema; use crate::DbConn; diff --git a/src/helpers.rs b/src/helpers.rs index 892ec65..dadb4a6 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,7 +1,6 @@ -//! Some ORM helpers +//! Some ORM helpers. //! -//! The macros, types and traits in this module are used to create a simple GraphQL API on top of -//! models that are in the database. +//! These macros can be used to shorten repetative ORM queries. #![allow(unused_macros)] diff --git a/src/main.rs b/src/main.rs index 5f54cbd..79925df 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,11 +18,12 @@ pub mod catchers; pub mod graphql; pub mod handlers; pub mod models; +/// The application database schema. pub mod schema; // This macro from `diesel_migrations` defines an `embedded_migrations` module containing a -// function named `run`. This allows the example to be run and tested without any outside setup of -// the database. +// function named `run`. This allows the example to be run and tested without any outside setup +// of the database. embed_migrations!(); #[database("stoptime_db")] diff --git a/src/models.rs b/src/models.rs index 1397ac5..ecabf5f 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,4 +1,4 @@ -//! The application models +//! The application models. mod company_info; mod customer;