2020-05-31 19:00:19 +00:00
# A GraphQL server library implemented in Rust
2020-03-01 13:56:14 +00:00
< div align = "center" >
<!-- CI -->
2020-04-28 07:41:31 +00:00
< img src = "https://github.com/async-graphql/async-graphql/workflows/CI/badge.svg" / >
2020-04-05 08:22:13 +00:00
<!-- codecov -->
2020-06-02 01:31:13 +00:00
< img src = "https://codecov.io/gh/async-graphql/async-graphql/branch/master/graph/badge.svg" / >
2020-03-01 13:56:14 +00:00
<!-- Crates version -->
< a href = "https://crates.io/crates/async-graphql" >
< img src = "https://img.shields.io/crates/v/async-graphql.svg?style=flat-square"
alt="Crates.io version" />
< / a >
<!-- Downloads -->
< a href = "https://crates.io/crates/async-graphql" >
< img src = "https://img.shields.io/crates/d/async-graphql.svg?style=flat-square"
alt="Download" />
< / a >
<!-- docs.rs docs -->
< a href = "https://docs.rs/async-graphql" >
< img src = "https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square"
alt="docs.rs docs" />
< / a >
2020-11-05 19:50:43 +00:00
< a href = "https://github.com/rust-secure-code/safety-dance/" >
< img src = "https://img.shields.io/badge/unsafe-forbidden-success.svg?style=flat-square"
alt="Unsafe Rust forbidden" />
< / a >
2020-03-01 13:56:14 +00:00
< / div >
2020-05-03 13:46:38 +00:00
`Async-graphql` is a high-performance server-side library that supports all GraphQL specifications.
2020-03-12 09:21:49 +00:00
2020-05-03 13:46:38 +00:00
* [Feature Comparison ](feature-comparison.md )
2020-05-10 01:41:13 +00:00
* [Book ](https://async-graphql.github.io/async-graphql/en/index.html )
* [中文文档 ](https://async-graphql.github.io/async-graphql/zh-CN/index.html )
2020-03-21 07:11:46 +00:00
* [Docs ](https://docs.rs/async-graphql )
2020-04-28 07:41:31 +00:00
* [GitHub repository ](https://github.com/async-graphql/async-graphql )
2020-03-01 13:56:14 +00:00
* [Cargo package ](https://crates.io/crates/async-graphql )
2021-11-02 12:34:41 +00:00
* Minimum supported Rust version: 1.56.1 or later
2020-03-01 13:56:14 +00:00
2020-05-29 09:33:19 +00:00
## Safety
2020-06-03 11:33:32 +00:00
This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% Safe Rust.
2020-05-29 09:33:19 +00:00
2020-06-02 23:46:34 +00:00
## Features
2020-07-07 09:03:01 +00:00
* Fully supports async/await
2020-06-02 23:46:34 +00:00
* Type safety
* Rustfmt friendly (Procedural Macro)
2020-07-07 09:03:01 +00:00
* Custom scalars
2020-06-02 23:46:34 +00:00
* Minimal overhead
2021-08-23 15:16:31 +00:00
* Easy integration ([poem](https://crates.io/crates/poem), actix_web, tide, warp, rocket ...)
2020-06-02 23:46:34 +00:00
* Upload files (Multipart request)
2020-07-07 09:03:01 +00:00
* Subscriptions (WebSocket transport)
* Custom extensions
2020-06-02 23:46:34 +00:00
* Apollo Tracing extension
* Limit query complexity/depth
* Error Extensions
* Apollo Federation
2020-09-17 08:39:55 +00:00
* Batch Queries
2020-09-30 03:44:18 +00:00
* Apollo Persisted Queries
2020-09-26 03:25:21 +00:00
2021-03-22 02:39:17 +00:00
## Crate features
This crate offers the following features, all of which are not activated by default:
- `apollo_tracing` : Enable the [Apollo tracing extension ](extensions/struct.ApolloTracing.html ).
- `apollo_persisted_queries` : Enable the [Apollo persisted queries extension ](extensions/apollo_persisted_queries/struct.ApolloPersistedQueries.html ).
- `log` : Enable the [logger extension ](extensions/struct.Logger.html ).
- `tracing` : Enable the [tracing extension ](extensions/struct.Tracing.html ).
- `opentelemetry` : Enable the [OpenTelemetry extension ](extensions/struct.OpenTelemetry.html ).
- `unblock` : Support [asynchronous reader for Upload ](types/struct.Upload.html )
- `bson` : Integrate with the [`bson` crate ](https://crates.io/crates/bson ).
- `chrono` : Integrate with the [`chrono` crate ](https://crates.io/crates/chrono ).
- `chrono-tz` : Integrate with the [`chrono-tz` crate ](https://crates.io/crates/chrono-tz ).
- `url` : Integrate with the [`url` crate ](https://crates.io/crates/url ).
- `uuid` : Integrate with the [`uuid` crate ](https://crates.io/crates/uuid ).
- `string_number` : Enable the [StringNumber ](types/struct.StringNumber.html ).
- `dataloader` : Support [DataLoader ](dataloader/struct.DataLoader.html ).
2021-05-11 00:48:54 +00:00
- `secrecy` : Integrate with the [`secrecy` crate ](https://crates.io/crates/secrecy ).
2021-07-01 21:48:59 +00:00
- `decimal` : Integrate with the [`rust_decimal` crate ](https://crates.io/crates/rust_decimal ).
2021-09-02 11:39:45 +00:00
- `cbor` : Support for [serde_cbor ](https://crates.io/crates/serde_cbor ).
2021-03-22 02:39:17 +00:00
2021-07-22 14:25:40 +00:00
## Apollo Studio
Apollo Studio is a cloud platform that helps you build, monitor, validate, and secure your organization's data graph.
An existing extension is available for this crate [here ](https://github.com/async-graphql/async_graphql_apollo_studio_extension )
2020-04-14 01:53:17 +00:00
## Examples
2020-03-09 12:44:31 +00:00
2020-10-16 01:21:16 +00:00
All examples are in the [sub-repository ](https://github.com/async-graphql/examples ), located in the examples directory.
**Run an example:**
```shell
git submodule update # update the examples repo
cd examples & & cargo run --bin [name]
```
2020-03-09 12:44:31 +00:00
2020-03-18 00:44:41 +00:00
## Integrations
2021-08-23 15:16:31 +00:00
* Poem [async-graphql-poem ](https://crates.io/crates/async-graphql-poem )
2020-03-18 03:13:45 +00:00
* Actix-web [async-graphql-actix-web ](https://crates.io/crates/async-graphql-actix-web )
2020-04-14 03:44:08 +00:00
* Warp [async-graphql-warp ](https://crates.io/crates/async-graphql-warp )
2020-04-26 15:10:16 +00:00
* Tide [async-graphql-tide ](https://crates.io/crates/async-graphql-tide )
2020-09-14 08:46:15 +00:00
* Rocket [async-graphql-rocket ](https://github.com/async-graphql/async-graphql/tree/master/integrations/rocket )
2021-08-01 09:44:28 +00:00
* Axum [async-graphql-axum ](https://github.com/async-graphql/async-graphql/tree/master/integrations/axum )
2020-03-18 00:44:41 +00:00
2021-09-20 12:28:07 +00:00
**About actix-web-v4**: The beta version is supported in the branch `actix-web-beta` [Related Issue ](https://github.com/async-graphql/async-graphql/issues/590 )
2021-09-11 00:57:38 +00:00
## Who's using Async-graphql in production?
- [Vector ](https://vector.dev/ )
2021-09-24 03:20:47 +00:00
- [DiveDB ](https://divedb.net )
2021-09-11 00:57:38 +00:00
- [Kairos Sports tech ](https://kairostech.io/ )
- [AxieInfinity ](https://axieinfinity.com/ )
- [Nando's ](https://www.nandos.co.uk/ )
- [Prima.it ](https://www.prima.it/ )
- [VoxJar ](https://voxjar.com/ )
- [Zenly ](https://zen.ly/ )
- [Brevz ](https://brevz.io/ )
- [thorndyke ](https://www.thorndyke.ai/ )
2021-09-24 03:20:47 +00:00
## Community Showcase
- [rust-actix-graphql-sqlx-postgresql ](https://github.com/camsjams/rust-actix-graphql-sqlx-postgresql )
Using GraphQL with Rust and Apollo Federation
- [entity-rs ](https://github.com/chipsenkbeil/entity-rs ) A simplistic framework based on TAO, Facebook's distributed database for Social Graph.
- [vimwiki-server ](https://github.com/chipsenkbeil/vimwiki-rs/tree/master/vimwiki-server ) Provides graphql server to inspect and manipulate vimwiki files.
- [Diana ](https://github.com/arctic-hen7/diana ) Diana is a GraphQL system for Rust that's designed to work as simply as possible out of the box, without sacrificing configuration ability.
- [cindythink ](https://www.cindythink.com/ )
2021-07-14 04:24:50 +00:00
## Blog Posts
- [GraphQL in Rust ](https://romankudryashov.com/blog/2020/12/graphql-rust/ )
- [How to implement a Rust micro-service using Rocket, GraphQL, PostgreSQL ](https://lionkeng.medium.com/how-to-implement-a-rust-micro-service-using-rocket-graphql-postgresql-a3f455f2ae8b )
- [Running GraphQL on Lambda with Rust ](https://dylananthony.com/posts/graphql-lambda-rust )
2020-03-03 03:48:00 +00:00
## License
Licensed under either of
* Apache License, Version 2.0,
2021-04-19 14:38:46 +00:00
([LICENSE-APACHE](./LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](./LICENSE-MIT) or http://opensource.org/licenses/MIT)
2020-03-03 03:48:00 +00:00
at your option.
2020-03-01 14:13:37 +00:00
2020-03-01 13:56:14 +00:00
## References
* [GraphQL ](https://graphql.org )
2020-03-19 09:20:12 +00:00
* [GraphQL Multipart Request ](https://github.com/jaydenseric/graphql-multipart-request-spec )
* [GraphQL Cursor Connections Specification ](https://facebook.github.io/relay/graphql/connections.htm )
* [GraphQL over WebSocket Protocol ](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md )
2020-03-26 03:34:28 +00:00
* [Apollo Tracing ](https://github.com/apollographql/apollo-tracing )
2020-04-10 02:28:27 +00:00
* [Apollo Federation ](https://www.apollographql.com/docs/apollo-server/federation/introduction )
2020-03-22 08:45:59 +00:00
## Contribute
2020-05-25 21:37:46 +00:00
Welcome to contribute !