diff --git a/src/layers/Neo4j/defineNeo4jLayer.ts b/src/layers/Neo4j/defineNeo4jLayer.ts index f1e94b7..77b37db 100644 --- a/src/layers/Neo4j/defineNeo4jLayer.ts +++ b/src/layers/Neo4j/defineNeo4jLayer.ts @@ -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) {