Function juniper_actix::subscriptions::graphql_ws_handler
source · pub async fn graphql_ws_handler<Query, Mutation, Subscription, CtxT, S, I>(
req: HttpRequest,
stream: Payload,
schema: Arc<RootNode<'static, Query, Mutation, Subscription, S>>,
init: I
) -> Result<HttpResponse, Error>where
Query: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static,
Query::TypeInfo: Send + Sync,
Mutation: GraphQLTypeAsync<S, Context = CtxT> + Send + 'static,
Mutation::TypeInfo: Send + Sync,
Subscription: GraphQLSubscriptionType<S, Context = CtxT> + Send + 'static,
Subscription::TypeInfo: Send + Sync,
CtxT: Unpin + Send + Sync + 'static,
S: ScalarValue + Send + Sync + 'static,
I: Init<S, CtxT> + Send,
Expand description
Serves the legacy graphql-ws
GraphQL over WebSocket Protocol.
The init
argument is used to provide the context and additional configuration for
connections. This can be a juniper_graphql_ws::ConnectionConfig
if the context and
configuration are already known, or it can be a closure that gets executed asynchronously
when the client sends the GQL_CONNECTION_INIT
message. Using a closure allows to perform
an authentication based on the parameters provided by a client.
WARNING: This protocol has been deprecated in favor of the new
graphql-transport-ws
GraphQL over WebSocket Protocol, which is provided by thegraphql_transport_ws_handler()
function.