-
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
Allow setting new ApolloLink after ApolloClient instantiation #6193
Conversation
Provides support for setting a new `ApolloLink` (or link chain) after `new ApolloClient()` has been called, using a public `ApolloClient.setLink()` method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
* Define a new ApolloLink (or link chain) that Apollo Client will use. | ||
*/ | ||
public setLink(newLink: ApolloLink) { | ||
this.link = this.queryManager.link = newLink; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, why this.link
is used. As observing a bug because of it. The chain keeps on adding because of this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Moniv9 please open a separate issue with your details and a small runnable reproduction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Provides support for setting a new
ApolloLink
(or link chain) afternew ApolloClient()
has been called, using a publicApolloClient.setLink()
method.This is a follow up of #3877, and a continuation of #4297.