Some documentation tweaks

This commit is contained in:
Paul van Tilburg 2019-07-10 20:55:32 +02:00
parent c3a6b5f572
commit 63fc7a0721
6 changed files with 14 additions and 10 deletions

View file

@ -1,4 +1,4 @@
//! The application error catchers //! The application error catchers.
use rocket::catch; use rocket::catch;
use rocket_contrib::json; use rocket_contrib::json;

View file

@ -1,3 +1,6 @@
//! The GraphQL schema implementation.
//!
//! Provides the schema with the root query and mutation.
use crate::models::{ use crate::models::{
CompanyInfo, Customer, Invoice, NewCustomer, NewInvoice, NewTimeEntry, TimeEntry, CompanyInfo, Customer, Invoice, NewCustomer, NewInvoice, NewTimeEntry, TimeEntry,
}; };
@ -8,9 +11,10 @@ use juniper::{object, Context, FieldResult, RootNode};
impl Context for DbConn {} impl Context for DbConn {}
/// The GraphQL schema.
pub type Schema = RootNode<'static, Query, Mutation>; pub type Schema = RootNode<'static, Query, Mutation>;
/// The query root. /// The GraphQL query root.
pub struct Query; pub struct Query;
#[object(Context = DbConn)] #[object(Context = DbConn)]
@ -61,7 +65,7 @@ impl Query {
} }
} }
/// The mutation root. /// The GraphQL mutation root.
pub struct Mutation; pub struct Mutation;
#[object(Context = DbConn)] #[object(Context = DbConn)]

View file

@ -1,4 +1,4 @@
//! The root handlers //! The request handlers.
use crate::graphql::Schema; use crate::graphql::Schema;
use crate::DbConn; use crate::DbConn;

View file

@ -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 //! These macros can be used to shorten repetative ORM queries.
//! models that are in the database.
#![allow(unused_macros)] #![allow(unused_macros)]

View file

@ -18,11 +18,12 @@ pub mod catchers;
pub mod graphql; pub mod graphql;
pub mod handlers; pub mod handlers;
pub mod models; pub mod models;
/// The application database schema.
pub mod schema; pub mod schema;
// This macro from `diesel_migrations` defines an `embedded_migrations` module containing a // 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 // function named `run`. This allows the example to be run and tested without any outside setup
// the database. // of the database.
embed_migrations!(); embed_migrations!();
#[database("stoptime_db")] #[database("stoptime_db")]

View file

@ -1,4 +1,4 @@
//! The application models //! The application models.
mod company_info; mod company_info;
mod customer; mod customer;