Changelog - 2026-08-24
FilterQuerySchema and WhereQuerySchema
New APIEnhancementIn one line. The query shape every list route takes now has a name, so a custom route names it instead of rebuilding it.
What changed
Two schemas ship from @venizia/ignis:
| Schema | Query shape | Use it for |
|---|---|---|
FilterQuerySchema | { filter?: TFilter } | Any route that takes a full filter |
WhereQuerySchema | { where?: TWhere } | Any route that takes conditions and no pagination |
Before:
typescript
request: { query: z.object({ filter: FilterSchema.optional() }).partial() },After:
typescript
request: { query: FilterQuerySchema },Both are plain Zod objects, so a route with more parameters extends them:
typescript
request: { query: WhereQuerySchema.extend({ q: z.string().max(255).optional() }) },The generated find, findById and findOne routes now use FilterQuerySchema too.
Who is affected
- Existing applications. Nothing breaks. This is additive.
- Anyone overriding a
findroute's query.FilterSchemaalready ends with.optional(), so these three accept the same requests. If you overridefind,findByIdorfindOneonly to makefilteroptional, delete the override.WhereSchemacarries no.optional(), which is whyWhereQuerySchemaadds one.
typescript
z.object({ filter: FilterSchema })
z.object({ filter: FilterSchema.optional() })
z.object({ filter: FilterSchema.optional() }).partial()Details
updateBy and deleteBy still require where, because a missing one would rewrite or delete every row. count also still requires where when isStrict.requestSchema is set, which is the default:
GET /products/count -> 400
GET /products/count?where= -> 400
GET /products/count?where={} -> 200Set isStrict: { requestSchema: false } on the controller, or override count's query with WhereQuerySchema, if you want a bare count to work.