Skip to content

Commit

Permalink
DEV-269 Use instead of
Browse files Browse the repository at this point in the history
  • Loading branch information
dmytroyarmak committed Mar 1, 2024
1 parent 2ad4ab7 commit db1d649
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 41 deletions.
5 changes: 2 additions & 3 deletions lib/graphql/client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ws from "ws";
import { WebSocket } from "isomorphic-ws";

import { Client, createClient } from "graphql-ws";
import { GraphQLError, UserUnauthorizedError } from "../errors";
Expand Down Expand Up @@ -131,12 +131,11 @@ export class GraphQLClient {
private createSubscriptionClient = (): Client => {
const auth = this.getAuthHeader();
const connectionParams = auth ? { [auth[0]]: auth[1] } : {};
const webSocketImpl = typeof window === "undefined" ? ws : window.WebSocket;

return this.createClient({
url: this.subscriptionEndpoint,
connectionParams,
webSocketImpl,
webSocketImpl: WebSocket,
})
}

Expand Down
101 changes: 64 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
"graphql": "^16.3.0",
"graphql-request": "^4.0.0",
"graphql-ws": "^5.5.5",
"isomorphic-ws": "^5.0.0",
"js-sha256": "^0.9.0",
"querystring-es3": "^0.2.1",
"ws": "^8.4.2"
"ws": "^8.16.0"
},
"overrides": {
"tough-cookie": "4.1.3"
Expand Down

0 comments on commit db1d649

Please sign in to comment.