Validation

Valid vs invalid queries

Lantern validates the entire query tree on every change. The Details tab shows Valid or an error count. Execute on the Results tab is blocked until the query is valid.

What stays valid

A query is Valid when every group and condition passes all checks below. Preview (SQL/Mongo/GraphQL) still updates even when invalid — incomplete rules are simply skipped in the generated string.

Tree-level errors

  • No conditions — root group is empty (“Add at least one condition”)
  • Empty nested group — a group with zero children

Condition-level errors

SituationMessage
Field not selectedSelect a field
Wrong operator for field typee.g. Contains on a number field
Missing valueValue is required
Between without end valueEnd value is required for between
Invalid rangeRange start must be ≤ end
Empty In Array listProvide at least one value
Non-numeric value on number fieldValue must be a number
Bad regex patternInvalid regular expression

Null checks

Is Null and Is Not Null do not require a value. A rule like Email → Is Null can be valid with only the field and operator set.

Demo tip

To show validation in action:

  1. Clear the field dropdown on a condition → Status shows errors
  2. Pick Contains on a number field → operator/type error
  3. Add a nested group and delete all rules inside → empty group error
  4. Fix the issues → Status returns to Valid and Execute works

Query builder guide · Open builder