Crates.io | seaography |
lib.rs | seaography |
version | |
source | src |
created_at | 2022-09-11 14:52:03.490898 |
updated_at | 2024-12-10 08:45:28.328838 |
description | 🧠A GraphQL framework and code generator for SeaORM |
homepage | https://www.sea-ql.org/Seaography |
repository | https://github.com/SeaQL/seaography |
max_upload_size | |
id | 663089 |
Cargo.toml error: | TOML parse error at line 19, column 1 | 19 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
(Right now there is no mutation, but it's on our plan!)
Seaography | SeaORM |
---|---|
1.1 | 1.1 |
1.0 | 1.0 |
0.12 | 0.12 |
0.3 | 0.10 |
cargo install sea-orm-cli@^1.0.0 # used to generate entities
cargo install seaography-cli@^1.0.0
Setup the sakila sample database.
cd examples/mysql
sea-orm-cli generate entity -o src/entities -u mysql://user:pw@127.0.0.1/sakila --seaography
seaography-cli ./ src/entities mysql://user:pw@127.0.0.1/sakila seaography-mysql-example
cargo run
Go to http://localhost:8000/ and try out the following queries:
{
film(pagination: { page: { limit: 10, page: 0 } }, orderBy: { title: ASC }) {
nodes {
title
description
releaseYear
actor {
nodes {
firstName
lastName
}
}
}
}
}
{
store(filters: { storeId: { eq: 1 } }) {
nodes {
storeId
address {
address
address2
}
staff {
firstName
lastName
}
}
}
}
{
customer(
filters: { active: { eq: 0 } }
pagination: { page: { page: 2, limit: 3 } }
) {
nodes {
customerId
lastName
email
}
paginationInfo {
pages
current
}
}
}
{
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
{
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: { page: { limit: 1, page: 1 } }
) {
nodes {
paymentId
amount
}
paginationInfo {
pages
current
}
pageInfo {
hasPreviousPage
hasNextPage
}
}
}
pageInfo {
hasPreviousPage
hasNextPage
endCursor
}
}
}
{
film(
filters: { rating: { eq: NC17 } }
pagination: { page: { page: 1, limit: 5 } }
) {
nodes {
filmId
rating
}
}
}
Setup the sakila sample database.
cd examples/postgres
sea-orm-cli generate entity -o src/entities -u postgres://user:pw@localhost/sakila --seaography
seaography-cli ./ src/entities postgres://user:pw@localhost/sakila seaography-postgres-example
cargo run
cd examples/sqlite
sea-orm-cli generate entity -o src/entities -u sqlite://sakila.db --seaography
seaography-cli ./ src/entities 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.