From 2afd58362b2b107197004a14a61152ec8985fa1f Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Wed, 13 Jul 2022 01:53:00 +0100 Subject: [PATCH] deprecate(graphql): deprecate the `SocketSubProtocol` to improve naming Signed-off-by: Vincenzo Palazzo --- .../src/links/websocket_link/websocket_client.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/graphql/lib/src/links/websocket_link/websocket_client.dart b/packages/graphql/lib/src/links/websocket_link/websocket_client.dart index de8ce0c81..ddcb5c031 100644 --- a/packages/graphql/lib/src/links/websocket_link/websocket_client.dart +++ b/packages/graphql/lib/src/links/websocket_link/websocket_client.dart @@ -141,8 +141,20 @@ class SocketClientConfig { } } +/// All the protocol supported by the library +@Deprecated("`SocketSubProtocol`is deprecated and will be removed in the version 5.2.0, consider to use `GraphQLProtocol`") class SocketSubProtocol { SocketSubProtocol._(); + /// graphql-ws: The new (not to be confused with the graphql-ws library). + /// NB. This protocol is it no longer maintained, please consider + /// to use `SocketSubProtocol.graphqlTransportWs`. + static const String graphqlWs = GraphQLProtocol.graphqlWs; + /// graphql-transport-ws: New ws protocol used by most Apollo Server instances + /// with subscriptions enabled use this library. + /// N.B: not to be confused with the graphql-ws library that implement the + /// old ws protocol. + static const String graphqlTransportWs = GraphQLProtocol.graphqlWs; +} static const String graphqlWs = "graphql-ws"; static const String graphqlTransportWs = "graphql-transport-ws";