-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How should I import WebSocketLink ? #6732
Comments
This should work (although it was improved in v3.1.0 by #6656): import { WebSocketLink } from "@apollo/client/link/ws" However, you will probably want to avoid using Happy to answer follow-up questions, of course. |
Is it to simplify work of tree shaking that we cannot do |
It's also to avoid cluttering the available top-level imports, and to avoid importing the entire library when using CommonJS (which Node.js still does in most cases). Any use of |
In beta, I was importing it from
@apollo/link-ws": "^2.0.0-beta.3"
and it was working find.In 3.1.1, I got a typing issue, because ApolloLink from
@apollo/link-ws
->apollo-link-ws
does not match the one from@apollo/client
.I can get it work by importing from
"@apollo/client/link/ws"
.Is a re-export missing somewhere ?
The text was updated successfully, but these errors were encountered: