Describe the buguseLazyQuery's load doesn't respect the variables given through its 2nd parameter.
After some investigation, I've found out it manipulates variables from the useQuery/useLazyQuery's return value. Updating the variables like variables.value = { ... } won't do anything, which is not specific to load.
This only happens when the variables parameter is given to useQuery/useLazyQuery is in function form. It works fine when a ref is given.
Describe the bug
useLazyQuery
'sload
doesn't respect the variables given through its 2nd parameter. After some investigation, I've found out it manipulatesvariables
from theuseQuery
/useLazyQuery
's return value. Updating the variables likevariables.value = { ... }
won't do anything, which is not specific toload
. This only happens when the variables parameter is given touseQuery
/useLazyQuery
is in function form. It works fine when aref
is given.To Reproduce Does NOT work ❌:
Does work ✅:
Does NOT work ❌:
Does work ✅:
Expected behavior Using the function form should work the same as passing a
ref
/reactive
. Or at least, this limitation should be documented.Versions vue: 3.4.19 vue-apollo: 4.0.1 @apollo/client: 3.9.4