Crate async_graphql

source ·
Expand description

A GraphQL server library implemented in Rust

Documentation

Features

  • Fully supports async/await
  • Type safety
  • Rustfmt friendly (Procedural Macro)
  • Custom scalars
  • Minimal overhead
  • Easy integration (poem, 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(v2)
  • Batch Queries
  • Apollo Persisted Queries

Crate features

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

Integrations

License

Licensed under either of

References

Examples

All examples are in the sub-repository, located in the examples directory.

Run an example:

git submodule update # update the examples repo
cd examples && cargo run --bin [name]

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

Modules

Macros

Structs

Enums

Traits

Functions

  • Interpret a ConstValue as an instance of type T.
  • Convert a T into ConstValue which is an enum that can represent any valid GraphQL data.

Type Definitions

Attribute Macros

  • Define a complex GraphQL object for SimpleObject’s complex field resolver.
  • Define a directive for query.
  • Define a GraphQL object with methods
  • Define a Scalar
  • Define a GraphQL subscription

Derive Macros