Skip to content

Commit

Permalink
fix: Add log
Browse files Browse the repository at this point in the history
  • Loading branch information
irishcarbomb777 committed May 6, 2024
1 parent 5cdcb62 commit 17db692
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/layers/Neo4j/defineNeo4jLayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,12 @@ export const defineNeo4jLayer = <
MATCH (fromNode:${nodeType} {nodeId: $fromNodeId})-[:${relationshipType as string}]->(toNode:${toNodeType})
RETURN toNode
`, { fromNodeId: nodeId })
}).then(({ records }) => relationshipDictionary[relationshipType].uniqueFromNode
? records.length ? records.map(record => record.get('toNode').properties)[0] : null
: records.map(record => record.get('toNode').properties)
)
}).then(({ records }) => {
console.log(records.map(record => record.get('toNode').properties))
return relationshipDictionary[relationshipType].uniqueFromNode
? records.length ? records.map(record => record.get('toNode').properties)[0] : null
: records.map(record => record.get('toNode').properties)
})
if (!result) return Err(UixErr('Neo4j', 'Normal', 'NodeNotFound', { message: `Node of type ${toNodeType} related to node ${nodeType} with ${nodeId} not found` }))
return Ok(result as any) // TS is struggling to infer this. But it is correct
} catch (_e) {
Expand Down

0 comments on commit 17db692

Please sign in to comment.