69 releases (31 stable)

new 2.5.9 Feb 28, 2021
2.4.6 Jan 10, 2021
2.1.2 Nov 14, 2020
1.18.1 Sep 11, 2020
0.5.1 May 18, 2020

#412 in Asynchronous

Download history 3989/week @ 2020-11-07 3709/week @ 2020-11-14 3164/week @ 2020-11-21 3340/week @ 2020-11-28 2844/week @ 2020-12-05 3269/week @ 2020-12-12 1987/week @ 2020-12-19 1939/week @ 2020-12-26 3941/week @ 2021-01-02 3319/week @ 2021-01-09 2697/week @ 2021-01-16 2628/week @ 2021-01-23 3046/week @ 2021-01-30 2968/week @ 2021-02-06 3618/week @ 2021-02-13 2547/week @ 2021-02-20

12,533 downloads per month
Used in 12 crates (3 directly)

MIT/Apache

140KB
3.5K SLoC

A GraphQL server library implemented in Rust

Async-graphql is a high-performance server-side library that supports all GraphQL specifications.

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% Safe Rust.

Features

  • Fully supports async/await
  • Type safety
  • Rustfmt friendly (Procedural Macro)
  • Custom scalars
  • Minimal overhead
  • Easy integration (actix_web, tide, warp, rocket ...)
  • Upload files (Multipart request)
  • Subscriptions (WebSocket transport)
  • Custom extensions
  • Apollo Tracing extension
  • Limit query complexity/depth
  • Error Extensions
  • Apollo Federation
  • Batch Queries
  • Apollo Persisted Queries

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]

Benchmark

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

cd benchmark

#measure all with system malloc
cargo bench

#measure only chat run
cargo bench -- "chat run"

#measure all with jemalloc
cargo bench --features jemalloc

#measure only simple run with jemalloc
cargo bench --features jemalloc -- "simple run"

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

Read more here: https://bheisler.github.io/criterion.rs/book/criterion_rs.html

Integrations

License

Licensed under either of

References

Contribute

Welcome to contribute !

Dependencies

~1.8–2.6MB
~59K SLoC