diff --git a/docs/en/src/define_complex_object.md b/docs/en/src/define_complex_object.md index 79274778..67b691aa 100644 --- a/docs/en/src/define_complex_object.md +++ b/docs/en/src/define_complex_object.md @@ -4,11 +4,11 @@ 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. -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::*; @@ -32,4 +32,4 @@ impl MyObject { Ok(conn.query_something(id)?.name) } } -``` \ No newline at end of file +```