@@ -183,7 +183,7 @@ pub mod subscriptions {
183183 SinkExt as _, Stream , StreamExt as _,
184184 } ;
185185 use juniper:: { GraphQLSubscriptionType , GraphQLTypeAsync , RootNode , ScalarValue } ;
186- use juniper_graphql_transport_ws :: { ArcSchema , Init } ;
186+ use juniper_graphql_ws :: { graphql_transport_ws , graphql_ws , ArcSchema , Init } ;
187187 use tokio:: sync:: Mutex ;
188188
189189 /// Serves by auto-selecting between the
@@ -194,11 +194,10 @@ pub mod subscriptions {
194194 /// The `schema` argument is your [`juniper`] schema.
195195 ///
196196 /// The `init` argument is used to provide the custom [`juniper::Context`] and additional
197- /// configuration for connections. This can be a
198- /// [`juniper_graphql_transport_ws::ConnectionConfig`] if the context and configuration are
199- /// already known, or it can be a closure that gets executed asynchronously whenever a client
200- /// sends the subscription initialization message. Using a closure allows to perform an
201- /// authentication based on the parameters provided by a client.
197+ /// configuration for connections. This can be a [`juniper_graphql_ws::ConnectionConfig`] if the
198+ /// context and configuration are already known, or it can be a closure that gets executed
199+ /// asynchronously whenever a client sends the subscription initialization message. Using a
200+ /// closure allows to perform an authentication based on the parameters provided by a client.
202201 ///
203202 /// [new]: https://github.com/enisdenjo/graphql-ws/blob/v5.14.0/PROTOCOL.md
204203 /// [old]: https://github.com/apollographql/subscriptions-transport-ws/blob/v0.11.0/PROTOCOL.md
@@ -262,8 +261,7 @@ pub mod subscriptions {
262261 S : ScalarValue + Send + Sync + ' static ,
263262 I : Init < S , CtxT > + Send ,
264263 {
265- let ( s_tx, s_rx) =
266- juniper_graphql_ws:: Connection :: new ( ArcSchema ( schema) , init) . split :: < Message > ( ) ;
264+ let ( s_tx, s_rx) = graphql_ws:: Connection :: new ( ArcSchema ( schema) , init) . split :: < Message > ( ) ;
267265
268266 let mut resp = ws:: start (
269267 Actor {
@@ -285,10 +283,10 @@ pub mod subscriptions {
285283 /// Serves the [new `graphql-transport-ws` GraphQL over WebSocket Protocol][new].
286284 ///
287285 /// The `init` argument is used to provide the context and additional configuration for
288- /// connections. This can be a [`juniper_graphql_transport_ws ::ConnectionConfig`] if the context
289- /// and configuration are already known, or it can be a closure that gets executed
290- /// asynchronously when the client sends the `ConnectionInit` message. Using a closure allows to
291- /// perform an authentication based on the parameters provided by a client.
286+ /// connections. This can be a [`juniper_graphql_ws ::ConnectionConfig`] if the context and
287+ /// configuration are already known, or it can be a closure that gets executed asynchronously
288+ /// when the client sends the `ConnectionInit` message. Using a closure allows to perform an
289+ /// authentication based on the parameters provided by a client.
292290 ///
293291 /// [new]: https://github.com/enisdenjo/graphql-ws/blob/v5.14.0/PROTOCOL.md
294292 pub async fn graphql_transport_ws_handler < Query , Mutation , Subscription , CtxT , S , I > (
@@ -308,8 +306,8 @@ pub mod subscriptions {
308306 S : ScalarValue + Send + Sync + ' static ,
309307 I : Init < S , CtxT > + Send ,
310308 {
311- let ( s_tx, s_rx) = juniper_graphql_transport_ws :: Connection :: new ( ArcSchema ( schema ) , init )
312- . split :: < Message > ( ) ;
309+ let ( s_tx, s_rx) =
310+ graphql_transport_ws :: Connection :: new ( ArcSchema ( schema ) , init ) . split :: < Message > ( ) ;
313311
314312 let mut resp = ws:: start (
315313 Actor {
@@ -429,7 +427,7 @@ pub mod subscriptions {
429427 fn into_ws_response ( self ) -> Result < String , ws:: CloseReason > ;
430428 }
431429
432- impl < S : ScalarValue > IntoWsResponse for juniper_graphql_transport_ws :: Output < S > {
430+ impl < S : ScalarValue > IntoWsResponse for graphql_transport_ws :: Output < S > {
433431 fn into_ws_response ( self ) -> Result < String , ws:: CloseReason > {
434432 match self {
435433 Self :: Message ( msg) => serde_json:: to_string ( & msg) . map_err ( |e| ws:: CloseReason {
@@ -444,7 +442,7 @@ pub mod subscriptions {
444442 }
445443 }
446444
447- impl < S : ScalarValue > IntoWsResponse for juniper_graphql_ws :: ServerMessage < S > {
445+ impl < S : ScalarValue > IntoWsResponse for graphql_ws :: ServerMessage < S > {
448446 fn into_ws_response ( self ) -> Result < String , ws:: CloseReason > {
449447 serde_json:: to_string ( & self ) . map_err ( |e| ws:: CloseReason {
450448 code : ws:: CloseCode :: Error ,
@@ -456,7 +454,7 @@ pub mod subscriptions {
456454 #[ derive( Debug ) ]
457455 struct Message ( ws:: Message ) ;
458456
459- impl < S : ScalarValue > TryFrom < Message > for juniper_graphql_transport_ws :: Input < S > {
457+ impl < S : ScalarValue > TryFrom < Message > for graphql_transport_ws :: Input < S > {
460458 type Error = Error ;
461459
462460 fn try_from ( msg : Message ) -> Result < Self , Self :: Error > {
@@ -470,7 +468,7 @@ pub mod subscriptions {
470468 }
471469 }
472470
473- impl < S : ScalarValue > TryFrom < Message > for juniper_graphql_ws :: ClientMessage < S > {
471+ impl < S : ScalarValue > TryFrom < Message > for graphql_ws :: ClientMessage < S > {
474472 type Error = Error ;
475473
476474 fn try_from ( msg : Message ) -> Result < Self , Self :: Error > {
0 commit comments