{"id":13467895,"url":"https://github.com/async-graphql/async-graphql","last_synced_at":"2025-05-12T05:19:09.641Z","repository":{"id":37402783,"uuid":"244132245","full_name":"async-graphql/async-graphql","owner":"async-graphql","description":"A GraphQL server library implemented in Rust","archived":false,"fork":false,"pushed_at":"2025-05-11T02:29:12.000Z","size":13054,"stargazers_count":3489,"open_issues_count":234,"forks_count":488,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-05-12T02:43:21.533Z","etag":null,"topics":["async-await","graphql","hacktoberfest","rust","rust-crate","rust-lang","server"],"latest_commit_sha":null,"homepage":"https://async-graphql.github.io/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/async-graphql.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"sunli829"}},"created_at":"2020-03-01T10:54:40.000Z","updated_at":"2025-05-11T18:57:54.000Z","dependencies_parsed_at":"2023-11-18T03:29:09.480Z","dependency_job_id":"6bf67c42-1ac5-454e-8d9f-5c257fc2804d","html_url":"https://github.com/async-graphql/async-graphql","commit_stats":{"total_commits":2425,"total_committers":252,"mean_commits":9.623015873015873,"dds":"0.32041237113402066","last_synced_commit":"6299700f110867a32466f198ddb1233cd1ae118a"},"previous_names":[],"tags_count":1779,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fasync-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fasync-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fasync-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/async-graphql%2Fasync-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/async-graphql","download_url":"https://codeload.github.com/async-graphql/async-graphql/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672696,"owners_count":21945480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-await","graphql","hacktoberfest","rust","rust-crate","rust-lang","server"],"created_at":"2024-07-31T15:01:02.139Z","updated_at":"2025-05-12T05:19:09.611Z","avatar_url":"https://github.com/async-graphql.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\u003csamp\u003e\n\n# async-graphql\n\n**a high-performance graphql server library that's fully specification compliant**\n\n\u003c/samp\u003e\n\n[Book](https://async-graphql.github.io/async-graphql/en/index.html) • [中文文档](https://async-graphql.github.io/async-graphql/zh-CN/index.html) • [Docs](https://docs.rs/async-graphql) • [GitHub repository](https://github.com/async-graphql/async-graphql) • [Cargo package](https://crates.io/crates/async-graphql)\n\n---\n\n![ci status](https://github.com/async-graphql/async-graphql/workflows/CI/badge.svg)\n[![code coverage](https://codecov.io/gh/async-graphql/async-graphql/branch/master/graph/badge.svg)](https://codecov.io/gh/async-graphql/async-graphql/)\n[![Unsafe Rust forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)\n[![Crates.io version](https://img.shields.io/crates/v/async-graphql.svg)](https://crates.io/crates/async-graphql)\n[![docs.rs docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://docs.rs/async-graphql)\n[![downloads](https://img.shields.io/crates/d/async-graphql.svg)](https://crates.io/crates/async-graphql)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/async-graphql/async-graphql/compare)\n\n_This crate uses `#![forbid(unsafe_code)]` to ensure everything is implemented in 100% safe Rust._\n\n\u003c/div\u003e\n\n## Static schema\n\n```rs\nuse std::error::Error;\n\nuse async_graphql::{http::GraphiQLSource, EmptyMutation, EmptySubscription, Object, Schema};\nuse async_graphql_poem::*;\nuse poem::{listener::TcpListener, web::Html, *};\n\nstruct Query;\n\n#[Object]\nimpl Query {\n    async fn howdy(\u0026self) -\u003e \u0026'static str {\n        \"partner\"\n    }\n}\n\n#[handler]\nasync fn graphiql() -\u003e impl IntoResponse {\n    Html(GraphiQLSource::build().finish())\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    // create the schema\n    let schema = Schema::build(Query, EmptyMutation, EmptySubscription).finish();\n\n    // start the http server\n    let app = Route::new().at(\"/\", get(graphiql).post(GraphQL::new(schema)));\n    println!(\"GraphiQL: http://localhost:8000\");\n    Server::new(TcpListener::bind(\"0.0.0.0:8000\"))\n        .run(app)\n        .await?;\n    Ok(())\n}\n```\n\n## Dynamic schema\nRequires the `dynamic-schema` feature to be enabled.\n\n```rs\nuse std::error::Error;\n\nuse async_graphql::{dynamic::*, http::GraphiQLSource};\nuse async_graphql_poem::*;\nuse poem::{listener::TcpListener, web::Html, *};\n\n#[handler]\nasync fn graphiql() -\u003e impl IntoResponse {\n    Html(GraphiQLSource::build().finish())\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let query = Object::new(\"Query\").field(Field::new(\n        \"howdy\",\n        TypeRef::named_nn(TypeRef::STRING),\n        |_| FieldFuture::new(async { \"partner\" }),\n    ));\n\n    // create the schema\n    let schema = Schema::build(query, None, None).register(query).finish()?;\n\n    // start the http server\n    let app = Route::new().at(\"/\", get(graphiql).post(GraphQL::new(schema)));\n    println!(\"GraphiQL: http://localhost:8000\");\n    Server::new(TcpListener::bind(\"0.0.0.0:8000\"))\n        .run(app)\n        .await?;\n    Ok(())\n}\n```\n\n## ⚠️Security\n\nI strongly recommend limiting the [complexity and depth](https://async-graphql.github.io/async-graphql/en/depth_and_complexity.html?highlight=complex#limiting-query-complexity) of queries in a production environment to avoid possible DDos attacks.\n\n- [SchemaBuilder.limit_complexity](https://docs.rs/async-graphql/latest/async_graphql/struct.SchemaBuilder.html#method.limit_complexity)\n- [SchemaBuilder.limit_depth](https://docs.rs/async-graphql/latest/async_graphql/struct.SchemaBuilder.html#method.limit_depth)\n- [SchemaBuilder.limit_directives](https://docs.rs/async-graphql/latest/async_graphql/struct.SchemaBuilder.html#method.limit_directives)\n\n## Features\n\n- Static and dynamic schemas are fully supported\n- Fully supports async/await\n- Type safety\n- Rustfmt friendly (Procedural Macro)\n- Custom scalars\n- Minimal overhead\n- Easy integration ([poem](https://crates.io/crates/poem), [axum](https://crates.io/crates/axum), [actix-web](https://crates.io/crates/actix-web), [tide](https://crates.io/crates/tide), [warp](https://crates.io/crates/warp), [rocket](https://crates.io/crates/rocket) ...)\n- Upload files (Multipart request)\n- Subscriptions (WebSocket transport)\n- Custom extensions\n- Error extensions\n- Limit query complexity/depth\n- Batch queries\n- Apollo Persisted Queries\n- Apollo Tracing extension\n- Apollo Federation(v2)\n\n\u003e **Note**: Minimum supported Rust version: 1.86.0 or later\n\n## Examples\n\nAll examples are in the [sub-repository](https://github.com/async-graphql/examples), located in the examples directory.\n\n```shell\ngit submodule update # update the examples repo\ncd examples \u0026\u0026 cargo run --bin [name]\n```\n\nFor more information, see the [sub-repository](https://github.com/async-graphql/examples) README.md.\n\n## Integrations\n\nIntegrations are what glue `async-graphql` with your web server, here are provided ones, or you can build your own!\n\n- Poem [async-graphql-poem](https://crates.io/crates/async-graphql-poem)\n- Actix-web [async-graphql-actix-web](https://crates.io/crates/async-graphql-actix-web)\n- Warp [async-graphql-warp](https://crates.io/crates/async-graphql-warp)\n- Tide [async-graphql-tide](https://crates.io/crates/async-graphql-tide)\n- Rocket [async-graphql-rocket](https://github.com/async-graphql/async-graphql/tree/master/integrations/rocket)\n- Axum [async-graphql-axum](https://github.com/async-graphql/async-graphql/tree/master/integrations/axum)\n\n## Crate features\n\nThis crate offers the following features. Most are not activated by default, except the integrations of GraphiQL (`graphiql`) and GraphQL Playground (`playground`):\n\n| feature                        | enables                                                                                                                                                                                       |\n|:-------------------------------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| **`apollo_tracing`**           | Enable the [Apollo tracing extension](https://docs.rs/async-graphql/latest/async_graphql/extensions/struct.ApolloTracing.html).                                                               |\n| **`apollo_persisted_queries`** | Enable the [Apollo persisted queries extension](https://docs.rs/async-graphql/latest/async_graphql/extensions/apollo_persisted_queries/struct.ApolloPersistedQueries.html).                   |\n| **`boxed-trait`**              | Enables [`async-trait`](https://crates.io/crates/async-trait) for all traits.                                                                                                                 |\n| **`bson`**                     | Integrate with the [`bson` crate](https://crates.io/crates/bson).                                                                                                                             |\n| **`bigdecimal`**               | Integrate with the [`bigdecimal` crate](https://crates.io/crates/bigdecimal).                                                                                                                 |\n| **`cbor`**                     | Support for [serde_cbor](https://crates.io/crates/serde_cbor).                                                                                                                                |\n| **`chrono`**                   | Integrate with the [`chrono` crate](https://crates.io/crates/chrono).                                                                                                                         |\n| **`chrono-tz`**                | Integrate with the [`chrono-tz` crate](https://crates.io/crates/chrono-tz).                                                                                                                   |\n| **`dataloader`**               | Support [DataLoader](dataloader/struct.DataLoader.html).                                                                                                                                      |\n| **`decimal`**                  | Integrate with the [`rust_decimal` crate](https://crates.io/crates/rust_decimal).                                                                                                             |\n| **`dynamic-schema`**           | Support dynamic schema                                                                                                                                                                        |\n| **`fast_chemail`**             | Integrate with the [`fast_chemail` crate](https://crates.io/crates/fast_chemail).                                                                                                             |\n| **`graphiql`**                 | Enables the [GraphiQL IDE](https://github.com/graphql/graphiql) integration                                                                                                                   |\n| **`hashbrown`**                | Integrate with the [`hashbrown` crate](https://github.com/rust-lang/hashbrown).                                                                                                               |\n| **`log`**                      | Enable the [Logger extension](https://docs.rs/async-graphql/latest/async_graphql/extensions/struct.Logger.html).                                                                              |\n| **`opentelemetry`**            | Enable the [OpenTelemetry extension](https://docs.rs/async-graphql/latest/async_graphql/extensions/struct.OpenTelemetry.html).                                                                |\n| **`playground`**               | Enables the [GraphQL playground IDE](https://github.com/graphql/graphql-playground) integration                                                                                               |\n| **`rawvalue`**                 | Support raw values from [`serde_json`](https://crates.io/crates/serde_json)                                                                                                                   |\n| **`secrecy`**                  | Integrate with the [`secrecy` crate](https://crates.io/crates/secrecy).                                                                                                                       |\n| **`smol_str`**                 | Integrate with the [`smol_str` crate](https://crates.io/crates/smol_str).                                                                                                                     |\n| **`string_number`**            | Enable the [StringNumber](types/struct.StringNumber.html).                                                                                                                                    |\n| **`time`**                     | Integrate with the [`time` crate](https://github.com/time-rs/time).                                                                                                                           |\n| **`tracing`**                  | Enable the [Tracing extension](https://docs.rs/async-graphql/latest/async_graphql/extensions/struct.Tracing.html).                                                                            |\n| **`tempfile`**                 | Save the uploaded content in the temporary file.                                                                                                                                              |\n| **`tokio-sync`**               | Integrate with the [`tokio::sync::RwLock`](https://docs.rs/tokio/1.18.1/tokio/sync/struct.RwLock.html) and [`tokio::sync::Mutex`](https://docs.rs/tokio/1.18.1/tokio/sync/struct.Mutex.html). |\n| **`unblock`**                  | Support [Asynchronous reader for Upload](types/struct.Upload.html)                                                                                                                            |\n| **`uuid`**                     | Integrate with the [`uuid` crate](https://crates.io/crates/uuid).                                                                                                                             |\n| **`url`**                      | Integrate with the [`url` crate](https://crates.io/crates/url).                                                                                                                               |\n\n### Observability\n\nOne of the tools used to monitor your graphql server in production is Apollo Studio. Apollo Studio is a cloud platform that helps you build, monitor, validate, and secure your organization's data graph.\nAdd the extension crate [`async_graphql_apollo_studio_extension`](https://github.com/async-graphql/async_graphql_apollo_studio_extension) to make this avaliable.\n\n## Who's using `async-graphql` in production?\n\n- [Vector](https://vector.dev/)\n- [DiveDB](https://divedb.net)\n- [Kairos Sports tech](https://kairostech.io/)\n- [AxieInfinity](https://axieinfinity.com/)\n- [Nando's](https://www.nandos.co.uk/)\n- [Prima.it](https://www.prima.it/)\n- [VoxJar](https://voxjar.com/)\n- [Zenly](https://zen.ly/)\n- [Brevz](https://brevz.io/)\n- [thorndyke](https://www.thorndyke.ai/)\n- [My Data My Consent](https://mydatamyconsent.com/)\n\n## Community Showcase\n\n- [rust-actix-graphql-sqlx-postgresql](https://github.com/camsjams/rust-actix-graphql-sqlx-postgresql)\n  Using GraphQL with Rust and Apollo Federation\n- [entity-rs](https://github.com/chipsenkbeil/entity-rs) A simplistic framework based on TAO, Facebook's distributed database for Social Graph.\n- [vimwiki-server](https://github.com/chipsenkbeil/vimwiki-rs/tree/master/vimwiki-server) Provides graphql server to inspect and manipulate vimwiki files.\n- [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.\n- [cindythink](https://www.cindythink.com/)\n- [sudograph](https://github.com/sudograph/sudograph)\n\n## Blog Posts\n\n- [Async GraphQL with Rust](https://formidable.com/blog/2022/async-graphql-with-rust-1/)\n- [GraphQL in Rust](https://romankudryashov.com/blog/2020/12/graphql-rust/)\n- [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)\n- [Running GraphQL on Lambda with Rust](https://dylananthony.com/posts/graphql-lambda-rust)\n\n## References\n\n- [GraphQL](https://graphql.org)\n- [GraphQL Multipart Request](https://github.com/jaydenseric/graphql-multipart-request-spec)\n- [Multipart HTTP protocol for GraphQL subscriptions](https://www.apollographql.com/docs/router/executing-operations/subscription-multipart-protocol/)\n- [GraphQL Cursor Connections Specification](https://facebook.github.io/relay/graphql/connections.htm)\n- [GraphQL over WebSocket Protocol](https://github.com/apollographql/subscriptions-transport-ws/blob/master/PROTOCOL.md)\n- [Apollo Tracing](https://github.com/apollographql/apollo-tracing)\n- [Apollo Federation](https://www.apollographql.com/docs/apollo-server/federation/introduction)\n\n## License\n\nLicensed under either of\n\n- Apache License, Version 2.0,\n  ([LICENSE-APACHE](./LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](./LICENSE-MIT) or http://opensource.org/licenses/MIT)\n  at your option.\n","funding_links":["https://github.com/sponsors/sunli829"],"categories":["Libraries","Rust","库 Libraries","Recently Updated","server","Implementations"],"sub_categories":["Asynchronous","Web programming","网络编程 Web programming","[Apr 03, 2025](/content/2025/04/03/README.md)","Rust"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasync-graphql%2Fasync-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fasync-graphql%2Fasync-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fasync-graphql%2Fasync-graphql/lists"}