Closed atoy40 closed 7 years ago
I think this can work :
this._apolloObservers[0].observer.refetch()
But may be it can be a good idea to have a function to get observers from "key" name ? What do you think about ?
@atoy40 Great suggestion. I'll implement this.$apollo.refetch(key);
function to refetch the query.
@aruntk May be another idea with the same goal, for each query, it could be nice to set an array of "dependencies" (property paths) which can fire a refetch when changed (like you did with graphql variables)
btw, if we've an easy function, it's maybe better to create a polymer observer on theses properties and call the refetch.
@atoy40 Hi. I've added a refetch
function to $apollo
. Call it as this.$apollo.refetch(key);
visibilityChanged: function(visible) {
if (visible) {
this.async(function() {
if (this.loadingDisks === false) {
this.$apollo.refetch("disks");
}
});
}
},
is working. Thks
Hello,
i've a polymer element with the PolymerApolloBehavior, and want to know if it's possible to "refresh" a query result either through code (calling a function on $apollo ?) or through a polymer binding ? My query has no variable so I cannot use your "observers" mechanisme on variables and I don't want to use polling.
Thks Anthony.