When to use watchQuery or query in Apollo-Angular?
I am using a watchQuery or query in Apollo-Angular (graphql)
How is the logic and difference of the watchQuery and query
query
is something you just query for once, you can consider it as an equivalent of GET.
watchQuery
is something you constantly keep a watch on query, whenever that query will be refetched or the data related to that query is changed from anywhere else, this method will keep on emitting the updated data.
It's really simple, you can read the docs here.