When to use watchQuery or query in Apollo-Angular?

yussenn picture yussenn · Apr 2, 2018 · Viewed 11.2k times · Source

I am using a watchQuery or query in Apollo-Angular (graphql)

How is the logic and difference of the watchQuery and query

Answer

Manzur Khan picture Manzur Khan · Apr 3, 2018

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