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

Preventing client.link from being publicly mutatable #5347

Closed
ismail-syed opened this issue Sep 19, 2019 · 1 comment
Closed

Preventing client.link from being publicly mutatable #5347

ismail-syed opened this issue Sep 19, 2019 · 1 comment

Comments

@ismail-syed
Copy link

Context

We built some abstractions on top of apollo links and noticed that mutating client.link property on an instance of ApolloClient does not actually propagate the link changes properly to the queryManager.

If this isn't how the client.links API is meant to be used, should we consider updating the client.link property to be a read-only property similar to the queryManager. This would help prevent folks from incorrectly using the API. Happy to PR if this is something you're interested in!

Intended outcome:

  • If mutating client.link the new links added should work.

Actual outcome:

  • If mutating client.link the new links added do not work.

How to reproduce the issue:

Versions

$ npx envinfo@latest --preset apollo --clipboard                                                                                                                                                                                      130 ↵
npx: installed 1 in 1.705s

  System:
    OS: macOS 10.14.4
  Binaries:
    Node: 12.3.1 - /usr/local/bin/node
    Yarn: 1.10.1 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 76.0.3809.132
    Firefox: 66.0.5
    Safari: 12.1
  npmPackages:
    apollo-cache-inmemory: ^1.6.3 => 1.6.3
    apollo-client: ^2.6.4 => 2.6.4
    apollo-link: ^1.2.12 => 1.2.12
@hwillson
Copy link
Member

Changes to allow this were introduced in #6193 - thanks!

@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
None yet
Projects
None yet
Development

No branches or pull requests

2 participants