Commit 7d4f4ac
committed
fix: fn::node_info() now handles both record ID formats
Critical bug: fn::node_info() was returning None for valid node IDs because
FROM ONLY $node_id with a string parameter doesn't work correctly in
SurrealDB.
Root cause: SurrealDB requires type::thing() to convert string record IDs
to actual record types for FROM clauses.
Fix: Added smart record ID handling:
- If $node_id contains ':' (e.g., "nodes:uuid") → type::thing($node_id)
- If $node_id is just UUID → type::thing('nodes', $node_id)
This ensures fn::node_info() works with both:
1. Full record IDs from SELECT id queries: "nodes:0002cb76-..."
2. Just UUIDs: "0002cb76-bdea-4461-b489-cc76476ee863"
Without this fix, all graph functions (get_transitive_dependencies,
get_hub_nodes, etc.) were returning None because they all use
fn::node_info() internally.1 parent c9a1536 commit 7d4f4ac
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
297 | 303 | | |
298 | 304 | | |
299 | 305 | | |
| |||
306 | 312 | | |
307 | 313 | | |
308 | 314 | | |
309 | | - | |
| 315 | + | |
310 | 316 | | |
311 | 317 | | |
312 | 318 | | |
| |||
0 commit comments