Skip to content

Commit 8b58fe9

Browse files
committed
bugfix nested entities not detected in viz
1 parent caa6ad7 commit 8b58fe9

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/shared/services/bolt/boltMappings.js

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,18 +252,35 @@ export function extractRawNodesAndRelationShipsFromRecords(
252252
)
253253
)
254254

255-
for (const item of flatTruncatedItems) {
255+
const findAllEntities = item => {
256256
if (item instanceof types.Relationship) {
257257
rawRels.add(item)
258+
return
258259
}
259260
if (item instanceof types.Node) {
260261
rawNodes.add(item)
262+
return
261263
}
262264
if (item instanceof types.Path) {
263265
paths.add(item)
266+
return
267+
}
268+
if (Array.isArray(item)) {
269+
for (const subItem of item) {
270+
findAllEntities(subItem)
271+
}
272+
return
273+
}
274+
if (item && typeof item === 'object') {
275+
for (const subItem of Object.values(item)) {
276+
findAllEntities(subItem)
277+
}
278+
return
264279
}
265280
}
266281

282+
findAllEntities(flatTruncatedItems)
283+
267284
for (const path of paths) {
268285
if (path.start) {
269286
rawNodes.add(path.start)

0 commit comments

Comments
 (0)