Update docs.

This commit is contained in:
Sunli 2020-09-30 11:44:18 +08:00
parent fd4c2b193b
commit 28cd37115f
4 changed files with 7 additions and 18 deletions

View File

@ -52,21 +52,7 @@ This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in
* Error Extensions
* Apollo Federation
* Batch Queries
# Crate features
This crate offers the following features, all of which are activated by default:
- `apollo_tracing`: Enable the [Apollo tracing extension](extensions/struct.ApolloTracing.html).
- `log`: Enable the [logger extension](extensions/struct.Logger.html).
- `tracing`: Enable the [tracing extension](extensions/struct.Tracing.html).
- `multipart`: Support [sending files over HTTP multipart](http/fn.receive_body.html).
- `unblock`: Support [asynchronous reader for Upload](types/struct.Upload.html)
- `bson`: Integrate with the [`bson` crate](https://crates.io/crates/bson).
- `chrono`: Integrate with the [`chrono` crate](https://crates.io/crates/chrono).
- `chrono-tz`: Integrate with the [`chrono-tz` crate](https://crates.io/crates/chrono-tz).
- `url`: Integrate with the [`url` crate](https://crates.io/crates/url).
- `uuid`: Integrate with the [`uuid` crate](https://crates.io/crates/uuid).
* Apollo Persisted Queries
## Examples

View File

@ -27,3 +27,4 @@ Comparing Features of Other Rust GraphQL Implementations
| Opentracing | 👍 | ⛔️ |
| Apollo Federation | 👍 | ⛔️ |
| Apollo Tracing | 👍 | ⛔️ |
| Apollo Persisted Queries | 👍 | ⛔️ |

View File

@ -48,12 +48,14 @@
//! * Error Extensions
//! * Apollo Federation
//! * Batch Queries
//! * Apollo Persisted Queries
//!
//! # Crate features
//!
//! This crate offers the following features, all of which are activated by default:
//!
//! - `apollo_tracing`: Enable the [Apollo tracing extension](extensions/struct.ApolloTracing.html).
//! - `apollo_persisted_queries`: Enable the [Apollo persisted queries extension](extensions/apollo_persisted_queries/struct.ApolloPersistedQueries.html).
//! - `log`: Enable the [logger extension](extensions/struct.Logger.html).
//! - `tracing`: Enable the [tracing extension](extensions/struct.Tracing.html).
//! - `multipart`: Support [sending files over HTTP multipart](http/fn.receive_body.html).

View File

@ -8,7 +8,7 @@ use std::pin::Pin;
/// A GraphQL container.
///
/// This helper trait allows the type to call `resolve_object` on itself in its
/// This helper trait allows the type to call `resolve_container` on itself in its
/// `OutputValueType::resolve` implementation.
#[async_trait::async_trait]
pub trait ContainerType: OutputValueType {
@ -107,11 +107,11 @@ pub async fn resolve_container_serial<'a, T: ContainerType + Send + Sync>(
type BoxFieldFuture<'a> =
Pin<Box<dyn Future<Output = Result<(String, serde_json::Value)>> + 'a + Send>>;
/// A set of fields on an object that are being selected.
/// A set of fields on an container that are being selected.
pub struct Fields<'a>(Vec<BoxFieldFuture<'a>>);
impl<'a> Fields<'a> {
/// Add another set of fields to this set of fields using the given object.
/// Add another set of fields to this set of fields using the given container.
pub fn add_set<T: ContainerType + Send + Sync>(
&mut self,
ctx: &ContextSelectionSet<'a>,