Crate juniper_axum

Source
Expand description

§juniper_axum crate

Crates.io Documentation CI Rust 1.73+

axum web server integration for juniper (GraphQL implementation for Rust).

§Documentation

For documentation, including guides and examples, check out Juniper Book.

A basic usage example can also be found in the API docs.

§Examples

Check examples/simple.rs and examples/custom.rs for example code of a working axum server with GraphQL handlers.

§License

This project is licensed under BSD 2-Clause License.

Modules§

extract
Types and traits for extracting data from Requests.
response
JuniperResponse definition.
subscriptions
Definitions for handling GraphQL subscriptions.

Functions§

graphiql
Creates a Handler that replies with an HTML page containing GraphiQL.
graphql
Handler, which handles a JuniperRequest with the specified Schema, by extracting it from Extensions and initializing its fresh Schema::Context as a Default one.
graphql_transport_ws
Creates a Handler with the specified Schema, which will serve the new graphql-transport-ws GraphQL over WebSocket Protocol.
graphql_ws
Creates a Handler with the specified Schema, which will serve the legacy graphql-ws GraphQL over WebSocket Protocol.
playground
Creates a Handler that replies with an HTML page containing GraphQL Playground.
ws
Creates a Handler with the specified Schema, which will serve either the legacy graphql-ws GraphQL over WebSocket Protocol or the new graphql-transport-ws GraphQL over WebSocket Protocol, by auto-selecting between them, based on the Sec-Websocket-Protocol HTTP header value.