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: provideApollClient overriding specified query / mutation clientId #1338

Closed
wants to merge 1 commit into from

Conversation

dcress
Copy link

@dcress dcress commented Mar 24, 2022

See original issue here: #1337

Problem:
Vue Apollo is using the savedCurrentClient as the default client even when inside of a .vue file and a different clientId is being explicitly set by the query or mutation. This means that if you've set the client by using provideApolloClient at any point in the application's session, it's going to continue to use that client instead of the one you're specifying in the current query or mutation because that savedCurrentClient const is based on the currentApolloClient var.

Solution:
I believe that these conditions should be swapped to look for a provided ID first and if one isn't provided then try and fallback to the savedCurrentClient.

@dcress dcress changed the title Fix: Use individually provided clientId as default Fix: provideApollClient overriding specified query / mutation clientId Mar 24, 2022
@dcress dcress changed the title Fix: provideApollClient overriding specified query / mutation clientId fix: provideApollClient overriding specified query / mutation clientId Mar 24, 2022
@dcress dcress closed this Mar 24, 2022
@dcress dcress reopened this Mar 24, 2022
@dcress
Copy link
Author

dcress commented Mar 31, 2022

Closing this in favor of: #1340

@dcress dcress closed this Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant