diff --git a/links/gql_websocket_link/lib/src/link.dart b/links/gql_websocket_link/lib/src/link.dart index 4de9e5b67..6f56b0f8d 100644 --- a/links/gql_websocket_link/lib/src/link.dart +++ b/links/gql_websocket_link/lib/src/link.dart @@ -120,7 +120,8 @@ class WebSocketLink extends Link { this.graphQLSocketMessageDecoder = _defaultGraphQLSocketMessageDecoder, this.initialPayload, this.inactivityTimeout, - }) : assert(uri == null || (channelGenerator == null)) { + }) : assert((uri == null && channelGenerator != null) || + (uri != null && channelGenerator == null)) { _channelGenerator = channelGenerator ?? () => WebSocketChannel.connect(Uri.parse(uri!)); }