Fix typos (#951)
This commit is contained in:
parent
b765b4f6c2
commit
359f1ed23b
|
@ -121,9 +121,9 @@ impl Query {
|
|||
|
||||
## Selection / LookAhead
|
||||
|
||||
Sometimes you want to know what fields are requested in the subquery to optimize the processing of data. You can read fields accross the query with `ctx.field()` which will give you a `SelectionField` which will allow you to navigate accross the fields and subfields.
|
||||
Sometimes you want to know what fields are requested in the subquery to optimize the processing of data. You can read fields across the query with `ctx.field()` which will give you a `SelectionField` which will allow you to navigate across the fields and subfields.
|
||||
|
||||
If you want to perform a search accross the query or the subqueries, you do not have to do this by hand with the `SelectionField`, you can use the `ctx.look_ahead()` to perform a selection
|
||||
If you want to perform a search across the query or the subqueries, you do not have to do this by hand with the `SelectionField`, you can use the `ctx.look_ahead()` to perform a selection
|
||||
|
||||
```rust
|
||||
# extern crate async_graphql;
|
||||
|
|
|
@ -39,7 +39,7 @@ Register the directive when building the schema:
|
|||
# use async_graphql::*;
|
||||
# struct Query;
|
||||
# #[Object]
|
||||
# impl Query { async fn verison(&self) -> &str { "1.0" } }
|
||||
# impl Query { async fn version(&self) -> &str { "1.0" } }
|
||||
# struct ConcatDirective { value: String, }
|
||||
# #[async_trait::async_trait]
|
||||
# impl CustomDirective for ConcatDirective {
|
||||
|
|
|
@ -27,7 +27,7 @@ struct MyObject {
|
|||
Sometimes most of the fields of a GraphQL object simply return the value of the structure member, but a few
|
||||
fields are calculated. In this case, the [Object](define_complex_object.html) macro cannot be used unless you hand-write all the resolvers.
|
||||
|
||||
The `ComplexObject` macro works in conjuction with the `SimpleObject` macro. The `SimpleObject` derive macro defines
|
||||
The `ComplexObject` macro works in conjunction with the `SimpleObject` macro. The `SimpleObject` derive macro defines
|
||||
the non-calculated fields, where as the `ComplexObject` macro let's you write user-defined resolvers for the calculated fields.
|
||||
|
||||
Resolvers added to `ComplexObject` adhere to the same rules as resolvers of [Object](define_complex_object.html).
|
||||
|
|
|
@ -58,7 +58,7 @@ type Query {
|
|||
|
||||
## Wrapper types
|
||||
|
||||
A derived field won't be able to manage everythings easily: Rust's [orphan rule](https://doc.rust-lang.org/book/traits.html#rules-for-implementing-traits) requires that either the
|
||||
A derived field won't be able to manage everything easily: Rust's [orphan rule](https://doc.rust-lang.org/book/traits.html#rules-for-implementing-traits) requires that either the
|
||||
trait or the type for which you are implementing the trait must be defined in the same crate as the impl, so the following code cannot be compiled:
|
||||
|
||||
```rust,ignore
|
||||
|
|
|
@ -38,7 +38,7 @@ fn concat(value: String) -> impl CustomDirective {
|
|||
# use async_graphql::*;
|
||||
# struct Query;
|
||||
# #[Object]
|
||||
# impl Query { async fn verison(&self) -> &str { "1.0" } }
|
||||
# impl Query { async fn version(&self) -> &str { "1.0" } }
|
||||
# struct ConcatDirective { value: String, }
|
||||
# #[async_trait::async_trait]
|
||||
# impl CustomDirective for ConcatDirective {
|
||||
|
|
|
@ -60,7 +60,7 @@ pub async fn receive_batch_body(
|
|||
}
|
||||
}
|
||||
|
||||
/// Recieves a GraphQL query which is either cbor or json but NOT multipart
|
||||
/// Receives a GraphQL query which is either cbor or json but NOT multipart
|
||||
/// This method is only to avoid recursive calls with [``receive_batch_body``]
|
||||
/// and [``multipart::receive_batch_multipart``]
|
||||
pub(super) async fn receive_batch_body_no_multipart(
|
||||
|
|
|
@ -509,7 +509,7 @@ mod tests {
|
|||
value = MaybeUndefined::Value(Ok(5));
|
||||
assert_eq!(value.transpose(), Ok(MaybeUndefined::Value(5)));
|
||||
|
||||
value = MaybeUndefined::Value(Err("eror"));
|
||||
assert_eq!(value.transpose(), Err("eror"));
|
||||
value = MaybeUndefined::Value(Err("error"));
|
||||
assert_eq!(value.transpose(), Err("error"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ async fn recursive_fragment_definition() {
|
|||
|
||||
struct Query;
|
||||
|
||||
// this setup is actually completely irrelevant we just need to be able ot
|
||||
// this setup is actually completely irrelevant we just need to be able to
|
||||
// execute a query
|
||||
#[Object]
|
||||
impl Query {
|
||||
|
@ -89,7 +89,7 @@ async fn recursive_fragment_definition_nested() {
|
|||
|
||||
struct Query;
|
||||
|
||||
// this setup is actually completely irrelevant we just need to be able ot
|
||||
// this setup is actually completely irrelevant we just need to be able to
|
||||
// execute a query
|
||||
#[Object]
|
||||
impl Query {
|
||||
|
|
Loading…
Reference in New Issue