Ad-Hoc Queries (Deprecated)
Overview
Zero generates a query API for every table you sync. To enable, set the enableLegacyQueries option to true in your schema:
const schema = createSchema({
// ...
enableLegacyQueries: true
})Ad-hoc queries send their query ASTs directly to zero-cache, which rejects them by default. To allow them, also set ZERO_ALLOW_LEGACY_QUERIES to true on zero-cache.
Once enabled, queries are available at z.query.<tablename>.
const zero = new Zero(...);
const issues = await zero.query.issue.where('priority', 'high').run();Each table is a ZQL builder object. See ZQL for details.