You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the client changes, vue-apollo ignores that, so I make it react by wrapping the component call with a key, like:
top-nav(:key="activeApi")
Then whenever the activeApi store value is updated, the entire component is destroyed and recreated with the apollo using the new default client. This works fine as a workaround, but it's pretty ugly and inefficient if you have large components which take a long time to destroy and recreate.
Is there a way to just destroy and recreate the apollo queries within the component? Ideally it would react to the $client value but it doesn't, but if I could at least refresh the apollo queries without destroying the entire component, that would be a much better workaround.
This discussion was converted from issue #252 on December 15, 2020 07:06.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
If I have a query with a default client set within a component:
If the client changes, vue-apollo ignores that, so I make it react by wrapping the component call with a key, like:
Then whenever the activeApi store value is updated, the entire component is destroyed and recreated with the apollo using the new default client. This works fine as a workaround, but it's pretty ugly and inefficient if you have large components which take a long time to destroy and recreate.
Is there a way to just destroy and recreate the apollo queries within the component? Ideally it would react to the $client value but it doesn't, but if I could at least refresh the apollo queries without destroying the entire component, that would be a much better workaround.
Beta Was this translation helpful? Give feedback.
All reactions