vuejs / apollo

🚀 Apollo/GraphQL integration for VueJS
http://apollo.vuejs.org
MIT License
6.03k stars 523 forks source link

Question: opt-out of refetch when variables change #1556

Open heivo opened 5 months ago

heivo commented 5 months ago

Hi,

I'm using useLazyQuery that I manually (re-)trigger when a user presses a button. I have the problem that the query is also re-triggered automatically whenever one of the reactive query variables change.

Is there any way to prevent this?

Thanks in advance

AfaqNabi commented 1 month ago

I have the same question i cant seem to find anything in the Apollo client docs about this.

using non reactive variables disables this though, but that's not ideal having to copy reactive vars into a regular ts variable every time.

it also has the side effect of bypassing the cache and hitting the server every time no matter the fecthPolicy