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
Requests. - response
JuniperResponsedefinition.- subscriptions
- Definitions for handling GraphQL subscriptions.
Functions§
- graphiql
- Creates a
Handlerthat replies with an HTML page containing GraphiQL. - graphql
Handler, which handles aJuniperRequestwith the specifiedSchema, byextracting it fromExtensions and initializing its freshSchema::Contextas aDefaultone.- graphql_
transport_ ws - Creates a
Handlerwith the specifiedSchema, which will serve the newgraphql-transport-wsGraphQL over WebSocket Protocol. - graphql_
ws - Creates a
Handlerwith the specifiedSchema, which will serve the legacygraphql-wsGraphQL over WebSocket Protocol. - playground
- Creates a
Handlerthat replies with an HTML page containing GraphQL Playground. - ws
- Creates a
Handlerwith the specifiedSchema, which will serve either the legacygraphql-wsGraphQL over WebSocket Protocol or the newgraphql-transport-wsGraphQL over WebSocket Protocol, by auto-selecting between them, based on theSec-Websocket-ProtocolHTTP header value.