ARCE0003: An @observe query has neither :watch nor :topics
Kind: module. Default severity: warning.
An @observe query re-runs, and pushes the new result to its subscribers, when something it watches changes: the Chronicle read models in :watch, or the Arc.Notifier topics in :topics. With neither, nothing ever triggers it, so it answers once per subscription and then stays silent.
Why it matters
Section titled “Why it matters”The client subscribes and gets a first result, so it looks as if it works. The data then goes stale on screen, and the cause is easy to miss in review.
@observe many: truedef live_authors(_args, _ctx), do: Chronicle.all(MyApp.Authors.Author)Say what changes it:
@observe many: true, watch: [MyApp.Authors.Author]def live_authors(_args, _ctx), do: Chronicle.all(MyApp.Authors.Author)or, for data that something else announces:
@observe many: true, topics: ["authors"]def live_authors(_args, _ctx), do: Chronicle.all(MyApp.Authors.Author)How to fix
Section titled “How to fix”- Add
watch:and/ortopics:to the@observe. - If the data never changes while subscribed, use
@queryinstead.