![]() |
|---|
| Seaography screenshot with Bakery schema |
![]() |
|---|
| The Bakery schema |
Specify a database url
export DATABASE_URL="sqlite://../bakery.db"Then, run
cd graphql
cargo run{
cake(filters: { name: { contains: "Chocolate" } }) {
nodes {
name
price
bakery {
name
}
}
}
}{
cake(having: { baker: { name: { eq: "Alice" } } }) {
nodes {
name
price
baker {
nodes {
name
}
}
}
}
}{
bakery(pagination: { page: { limit: 10, page: 0 } }, orderBy: { name: ASC }) {
nodes {
name
cake {
nodes {
name
price
baker {
nodes {
name
}
}
}
}
}
}
}cd into migration folder and follow instructions there, but basically:
export DATABASE_URL="sqlite://../bakery.db?mode=rwc"cd migration
cargo runcargo install sea-orm-cli@^2.0.0-rc
cargo install seaography-cli@^2.0.0-rcrm -rf graphql # this entire folder is generated
mkdir graphql
cd graphql
sea-orm-cli generate entity --output-dir ./src/entities --entity-format dense --seaography
seaography-cli -o . -e ./src/entities --framework axum sea-orm-seaography-example
