$ async-graphql-parser
v7.2.1GraphQL query parser for async-graphql
Latest Update Summary
Crate
Name: async-graphql-parser New version: 8.0.0-rc.1 Release date: 2026-01-22T19:23:33.578336Z
Crate readme
Short description a high-performance graphql server library that's fully specification compliant
Long description async-graphql is a high-performance GraphQL server library that fully supports static and dynamic schemas with async/await. It ensures type safety, has minimal overhead, and offers easy integrations with popular web frameworks such as poem, actix-web, and warp. The crate is safe as it forbids unsafe code and has a minimum supported Rust version of 1.86.0.
Features • Static and dynamic schemas are fully supported • Fully supports async/await • Type safety • Easy integration (poem, axum, actix-web, warp, rocket) • Upload files (Multipart request) • Subscriptions (WebSocket transport) • Limit query complexity/depth • Apollo Federation(v2)
Code Examples Static schema example
use std::error::Error;
use async_graphql::{http::GraphiQLSource, EmptyMutation, EmptySubscription, Object, Schema};
use async_graphql_poem::*;
use poem::{listener::TcpListener, web::Html, *};
struct Query;
#[Object]
impl Query {
async fn howdy(&self) -> &'static str {
"partner"
}
}
#[handler]
async fn graphiql() -> impl IntoResponse {
Html(GraphiQLSource::build().finish())
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
// create the schema
let schema = Schema::build(Query, EmptyMutation, EmptySubscription).finish();
// start the http server
let app = Route::new().at("/", get(graphiql).post(GraphQL::new(schema)));
println!("GraphiQL: http://localhost:8000");
Server::new(TcpListener::bind("0.0.0.0:8000"))
.run(app)
.await?;
Ok(())
}
Dynamic schema example
use std::error::Error;
use async_graphql::{dynamic::*, http::GraphiQLSource};
use async_graphql_poem::*;
use poem::{listener::TcpListener, web::Html, *};
#[handler]
async fn graphiql() -> impl IntoResponse {
Html(GraphiQLSource::build().finish())
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let query = Object::new("Query").field(Field::new(
"howdy",
TypeRef::named_nn(TypeRef::STRING),
|_| FieldFuture::new(async { "partner" }),
));
// create the schema
let schema = Schema::build(query, None, None).register(query).finish()?;
// start the http server
let app = Route::new().at("/", get(graphiql).post(GraphQL::new(schema)));
println!("GraphiQL: http://localhost:8000");
Server::new(TcpListener::bind("0.0.0.0:8000"))
.run(app)
.await?;
Ok(())
}
Links • https://async-graphql.github.io/async-graphql/en/index.html • https://async-graphql.github.io/async-graphql/zh-CN/index.html • https://docs.rs/async-graphql • https://github.com/async-graphql/async-graphql • https://crates.io/crates/async-graphql
https://docs.rs/async-graphql/
Release info
Release version: N/A
Release description N/A
Code Examples N/A
Patch update: 7.2.1 → 7.2.1
$ DOWNLOADS TREND
$ VERSION HISTORY
$ LINKS
$ INSTALL
cargo add async-graphql-parserOr add to Cargo.toml: async-graphql-parser = "7.2.1"