🧠A GraphQL framework and code generator for SeaORM
[](https://crates.io/crates/seaography) [](https://docs.rs/seaography) [](https://github.com/SeaQL/seaography/actions/workflows/tests.yaml)(Right now there is no mutation, but it's on our plan!)
sh
cargo install seaography-cli
Setup the sakila 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:
graphql
{
film(pagination: { pages: { limit: 10, page: 0 } }, orderBy: { title: ASC }) {
nodes {
title
description
releaseYear
filmActor {
nodes {
actor {
firstName
lastName
}
}
}
}
}
}
graphql
{
store(filters: { storeId: { eq: 1 } }) {
nodes {
storeId
address {
address
address2
}
staff {
firstName
lastName
}
}
}
}
graphql
{
customer(
filters: { active: { eq: 0 } }
pagination: { pages: { page: 2, limit: 3 } }
) {
nodes {
customerId
lastName
email
}
pages
current
}
}
graphql
{
customer(
filters: { active: { eq: 0 } }
pagination: { cursor: { limit: 3, cursor: "Int[3]:271" } }
) {
nodes {
customerId
lastName
email
}
pageInfo {
hasPreviousPage
hasNextPage
endCursor
}
}
}
Find all inactive customers, include their address, and their payments with amount greater than 7 ordered by amount the second result
graphql
{
customer(
filters: { active: { eq: 0 } }
pagination: { cursor: { limit: 3, cursor: "Int[3]:271" } }
) {
nodes {
customerId
lastName
email
address {
address
}
payment(
filters: { amount: { gt: "7" } }
orderBy: { amount: ASC }
pagination: { pages: { limit: 1, page: 1 } }
) {
nodes {
paymentId
amount
}
pages
current
pageInfo {
hasPreviousPage
hasNextPage
}
}
}
pageInfo {
hasPreviousPage
hasNextPage
endCursor
}
}
}
Setup the sakila sample database.
sh
cd examples/postgres
seaography-cli postgres://user:pw@localhost/sakila seaography-postgres-example .
cargo run
sh
cd examples/sqlite
seaography-cli sqlite://sakila.db seaography-sqlite-example .
cargo run
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.