apollo
apollo copied to clipboard
Async / Promise Variables
Variables option in smart query isn't being waited for async variables function to be resolved before fetching.
apollo: {
list: {
query,
async variables() {
const data = await getData();
return { data };
},
},
},
`
Is there any solution to this?
any update on this? is there any solution?
In these cases, I load required data elsewhere (mounted, on some event, whatever is appropriate) and use the skip() option of vue-apollo to wait until the data is available to run.