correct statement grammar and spelling

This commit is contained in:
Nilesh Mali 2020-06-01 16:39:06 +05:30 committed by GitHub
parent 89e70f2e3c
commit e2f26f8996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}
}
```
```