A WebSocket transport for GraphQL subscriptions, queries, and mutations. Current version 2.0.2 is in maintenance mode; development is stalled and the package is not actively maintained. It provides a SubscriptionServer (server-side) and SubscriptionClient (client-side) for GraphQL over WebSocket, using the legacy graphql-ws protocol. The package requires graphql and ws as peer dependencies. It is commonly used with Apollo Client/Server but can integrate with any GraphQL ecosystem. The project is superseded by graphql-ws (library), which implements the new GraphQL over WebSocket specification. Critical caveat: always consider migrating to graphql-ws to avoid protocol incompatibilities and lack of updates.
npm install subscriptions-transport-ws-envelopNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a WebSocket server using SubscriptionServer with a GraphQL schema, execute, and subscribe functions from graphql-js.
Replace the package with graphql-ws and follow its migration guide (https://github.com/enisdenjo/graphql-ws/blob/master/MIGRATION.md).
Ensure both client and server use the same transport library. Prefer migrating to graphql-ws for future compatibility.
Migrate to @apollo/client and use ApolloLink.from([...]) with a WebSocketLink from graphql-ws.
Run npm install subscriptions-transport-ws or yarn add subscriptions-transport-ws.
Use named import: import { SubscriptionServer } from 'subscriptions-transport-ws'.Install ws: npm install ws