For whatever reason this is not documented in Meteor’s docs, but it would really help make Meteor more appealing.
So, here’s the question:
How does one observe a GraphQL query using Tracker.autorun
?
For whatever reason this is not documented in Meteor’s docs, but it would really help make Meteor more appealing.
So, here’s the question:
How does one observe a GraphQL query using Tracker.autorun
?
Still wondering about this. Do we have to make a query subscription, then manually set a ReactiveVar with the result, and use that in the autorun?
Hi @trusktr, the way we have used in our apps is by refetching
the queries.
You can see an example here on the react tutorial where the refetch
function is used and you could also use the refetchQueries
parameter when calling some mutation.
Refetching is not reactive (push-based, like Meteor pubsub), but poll based, and is easier to get wrong and lead to inconsistent state. Meteor’s client side (minimongo) syncs data, and leads to consistent state with little effort.
I’ll edit the OP to point this out. EDIT: it is too late to edit the OP.
What I am asking is, how to do “reactive GraphQL”. It doesn’t seem GraphQL is reactive, and the live queries features coming out lately seem very difficult to work with compared to Meteor pub/sub.