12 releases (6 stable)

2.0.5 Oct 19, 2020
2.0.4 Oct 17, 2020

#9 in #graphql

Download history 2768/week @ 2020-10-31 3122/week @ 2020-11-07 3012/week @ 2020-11-14 2620/week @ 2020-11-21 2528/week @ 2020-11-28 1944/week @ 2020-12-05 2616/week @ 2020-12-12 1858/week @ 2020-12-19 1856/week @ 2020-12-26 3381/week @ 2021-01-02 2873/week @ 2021-01-09 2390/week @ 2021-01-16 2146/week @ 2021-01-23 2765/week @ 2021-01-30 2808/week @ 2021-02-06 2902/week @ 2021-02-13

517 downloads per month
Used in 11 crates (2 directly)

MIT/Apache

53KB
1.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

~0.9–1.6MB
~36K SLoC