define-query-migration
Installation
SKILL.md
Migrating to Zero Custom Queries (defineQuery API)
This skill helps migrate from Zero's deprecated ad-hoc queries (zero.query.*) to the new defineQuery API.
Prerequisites:
-
You should have already adopted the new auth API. The parameter to
authin the Zero constructor or ZeroProvider should be a string, not a function. If this is not the case, see theauth-callback-to-string-auth. -
Not required, but it's usually easiest to upgrade to defineMutators first. You should see
defineMutatorsin this codebase. If not, seefactory-mutators-to-define-mutators.
Docs:
- New API: https://zero.rocicorp.dev/docs/queries
- Old API (deprecated): https://zero.rocicorp.dev/docs/deprecated/ad-hoc-queries