Update model.rs

This commit is contained in:
sunli 2020-03-19 17:44:03 +08:00
parent e5daf63764
commit 170f818c23

View File

@ -149,7 +149,7 @@ impl QueryRoot {
before: Option<String>, before: Option<String>,
first: Option<i32>, first: Option<i32>,
last: Option<i32>, last: Option<i32>,
) -> Result<Connection<Human, EmptyEdgeFields>> { ) -> Result<Connection<Droid, EmptyEdgeFields>> {
let droids = ctx let droids = ctx
.data::<StarWars>() .data::<StarWars>()
.droids() .droids()
@ -160,7 +160,7 @@ impl QueryRoot {
.as_slice() .as_slice()
.query(ctx, after, before, first, last) .query(ctx, after, before, first, last)
.await .await
.map(|connection| connection.map(|id| Human(*id))) .map(|connection| connection.map(|id| Droid(*id)))
} }
} }