Files
Oleg Isonen 2c7772c386 fix: Show actual query field types in Builder (#6597)
Boolean asset fields currently appear as text in the Builder query
editor. Comparing one with `true` then shows a false type warning. This
PR carries observed field types through the Assets OpenAPI schema into
the query definition used by Builder.

Closes #6596
Ref #6595

## Plan

- [x] Reproduce the type mismatch with a focused regression test.
- [x] Pass supported schema value types through the generated query
definition, preserving the existing string fallback for schemas without
field-type metadata.
- [x] Verify the Builder catalog uses the corrected definition and run
targeted tests, typechecks, and lint.
- [x] Review the authoritative `docs/` content for any needed
documentation update. Existing content-engine reference already
describes observed types; no copy change is needed. The two full Builder
query screenshots in #6595 need recapture after this fix reaches the
Builder.
- [x] Review the final diff and get an independent code review. The
reviewer found no blocking issues.
- [x] Confirm required CI checks pass.

## Implementation

The Assets schema groups field-path choices by their exact observed
types as well as compatible operators, and adds
`x-webstudio-field-types` to each group. The generic OpenAPI query
adapter carries that metadata through references and choices. Fields
from other OpenAPI documents without this metadata keep their previous
string fallback. No stored query data or database schema changes are
involved.

## Verification

- Regression tests failed before the fix: numeric and Boolean fields
were emitted as text; Builder warned on a valid Boolean `true` filter.
- `pnpm --filter @webstudio-is/query-builder test` — 40 passed.
- `pnpm --filter @webstudio-is/protocol test` — 92 passed, including the
API description size limit.
- Builder `asset-query-form.test.tsx` — 7 passed.
- Query-builder, protocol, and Builder typechecks passed; changed-file
oxlint and oxfmt checks passed.
- No fixture inputs or generated fixture outputs are affected.
- GitHub Actions: Lint PR, Check submodules, Visual regression, and Main
workflow all passed. One Builder E2E shard failed its first attempt in
two form-submission tests, then passed on a rerun of that shard; every
latest job is green.

## Follow-up

After the corrected full Builder is available, recapture the overview
and article query screenshots for #6595 in both themes.
2026-10-25 11:03:07 +01:00
..