Neighbors & Graph recipe
Source: 06_NeighborsGraph/ · three ways to walk the graph from the front-end.
How it looks
The three traversal styles as tabs: a plain list, a searchable neighbours list, and a graph view. Live data needs real UIDs from your workspace; the runnable Tesserae preview below sketches the layout with static data.
What it teaches
| Tab | Component | When to reach for it |
|---|---|---|
| Direct query | Mosaik.API.Query.StartAt(...).Out(...).GetAsync() |
When you need the data in a Defer block or to feed something other than a list. |
| Neighbors | Neighbors(() => query.GetUIDsAsync(), ...) |
When you want a list with search + facets, materialised lazily when the tab is opened. |
| Graph explorer | GraphExplorerView.ViewFor(uids) |
When the relationships are the story — neighbours-of-neighbours, dependencies, social graphs. |
The recipe page itself is presentation-only — live data needs real UIDs you have in your workspace. Copy the snippets into a node renderer to see them work.
Direct query
var hits = await Mosaik.API.Query
.StartAt(node)
.Out(Edges.HasAuthor)
.GetAsync(limit: 25);
Neighbors list
Neighbors(
() => Mosaik.API.Query.StartAt(node).Out(Edges.HasAuthor).GetUIDsAsync(),
title: "Authors")
.WithFacets()
Graph explorer
// The node and everything it is connected to
GraphExplorerView.ViewFor(expandNeighbors: true, node.UID)
See also
- Node Renderer recipe — a renderer's tabs are where these patterns usually end up.
- Connector Recipes — the schemas and
[Node]/[Key]/[Property]shapes define whatMosaik.API.Querytraverses. TechnicalSupport.FrontEnd/src/Views/DeviceRenderer.cs— production-ish example with all three patterns.