Expand description
§juniper_axum
crate
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
Request
s. - 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 aJuniperRequest
with the specifiedSchema
, byextract
ing it fromExtension
s and initializing its freshSchema::Context
as aDefault
one.- graphql_
transport_ ws - Creates a
Handler
with the specifiedSchema
, which will serve the newgraphql-transport-ws
GraphQL over WebSocket Protocol. - graphql_
ws - Creates a
Handler
with the specifiedSchema
, which will serve the legacygraphql-ws
GraphQL over WebSocket Protocol. - playground
- Creates a
Handler
that replies with an HTML page containing GraphQL Playground. - ws
- Creates a
Handler
with the specifiedSchema
, which will serve either the legacygraphql-ws
GraphQL over WebSocket Protocol or the newgraphql-transport-ws
GraphQL over WebSocket Protocol, by auto-selecting between them, based on theSec-Websocket-Protocol
HTTP header value.