Skip to content

types(entities): Type entity filter query operators#166

Merged
roymiloh merged 1 commit into
base44:mainfrom
javascrifer:typed-entity-filter-query
Apr 29, 2026
Merged

types(entities): Type entity filter query operators#166
roymiloh merged 1 commit into
base44:mainfrom
javascrifer:typed-entity-filter-query

Conversation

@javascrifer
Copy link
Copy Markdown
Contributor

Why

The SDK runtime already forwards entity filter queries by JSON-serializing the query object, and Base44 accepts richer filter syntax than the current TypeScript signature exposes. Today filter() is typed as Partial<T>, so valid filters such as these produce TypeScript errors:

  • base44.entities.Tool.filter({ uuid: ["uuid-1", "uuid-2"] })
  • base44.entities.Tool.filter({ uuid: { $in: ["uuid-1", "uuid-2"] } })
  • base44.entities.Tool.filter({ description: null }) when generated types mark the field as string | undefined

This makes developers and coding agents think supported Base44 filtering features are unavailable, and pushes users toward casts or any even when the query is valid.

What changed

  • Added EntityFilterQuery<T> for filter() queries.
  • Supports proven/documented filter syntax: exact values, null, array shorthand, $eq, $ne, $gt, $gte, $lt, $lte, $in, $nin, $exists, $regex, $all, $size, field-level $not, and root $and/$or/$nor.
  • Keeps typed entity field keys so typos are still caught.
  • Added JSDoc examples so editor completions and generated docs expose the available syntax.
  • No runtime behavior change.

Verification

  • npm run build

@raywiis
Copy link
Copy Markdown

raywiis commented Apr 28, 2026

👍

@javascrifer javascrifer force-pushed the typed-entity-filter-query branch from aa2da27 to 3f5c6fa Compare April 28, 2026 08:19
@javascrifer javascrifer changed the title Type entity filter query operators types(entities): Type entity filter query operators Apr 28, 2026
@javascrifer javascrifer force-pushed the typed-entity-filter-query branch from 3f5c6fa to d0d34da Compare April 28, 2026 13:05
@javascrifer javascrifer force-pushed the typed-entity-filter-query branch from d0d34da to 759f3c6 Compare April 29, 2026 12:37
@roymiloh roymiloh merged commit 42825f4 into base44:main Apr 29, 2026
2 of 5 checks passed
@javascrifer javascrifer deleted the typed-entity-filter-query branch April 29, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants