Replies: 2 comments
-
The apollo queries are set up in the |
Beta Was this translation helpful? Give feedback.
-
There are several issues in your code sample: client: (this.isUserAuthenticated && 'apolloAdminClient') || 'defaultClient', This can never be reactive since it's not in a function, and Although you could use a function just like you usually would with export default {
apollo: {
getCustomAdminData () {
return {
query: userRowId,
client: this.isUserAuthenticated ? 'apolloAdminClient' : 'defaultClient',
deep: false,
variables () {
return {
userID: this.userId,
}
},
update (data) {
// ...
},
}
},
},
} |
Beta Was this translation helpful? Give feedback.
-
Hi,
I faced with issue in multiple apollo client app when I need to change apollo client dynamically according computed/vuex getter value. (In my case some boolean calculation)
However, it cannot be used, since, as I understand, computed property is not ready when apollo executes the query, thus I always run with "default client"
here is code below:
I found some remark in this issue. However, the provided solution as
Is there any solution or workaround in order to get apollo client be dynamic?
Thanks
"vue-apollo": "^3.0.8",
Beta Was this translation helpful? Give feedback.
All reactions