Nit: Fix typos in define_complex_object.mx

This commit is contained in:
Florian Peter 2022-02-17 18:55:41 +00:00 committed by GitHub
parent 842f708ace
commit dc8faf1313
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ Different from `SimpleObject`, `Object` must have a resolver defined for each fi
**A resolver function has to be asynchronous. The first argument has to be `&self`, the second is an optional `Context` and it is followed by field arguments.**
The resolvers is used to get the value of the field. For example, 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::Result` to return an error if it occurs. The error message will then be sent to query result.
The resolver is used to get the value of the field. For example, 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::Result` to return an error if it occurs. The error message will then be sent as query result.
You may need access to global data in your query, for example a database connection pool.
When creating your `Schema`, you can use `SchemaBuilder::data` to configure the global data, and `Context::data` to configure `Context` data.