Use named queries for Orbit map filter search

What does this MR do and why?

Filtering the Orbit map by an entity type and a property (for example, Project → full_path contains "gitlab") failed with a schema violation: the query DSL was assembled in the frontend and had drifted from the engine's grammar (the engine now takes a nodes array and operator-keyed filters; the frontend still sent a singular node and { op, value }).

Rather than patch the shape, the frontend no longer builds query DSL for this path. It calls two server-defined named queries and passes only what the user picked:

  • search_nodes with { entity, field, text } when there is a search term (filter bar)
  • list_nodes with { entity } when there is none ("Show in map" from the Schema tab)

The engine owns the filter operator, the id > 0 selectivity workaround, and the result limit (still 50), so this cannot drift again. This is the same approach already used for node expansion (expand_neighbors). One knock-on: the query editor is no longer pre-filled with the raw DSL after a filter search, because none is built client side.

Depends on knowledge-graph!2366, which adds the two named queries. Do not merge until a GKG release containing it is deployed to production, otherwise filter searches return "unknown named query".

References

Screenshots or screen recordings

Before After
orbit-before orbit-9

"Show in map" (no search term) via list_nodes:

orbit-10

How to set up and validate locally

  1. Run GKG from the knowledge-graph!2366 branch against your GDK (mise run dev in the knowledge-graph checkout) so search_nodes and list_nodes exist.
  2. Visit http://127.0.0.1:3000/dashboard/orbit/explore as a member of an indexed group.
  3. Click Filter, pick Project, type gitlab (3+ characters) and press Enter. The map should re-render with only matching projects and the network tab shows POST /api/v4/orbit/query/search_nodes.
  4. Open the Schema tab, pick an entity and click Show in map. The map should show up to 50 nodes of that type via POST /api/v4/orbit/query/list_nodes.

Verified on GDK for all 14 entity types in the filter dropdown. Two pre-existing limitations, unchanged here: search terms shorter than 3 characters are rejected by the engine, and for File / Directory / Definition the field selector defaults to traversal_path, which does not support substring matching, so pick another field first.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading