Skip to content
pubscout

gql_websocket_link

2.1.0, released a year ago by gql-dart.dev

GraphQL WebSocket link for executing queries, mutations, and subscriptions.

WASM-readyQuiet but busy
$ flutter pub add gql_websocket_link
Source repository

What it does

Provides a WebSocket link for GraphQL clients to execute operations and manage real-time subscriptions over web sockets. Supports auto-reconnection and multiple websocket sub-protocols like graphql-ws and graphql-transport-ws.

AI-written summary of version 2.1.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need GraphQL subscriptions in your Flutter or Dart app
  • You are using the gql ecosystem and need a WebSocket transport layer

Skip it when

  • You only need standard HTTP-based queries and mutations without real-time updates
  • You are not using the gql client architecture

Strengths

  • Supports both graphql-ws and graphql-transport-ws protocols
  • Built-in autoReconnect and automatic resubscription handling
  • Exposes connection state streams

Weaknesses

  • The WebSocketLink class has some known issues documented in the project repository
  • Requires using the broader gql link ecosystem

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
7
import "package:gql_link/gql_link.dart";
import "package:gql_websocket_link/gql_websocket_link.dart";

void main () {
  final link = Link.from([
    WebSocketLink("ws://<GRAPHQL_SERVER_ENDPOINT>/graphql"),
  ]);
}

Alternatives

Packages that do the same job and could replace gql_websocket_link.

  • sentry_link

    Automatic capture of exceptions and GraphQL errors for the gql ecosystem like graphql and ferry.

  • fresh_graphql

    A GraphQL link for package:graphql that manages authentication tokens transparently.

  • ferry_flutter

    Flutter widgets for executing GraphQL operations using the ferry client

  • angel3_websocket

    WebSockets support and event broadcasting for the Angel3 framework.

Works with

Packages commonly used together with gql_websocket_link: ones it builds on, ones built on it, and its own family.