Migrate from subscriptions-transport-ws to graphql-ws - #2548
Draft
MetRonnie wants to merge 3 commits into
Draft
Conversation
This was referenced May 13, 2026
MetRonnie
force-pushed
the
graphql-ws
branch
3 times, most recently
from
June 4, 2026 15:14
9751400 to
136e887
Compare
MetRonnie
force-pushed
the
graphql-ws
branch
2 times, most recently
from
June 30, 2026 10:31
428d292 to
2eb8e59
Compare
There was a problem hiding this comment.
Pull request overview
This PR migrates the UI’s GraphQL subscription transport from the deprecated subscriptions-transport-ws stack to graphql-ws (GraphQL over WebSocket Protocol / graphql-transport-ws), updating both runtime wiring (Apollo link + subscription client) and local mock websocket handling.
Changes:
- Replace
subscriptions-transport-ws/WebSocketLinkwithgraphql-ws+GraphQLWsLink, and update subscription-client creation accordingly. - Update mock websocket server message handling to the
graphql-transport-wsprotocol. - Remove
cross-fetchpolyfill usage from unit tests and update dependency manifests/lockfile + changelog entry.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Drops deprecated subscription transport deps; adds graphql-ws; lockfile updated (incl. ws resolution change). |
| package.json | Replaces subscriptions-transport-ws with graphql-ws; removes cross-fetch. |
| renovate.json | Removes cross-fetch from renovate grouping (since it’s no longer used). |
| src/graphql/index.js | Implements graphql-ws client creation + Apollo GraphQLWsLink wiring; keeps offline-state hooks. |
| src/services/workflow.service.js | Updates JSDoc typedef for subscription client to graphql-ws Client. |
| src/services/mock/websockets.cjs | Updates mock websocket protocol handling to graphql-transport-ws message types. |
| tests/unit/utils/graphql.spec.js | Updates unit tests to Vitest imports and new subscription client creation. |
| tests/unit/utils/aotf.spec.js | Removes cross-fetch polyfill import. |
| tests/unit/services/workflow.service.spec.js | Removes cross-fetch polyfill import. |
| changes.d/2237.feat.md | Changelog entry noting the protocol/subprotocol change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+35
to
38
| it('creates a subscription client', () => { | ||
| const subscriptionClient = createSubscriptionClient('ws://localhost:12345') | ||
| expect(subscriptionClient.on).toBeTypeOf('function') | ||
| }) |
The `subscriptions-transport-ws` library is no longer maintained.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
subscriptions-transport-wslibrary is no longer maintained.Closes #1028
Sibling: cylc/cylc-uiserver#821
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.?.?.xbranch.