graphql_ws_web_socket_channel_connector 0.1.0 copy "graphql_ws_web_socket_channel_connector: ^0.1.0" to clipboard
graphql_ws_web_socket_channel_connector: ^0.1.0 copied to clipboard

A graphql_ws WebSocketConnector backed by package:web_socket_channel. Lets graphql_ws run on Flutter web (and anywhere else web_socket_channel is supported) without dropping graphql_ws's zero-dependency core.

graphql_ws_web_socket_channel_connector #

A WebSocketConnector for graphql_ws backed by package:web_socket_channel.

graphql_ws itself has zero external dependencies and ships a dart:io.WebSocket transport by default. That works on the VM and on Flutter mobile/desktop, but not on the web. This package bridges web_socket_channel — which works on VM, web, and Flutter — so the same client code runs everywhere.

Install #

dependencies:
  graphql_ws: ^0.1.0
  graphql_ws_web_socket_channel_connector: ^0.1.0

Usage #

import 'package:graphql_ws/graphql_ws.dart';
import 'package:graphql_ws_web_socket_channel_connector/graphql_ws_web_socket_channel_connector.dart';

final client = createClient(
  url: () => Uri.parse('wss://example.com/graphql'),
  connector: webSocketChannelConnector,
);

That's the whole API surface — one top-level function you pass as connector.

License #

MIT — see LICENSE.

0
likes
140
points
195
downloads

Documentation

API reference

Publisher

verified publisherphlm.fyi

Weekly Downloads

A graphql_ws WebSocketConnector backed by package:web_socket_channel. Lets graphql_ws run on Flutter web (and anywhere else web_socket_channel is supported) without dropping graphql_ws's zero-dependency core.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

graphql_ws, web_socket_channel

More

Packages that depend on graphql_ws_web_socket_channel_connector