Docs.rs
  • async-graphql-2.0.0-alpha.26
    • async-graphql 2.0.0-alpha.26
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • sunli829
    • Dependencies
      • async-graphql-derive ^2.0.0-alpha.26 normal
      • async-graphql-parser ^2.0.0-alpha.26 normal
      • async-graphql-value ^2.0.0-alpha.26 normal
      • async-stream ^0.3 normal
      • async-trait ^0.1.30 normal
      • blocking ^1.0.0 normal
      • bson ^1.0.0 normal
      • bytes ^0.5.4 normal
      • chrono ^0.4.15 normal
      • chrono-tz ^0.5.1 normal
      • fnv ^1.0.6 normal
      • futures ^0.3.5 normal
      • indexmap ^1.3.2 normal
      • itertools ^0.9.0 normal
      • log ^0.4.11 normal
      • lru ^0.6.0 normal
      • multer ^1.2.2 normal
      • num-traits ^0.2.12 normal
      • once_cell ^1.3.1 normal
      • pin-project-lite ^0.1.7 normal
      • regex ^1.3.5 normal
      • serde ^1.0.104 normal
      • serde_json ^1.0.48 normal
      • spin ^0.5.2 normal
      • static_assertions ^1.1.0 normal
      • tempfile ^3.1.0 normal
      • thiserror ^1.0.11 normal
      • tracing ^0.1.19 normal
      • url ^2.1.1 normal
      • uuid ^0.8.1 normal
      • async-std ^1.5.0 dev
    • Versions
    • 95.88% of the crate is documented
  • Go to latest stable release
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • Rust
    • About docs.rs
    • Privacy policy
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation
☰
logo

Crate async_graphql

Version 2.0.0-alpha.26

See all async_graphql's items

  • Re-exports
  • Modules
  • Structs
  • Enums
  • Traits
  • Functions
  • Type Definitions

Crates

  • async_graphql
? Change settings

[−][src]Crate async_graphql

[−] Expand description

A GraphQL server library implemented in Rust

Crates.io version Download docs.rs docs

Documentation

  • Feature Comparison
  • Book
  • 中文文档
  • Docs
  • GitHub repository
  • Cargo package
  • Minimum supported Rust version: 1.42 or later

Features

  • Fully supports async/await
  • Type safety
  • Rustfmt friendly (Procedural Macro)
  • Custom scalars
  • Minimal overhead
  • Easy integration (actix_web, tide, warp, rocket ...)
  • File upload (Multipart request)
  • Subscriptions (WebSocket transport)
  • Custom extensions
  • Apollo Tracing extension
  • Limit query complexity/depth
  • 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.
  • apollo_persisted_queries: Enable the Apollo persisted queries extension.
  • log: Enable the logger extension.
  • tracing: Enable the tracing extension.
  • multipart: Support sending files over HTTP multipart.
  • unblock: Support asynchronous reader for Upload
  • bson: Integrate with the bson crate.
  • chrono: Integrate with the chrono crate.
  • chrono-tz: Integrate with the chrono-tz crate.
  • url: Integrate with the url crate.
  • uuid: Integrate with the uuid crate.

Integrations

  • Actix-web async-graphql-actix_web
  • Warp async-graphql-warp
  • Tide async-graphql-tide

License

Licensed under either of

  • Apache License, Version 2.0, (./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (./LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.

References

  • GraphQL
  • GraphQL Multipart Request
  • GraphQL Cursor Connections Specification
  • GraphQL over WebSocket Protocol
  • Apollo Tracing
  • Apollo Federation

Examples

If you are just getting started, we recommend checking out our examples at: https://github.com/async-graphql/examples

To see how you would create a Relay-compliant server using async-graphql, warp, diesel & postgresql, you can also check out a real-world example at: https://github.com/phated/twentyfive-stars

Benchmarks

Ensure that there is no CPU-heavy process in background!

cd benchmark
cargo bench

Now a HTML report is available at benchmark/target/criterion/report.

Re-exports

pub use async_graphql_parser as parser;
pub use parser::Pos;
pub use parser::Positioned;
pub use types::*;

Modules

extensions

Extensions for schema

guard

Field guards

http

A helper module that supports HTTP

resolver_utils

Utilities for implementing OutputValueType::resolve.

types

Useful GraphQL types.

validators

Input value validators

Structs

CacheControl

Cache control values

ContextBase

Query context

Data

Schema/Context data.

Error

An error with a message and optional extensions.

ErrorExtensionValues

Extensions to the error.

InputValueError

An error parsing an input value.

Lookahead

A selection performed by a query.

Name
Number
QueryPathNode

The query path node

Request

GraphQL request.

ResolveId

Represents the unique id of the resolve

Response

Query response

Schema

GraphQL schema.

SchemaBuilder

Schema builder

ServerError

An error in a GraphQL server.

Variables

Variables of a query.

Enums

BatchRequest

Batch support for GraphQL requests, which is either a single query, or an array of queries

BatchResponse

Response for batchable queries

DeserializerError
ParseRequestError

An error parsing the request.

PathSegment

A segment of path to a resolver.

QueryPathSegment

The query path segment

SerializerError
ValidationMode

Validation mode

Value

Traits

ContainerType

A GraphQL container.

EnumType

A GraphQL enum.

ErrorExtensions

An error which can be extended into a FieldError.

InputObjectType

A GraphQL input object.

InputValueType

Represents a GraphQL input value

InterfaceType

A GraphQL interface.

ObjectType

A GraphQL object.

OutputValueType

Represents a GraphQL output value

ResultExt

Extend a Result's error value with ErrorExtensions.

ScalarType

A GraphQL scalar.

Type

Represents a GraphQL type

UnionType

A GraphQL interface.

Functions

from_value
to_value

Type Definitions

Context

Context object for resolve field

InputValueResult

An error parsing a value of type T.

Result

An alias for Result<T, Error>.

ServerResult

Alias for Result<T, ServerError>.

Attribute Macros

Object
Scalar
Subscription

Derive Macros

Enum
InputObject
Interface
MergedObject
MergedSubscription
SimpleObject
Union

Results for ContainerType

In Names
(2)
In Parameters
(0)
In Return Types
(0)
async_graphql::ContainerTypeA GraphQL container. 
async_graphql::resolver_utils::ContainerTypeA GraphQL container. 
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.