Crate juniper_axum
source ·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§
- Types and traits for extracting data from
Request
s. JuniperResponse
definition.- Definitions for handling GraphQL subscriptions.
Functions§
Handler
, which handles aJuniperRequest
with the specifiedSchema
, byextract
ing it fromExtension
s and initializing its freshSchema::Context
as aDefault
one.- Creates a
Handler
with the specifiedSchema
, which will serve the newgraphql-transport-ws
GraphQL over WebSocket Protocol. - Creates a
Handler
with the specifiedSchema
, which will serve the legacygraphql-ws
GraphQL over WebSocket Protocol. - Creates a
Handler
that replies with an HTML page containing GraphQL Playground. - 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.