0👍
thanks to @xadm i was able to get this to work, i am gonna post the vuejs code i reached to do this same effect.
First in my data i should have a variable to skips the query so it won’t execute on load…
...
data () {
return {
blockQuery: true
}
}
and then when i am defining my query i should pass that blockQuery
to stop it from executing
apollo: {
myDataQuery: {
query: <the gql query>
skip () {
return this.blockQuery // this is true so the query wont execute on load
}
}
}
then i should make whatever third party request i need, for example…
async mounted () {
const response = await <my request that resolves>
// after i made my request i should change the blockQuery to false so it would start the query
this.blockQuery = false // after this changes to false it will start the query.
}
- [Vuejs]-Vue Jest – Div element still exists when v-if is false
- [Vuejs]-V-model on dropdown not updating data value in Vue.js
Source:stackexchange.com