From e2f26f89965863a295eb40ee6becc67a26fa5bd3 Mon Sep 17 00:00:00 2001 From: Nilesh Mali <44889195+nm-infy@users.noreply.github.com> Date: Mon, 1 Jun 2020 16:39:06 +0530 Subject: [PATCH 1/2] correct statement grammar and spelling --- docs/en/src/define_complex_object.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/src/define_complex_object.md b/docs/en/src/define_complex_object.md index 79274778..8b105e11 100644 --- a/docs/en/src/define_complex_object.md +++ b/docs/en/src/define_complex_object.md @@ -4,7 +4,7 @@ Different from `SimpleObject`, `Object` must have Resolve defined for each field **A resolver function has to be asynchronous. The first argument has to be `&self`, second being optional `Context` and followed by field arguments.** -Resolve is used to get the value of the field. You can query a database and return the result. **The return type of the function is the type of the field.** You can also return a `async_graphql::FieldResult` so to return an error if it occrs and error message will be send to query result. +Resolve is used to get the value of the field. You can query a database and return the result. **The return type of the function is the type of the field.** You can also return a `async_graphql::FieldResult` so to return an error if it occurs an error message will be sent to query result. When querying a database, you may need a global data base connection pool. When creating `Schema`, you can use `SchemaBuilder::data` to setup `Schema` data, and `Context::data` to setup `Context`data. @@ -32,4 +32,4 @@ impl MyObject { Ok(conn.query_something(id)?.name) } } -``` \ No newline at end of file +``` From 910ffc2726b2c87286fb436047feb975c211ae60 Mon Sep 17 00:00:00 2001 From: Nilesh Mali <44889195+nm-infy@users.noreply.github.com> Date: Mon, 1 Jun 2020 16:40:01 +0530 Subject: [PATCH 2/2] correct spelling --- docs/en/src/define_complex_object.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/en/src/define_complex_object.md b/docs/en/src/define_complex_object.md index 8b105e11..67b691aa 100644 --- a/docs/en/src/define_complex_object.md +++ b/docs/en/src/define_complex_object.md @@ -8,7 +8,7 @@ Resolve is used to get the value of the field. You can query a database and retu When querying a database, you may need a global data base connection pool. When creating `Schema`, you can use `SchemaBuilder::data` to setup `Schema` data, and `Context::data` to setup `Context`data. -The following `value_from_db` function showed how to retrive a database connection from `Context`. +The following `value_from_db` function showed how to retrieve a database connection from `Context`. ```rust use async_graphql::*;