-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
Can not use mutations outside composition function with provideApolloClient #1145
Comments
Facing the same issue here. |
Same for me, changing
to
fixes the issue. Should I create a PR? |
@anli-xsigns I already created PR 3 weeks ago (#1146). @Akryum can you look at it, please? |
@Akryum can you look at it, please? |
Hi @anli-xsigns. Since I really need this working ASAP, is there any way I can Install your modified version of vue-apollo? |
@jvmonjo you can use this if you want https://github.com/Zippersk/vue-apollo/tree/v4 |
I was able to work around this by moving my mutations to the setup function and returning them, but this is some pretty ugly code. |
Also would love to see this approved soon to use a mutation inside a route guard. |
Seems like subscriptions are affected too, I get the same error message when using useSubscription(...) outside of setup. |
I have no idea how to use this PR in my code. Also please when would this be merged and a new release made.. Or if at all anyone has a fork of this PR deployed on NPM.. I need it in my project as soon as i can.. All Help would be appreciated |
Describe the bug
With the current implementation of v4, we can not use
useMutation
function outside Vue3 composition function.In
UseQuery
source code we have this condition:In
UseMutation
source code a condition is missing.This cause error when we use mutations outside the composition function:
The text was updated successfully, but these errors were encountered: