async getUserApps(){
let res=await this.$apollo.query({query:userApps});
this.apps=res.data.userApps;
}
submitForm(form){
let res=await this.$apollo.mutate({mutation:updateApp,variables:this.app});
if(res.data.updateApp){
this.getUserApps()
this.$message.success("")
this.dialogVisible=false;
}
}
above is the apollo method for getting data, which is executed when the page is loaded. No problem
. Then I submit the operation of submitForm ()
to modify the data on the page, and the modification is successful. It is necessary to call the above method again to get the latest data.
but I don"t know what the vue-apollo cache problem is, and what is the problem without initiating a http request to request the latest data at the backend?
after debugging, it is found that the getUserApps
method is still executed the second time, but there is no request backend, and the data is returned. The data is old and should be taken directly from the cache. How can we not take the data from the cache for the second time?