Skip to content

Commit

Permalink
Edit seaography crate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Sep 14, 2022
1 parent c1944a5 commit 1a87370
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ Go to http://localhost:8000/ and try out the following query:

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Seaography is a community driven project. We welcome you to participate, contribute and together build for Rust's future.
Seaography is a community driven project. We welcome you to participate, contribute and together build for Rust's future.
3 changes: 3 additions & 0 deletions build-tools/generate-readme.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Run `sh develop/cargo-readme.sh` on project root to generate `README.md` from `src/lib.rs`
# cargo install cargo-readme
cargo readme --no-badges --no-indent-headings --no-license --no-template --no-title > README.md
130 changes: 129 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,132 @@
//! Seaography - 🧭 A GraphQL framework and code generator for SeaORM
//! <div align="center">
//!
//! <h1>
//! <img src="https://raw.githubusercontent.com/SeaQL/seaography/main/docs/Seaography.png" width="280 alt="Seaography"/>
//! </h1>
//!
//! <p>
//! <strong>🧭 A GraphQL framework and code generator for SeaORM</strong>
//! </p>
//!
//! [![crate](https://img.shields.io/crates/v/seaography.svg)](https://crates.io/crates/seaography)
//! [![docs](https://docs.rs/seaography/badge.svg)](https://docs.rs/seaography)
//! [![build status](https://github.com/SeaQL/seaography/actions/workflows/tests.yaml/badge.svg)](https://github.com/SeaQL/seaography/actions/workflows/tests.yaml)
//!
//! </div>
//!
//! # Seaography
//!
//! #### Seaography is a GraphQL framework for building GraphQL resolvers using SeaORM entities. It ships with a CLI tool that can generate ready-to-compile Rust GraphQL servers from existing MySQL, Postgres and SQLite databases.
//!
//! ## Features
//!
//! * Relational query (1-to-1, 1-to-N)
//! * Pagination on query's root entity
//! * Filter with operators (e.g. gt, lt, eq)
//! * Order by any column
//!
//! (Right now there is no mutation, but it's on our plan!)
//!
//! ## Quick start - ready to serve in 3 minutes!
//!
//! ### Install
//!
//! ```sh
//! cargo install seaography-cli
//! ```
//!
//! ### MySQL
//!
//! Setup the [sakila](https://github.com/SeaQL/seaography/blob/main/examples/mysql/sakila-schema.sql) sample database.
//!
//! ```sh
//! cd examples/mysql
//! seaography-cli mysql://user:pw@localhost/sakila seaography-mysql-example .
//! cargo run
//! ```
//!
//! Go to http://localhost:8000/ and try out the following queries:
//!
//! #### Fetch films and their actors
//!
//! ```graphql
//! {
//! film(pagination: { limit: 10, page: 0 }, orderBy: { title: ASC }) {
//! data {
//! title
//! description
//! releaseYear
//! filmActor {
//! actor {
//! firstName
//! lastName
//! }
//! }
//! }
//! }
//! }
//! ```
//!
//! #### Fetch store and its employee
//!
//! ```graphql
//! {
//! store(filters: { storeId: { eq: 1 } }) {
//! data {
//! storeId
//! address {
//! address
//! address2
//! }
//! staff {
//! firstName
//! lastName
//! }
//! }
//! }
//! }
//! ```
//!
//! ### Postgres
//!
//! Setup the [sakila](https://github.com/SeaQL/seaography/blob/main/examples/postgres/sakila-schema.sql) sample database.
//!
//! ```sh
//! cd examples/postgres
//! seaography-cli postgres://user:pw@localhost/sakila seaography-postgres-example .
//! cargo run
//! ```
//!
//! ### SQLite
//!
//! ```sh
//! cd examples/sqlite
//! seaography-cli sqlite://chinook.db seaography-sqlite-example .
//! cargo run
//! ```
//!
//! Go to http://localhost:8000/ and try out the following query:
//!
//! #### Fetch albums and their artists
//!
//! ```graphql
//! {
//! albums(pagination: { limit: 10, page: 0 }) {
//! data {
//! title
//! artists {
//! name
//! }
//! }
//! }
//! }
//! ```
//!
//! ## Contribution
//!
//! Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
//!
//! Seaography is a community driven project. We welcome you to participate, contribute and together build for Rust's future.
pub use seaography_derive as macros;

Expand Down

0 comments on commit 1a87370

Please sign in to comment.