diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 645ba8550..39c69a606 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -748,6 +748,26 @@ |= [=atom =node:store] ^- [index:store node:store] [(snoc parent atom) node] + :: + [%x %shallow-children @ @ *] + =/ newest ?=(%newest i.t.path) + =/ =ship (slav %p i.t.t.path) + =/ =term i.t.t.t.path + =/ =index:store + (turn t.t.t.t.path (cury slav %ud)) + =/ children + (get-node-children ship term index) + ?~ children [~ ~] + :- ~ :- ~ :- %graph-update-1 + !> ^- update:store + :+ now.bowl %add-nodes + :- [ship term] + %- ~(gas by *(map index:store node:store)) + %+ turn (tap:orm u.children) + |= [=atom =node:store] + ^- [index:store node:store] + :- index.post.node + node(children [%empty ~]) :: [%x ?(%newest %oldest) @ @ @ *] =/ newest ?=(%newest i.t.path) diff --git a/pkg/interface/src/logic/api/graph.ts b/pkg/interface/src/logic/api/graph.ts index ef999a8a6..900ad7341 100644 --- a/pkg/interface/src/logic/api/graph.ts +++ b/pkg/interface/src/logic/api/graph.ts @@ -349,6 +349,14 @@ export default class GraphApi extends BaseApi { this.store.handleEvent({ data }); } + async getShallowChildren(ship: string, name: string, index = '') { + const idx = index.split('/').map(decToUd).join('/'); + const data = await this.scry('graph-store', + `/shallow-children/${ship}/${name}${idx}` + ) + this.store.handleEvent({ data }); + } + getGraphSubset(ship: string, resource: string, start: string, end: string) { return this.scry( 'graph-store',