-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add related queries optimizations (#146)
* Add related queries optimizations - [x] one to one relation - [x] one to many relation - [x] one to one via relation - [x] one to one via relation with intermediate - [x] one to many via relation * misc input objects apply Hash, Eq, etc. * order_input parsing support * update pagination parsing * memory pagination for related queries
- Loading branch information
Showing
34 changed files
with
1,165 additions
and
653 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,2 @@ | ||
use sea_orm::prelude::*; | ||
|
||
pub mod entities; | ||
pub mod query_root; | ||
|
||
pub struct OrmDataloader { | ||
pub db: DatabaseConnection, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,13 @@ | ||
use async_graphql::{dataloader::DataLoader, dynamic::*, Response}; | ||
use async_graphql::{dynamic::*, Response}; | ||
use sea_orm::Database; | ||
use seaography_mysql_example::OrmDataloader; | ||
|
||
pub async fn get_schema() -> Schema { | ||
let database = Database::connect("mysql://sea:[email protected]/sakila") | ||
.await | ||
.unwrap(); | ||
let orm_dataloader: DataLoader<OrmDataloader> = DataLoader::new( | ||
OrmDataloader { | ||
db: database.clone(), | ||
}, | ||
tokio::spawn, | ||
); | ||
let schema = | ||
seaography_mysql_example::query_root::schema(database, orm_dataloader, None, None).unwrap(); | ||
seaography_mysql_example::query_root::schema(database, None, None) | ||
.unwrap(); | ||
|
||
schema | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
use async_graphql::{dataloader::DataLoader, dynamic::*, Response}; | ||
use async_graphql::{dynamic::*, Response}; | ||
use sea_orm::Database; | ||
use seaography_mysql_example::OrmDataloader; | ||
|
||
pub async fn get_schema() -> Schema { | ||
let database = Database::connect("mysql://sea:[email protected]/sakila") | ||
.await | ||
.unwrap(); | ||
let orm_dataloader: DataLoader<OrmDataloader> = DataLoader::new( | ||
OrmDataloader { | ||
db: database.clone(), | ||
}, | ||
tokio::spawn, | ||
); | ||
let schema = | ||
seaography_mysql_example::query_root::schema(database, orm_dataloader, None, None).unwrap(); | ||
seaography_mysql_example::query_root::schema(database, None, None).unwrap(); | ||
|
||
schema | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
use sea_orm::prelude::*; | ||
|
||
pub mod entities; | ||
pub mod query_root; | ||
|
||
pub struct OrmDataloader { | ||
pub db: DatabaseConnection, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,12 @@ | ||
use async_graphql::{dataloader::DataLoader, dynamic::*, Response}; | ||
use async_graphql::{dynamic::*, Response}; | ||
use sea_orm::Database; | ||
use seaography_postgres_example::OrmDataloader; | ||
|
||
pub async fn get_schema() -> Schema { | ||
let database = Database::connect("postgres://sea:[email protected]/sakila") | ||
.await | ||
.unwrap(); | ||
let orm_dataloader: DataLoader<OrmDataloader> = DataLoader::new( | ||
OrmDataloader { | ||
db: database.clone(), | ||
}, | ||
tokio::spawn, | ||
); | ||
let schema = | ||
seaography_postgres_example::query_root::schema(database, orm_dataloader, None, None) | ||
seaography_postgres_example::query_root::schema(database, None, None) | ||
.unwrap(); | ||
|
||
schema | ||
|
Oops, something went wrong.