Skip to content
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

fix: remove this.link which results in mutating link chain #8183

Closed
wants to merge 5 commits into from

Conversation

Moniv9
Copy link

@Moniv9 Moniv9 commented May 10, 2021

Fixes issue described here #8182.

Due to single instance of apolloClient in SPA, this.link keeps on adding/preserving new/old apollo-links, which all runs on graphQL request/response.

Checklist:

  • If this PR is a new feature, please reference an issue where a consensus about the design was reached (not necessary for small changes)
  • Make sure all of the significant new logic is covered by tests

@apollo-cla
Copy link

@Moniv9: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/

@Moniv9
Copy link
Author

Moniv9 commented May 13, 2021

@benjamn @hwillson if you can review this change.

@brainkim brainkim self-requested a review September 17, 2021 21:41
@jpvajda jpvajda added 🏓 awaiting-contributor-response requires input from a contributor 🏓 awaiting-team-response requires input from the apollo team and removed 🏓 awaiting-contributor-response requires input from a contributor labels May 3, 2022
@hwillson hwillson removed the request for review from brainkim August 12, 2022 00:14
@hwillson
Copy link
Member

Thanks for this @Moniv9 and sorry for the delay, but this is by design. We're intentionally allowing the link chain to be mutated so people can adjust links after ApolloClient instantiation. We need the updated link chain to be stored in the link instance variable so it can be effectively used by other parts of the ApolloClient class that run outside of the QueryManager.

@hwillson hwillson closed this Aug 12, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🏓 awaiting-team-response requires input from the apollo team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants