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
I'm trying to get rid of my Vuex store in my project and replace it with VueApollo cache. I wonder if there is any nice and "proper" way to read from apollo cache when using VueApollo, to share a state between components and reduce the amount of server requests.
I know I can execute the query, and it might be returned from the cache instead of the server(depending on the cache policy), but there are scenarios when it's enough to execute the server query once (for example for some dic tables I get from the DB and are not likely to change), and I feel I need something that will replace Vuex mapState and mapGetters, more elegant way to read the results in multiple components, rather than having duplicated Apollo objects and queries in many components.
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
-
I'm trying to get rid of my Vuex store in my project and replace it with VueApollo cache. I wonder if there is any nice and "proper" way to read from apollo cache when using VueApollo, to share a state between components and reduce the amount of server requests.
I know I can execute the query, and it might be returned from the cache instead of the server(depending on the cache policy), but there are scenarios when it's enough to execute the server query once (for example for some dic tables I get from the DB and are not likely to change), and I feel I need something that will replace Vuex mapState and mapGetters, more elegant way to read the results in multiple components, rather than having duplicated Apollo objects and queries in many components.
Beta Was this translation helpful? Give feedback.
All reactions