Docs.rs
  • async-graphql-2.0.0-alpha.21
    • async-graphql 2.0.0-alpha.21
    • Docs.rs crate page
    • MIT/Apache-2.0
    • Links
    • Repository
    • crates.io
    • Source
    • Owners
    • sunli829
    • Dependencies
      • async-graphql-derive ^2.0.0-alpha.21 normal
      • async-graphql-parser ^2.0.0-alpha.21 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
      • 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.37% 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
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • 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.21

See all async_graphql's items

  • Re-exports
  • Modules
  • Structs
  • Enums
  • Traits
  • 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

Crate features

This crate offers the following features, all of which are activated by default:

  • apollo_tracing: Enable the Apollo tracing 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 resolver_utils::EnumType;
pub use resolver_utils::ObjectType;
pub use resolver_utils::ScalarType;
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.

FieldError

An error in a field resolver.

Lookahead

A selection performed by a query.

Number

Represents a JSON number, whether integer or floating point.

QueryPathNode

The query path node

Request

GraphQL request.

ResolveId

Represents the unique id of the resolve

Response

Query response

RuleError

Verification error.

Schema

GraphQL schema.

SchemaBuilder

Schema builder

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

Error

An error serving a GraphQL query.

InputValueError

An error in the format of an input value.

ParseRequestError

An error parsing the request.

QueryError

An error processing a GraphQL query.

QueryPathSegment

The query path segment

ValidationMode

Validation mode

Value

A resolved GraphQL value, for example 1 or "Hello World!".

Traits

ErrorExtensions

An error which can be extended into a FieldError.

InputValueType

Represents a GraphQL input value

OutputValueType

Represents a GraphQL output value

ResultExt

Extend a Result's error value with ErrorExtensions.

Type

Represents a GraphQL type

Type Definitions

Context

Context object for resolve field

FieldResult

An alias for Result<T, FieldError>.

InputValueResult

An alias for Result<T, InputValueError>.

Result

Result type

Attribute Macros

Object

Define a GraphQL object with methods

Scalar

Define a Scalar

Subscription

Define a GraphQL subscription

Derive Macros

Enum

Define a GraphQL enum

InputObject

Define a GraphQL input object

Interface

Define a GraphQL interface

MergedObject

Define a merged object with multiple object types.

MergedSubscription

Define a merged subscription with multiple subscription types.

SimpleObject

Define a GraphQL object with fields

Union

Define a GraphQL union

Results for OutputValueType

In Names
(1)
In Parameters
(0)
In Return Types
(0)
async_graphql::OutputValueTypeRepresents a GraphQL output value 
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.