Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
sunli829 committed Dec 4, 2021
1 parent c085874 commit a325a60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion tide/dataloader-postgres/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ async fn run() -> Result<()> {
.await?;

let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription)
.data(DataLoader::new(BookLoader::new(postgres_pool)))
.data(DataLoader::new(
BookLoader::new(postgres_pool),
async_std::task::spawn,
))
.finish();

let mut app = tide::new();
Expand Down
5 changes: 4 additions & 1 deletion tide/dataloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ async fn run() -> Result<()> {
.await?;

let schema = Schema::build(QueryRoot, EmptyMutation, EmptySubscription)
.data(DataLoader::new(BookLoader::new(sqlite_pool)))
.data(DataLoader::new(
BookLoader::new(sqlite_pool),
async_std::task::spawn,
))
.finish();

let mut app = tide::new();
Expand Down

0 comments on commit a325a60

Please sign in to comment.