Merge branch 'master' of github.com:async-graphql/async-graphql

This commit is contained in:
Sunli 2020-06-19 12:39:32 +08:00
commit dede1edc93
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ impl MyObject {
async fn value_from_db(
&self,
ctx: &Context<'_'>,
ctx: &Context<'_>,
#[arg(desc = "Id of object")] id: i64
) -> FieldResult<String> {
let conn = ctx.data::<DbPool>().take();

View File

@ -23,11 +23,11 @@ impl MyObject {
async fn value_from_db(
&self,
ctx: &Context<'_'>,
ctx: &Context<'_>,
#[arg(desc = "Id of object")] id: i64
) -> FieldResult<String> {
let conn = ctx.data::<DbPool>().take();
Ok(conn.query_something(id)?.name)
}
}
```
```