Skip to content

Conversation

@swilly22
Copy link
Contributor

@swilly22 swilly22 commented Jan 29, 2026

Summary by CodeRabbit

  • Documentation
    • Updated edge object property names to "source" and "target" across examples and guides for consistency.
    • Added a new Global objects section documenting Graph (multi-source traversal with examples) and Falkor (log and register APIs with parameters, usage patterns, and examples).
    • Updated surrounding docs to reflect renamed edge properties and integrate Global object references.

✏️ Tip: You can customize this high-level summary in your review settings.

PR Summary by Typo

Overview

This PR enhances the documentation for User-Defined Functions (UDFs) by updating the description of edge objects and introducing new global objects (graph and falkor) available within UDFs.

Key Changes

  • Updated edge object properties from startNode and endNode to source and target in the UDF documentation.
  • Added documentation for the global graph object, detailing its traverse function for multi-source traversal.
  • Introduced documentation for the global falkor object, including its log function for logging messages and register function for exposing UDFs to the database.

Work Breakdown

Category Lines Changed
New Work 68 (94.4%)
Rework 4 (5.6%)
Total Changes 72
To turn off PR summary, please visit Notification settings.

@swilly22 swilly22 requested a review from danshalev7 January 29, 2026 15:14
@typo-app
Copy link
Contributor

typo-app bot commented Jan 29, 2026

Static Code Review 📊

✅ All quality checks passed!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Documentation updates: renamed edge properties startNodesource and endNodetarget in UDF examples; added Global objects sections documenting Graph (with traverse) and Falkor (with log and register), including syntax, parameters, and examples.

Changes

Cohort / File(s) Summary
UDF Documentation
udfs/index.md
Renamed edge object properties in examples (startNodesource, endNodetarget). Added new Global objects documentation covering Graph.traverse (multi-source traversal) and Falkor (log, register) with usage, parameters, and examples.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 I hop through docs with pen in paw,

Nodes now named with clearer law,
Graph and Falkor call and play,
Examples light the pathway way,
A rabbit’s cheer — hooray! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly matches the main changes: documenting the falkor and graph global objects, which are the primary additions in this PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@typo-app typo-app bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review 🤖

Files Reviewed: 1
Comments Added: 0
Lines of Code Analyzed: 76
Critical Issues: 0

PR Health: Excellent 🔥

Give 👍 or 👎 on each review comment to help us improve.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
udfs/index.md (1)

197-203: Update Edge prose to match source/target.

The sentence still mentions startNode/endNode while the bullets now use source/target. This is confusing.

✏️ Suggested edit
-In a UDF, an edge object exposes its  `ID`, `type`, `startNode`,`endNode` and `attributes` via the corresponding properties:
+In a UDF, an edge object exposes its  `ID`, `type`, `source`, `target` and `attributes` via the corresponding properties:
🤖 Fix all issues with AI agents
In `@udfs/index.md`:
- Around line 236-238: Update the wording to hyphenate “multi-source” where it
describes the traverse function: change the phrase that reads "multi source
traversal" to "multi-source traversal" in the UDF docs referencing the global
graph object and its traverse function (see the line that compares traverse to
the node's getNeighbors function). Apply the same hyphenation at the other
occurrence mentioned in the comment.
- Around line 241-246: The example in multi_source_bfs incorrectly assigns
neighbors from sources; change assignments to use the traversal result stored in
targets (e.g., set s0_neighbors = targets[0] instead of sources[0]) and update
any subsequent references that expect neighbor arrays to read from targets
(e.g., s1_neighbors = targets[1], etc.) so the example matches the preceding
comment that "source i neighbors are in targets[i]".
- Around line 209-212: The example return expression using concatenation of
e.id, e.type, e.source.id and e.target.id contains hard tab characters; update
the markdown code block so all tabs are replaced with spaces (use consistent 2
or 4 spaces for indentation) around the return line and subsequent concatenated
lines, ensuring the lines with "return "id: " + e.id", "+ " type: " + e.type",
"+ " sourceNode: " + e.source.id", and "+ " targetNode: " + e.target.id" use
spaces instead of tabs.
- Around line 259-290: Remove the duplicated "falkor.register" subheading and
ensure each function has a single unique heading (keep "falkor.log" and then a
separate "falkor.register" section only once); fix the parameter tables for both
functions by aligning the table pipe columns under the header (MD060) and make
parameter names consistent with the syntax examples (e.g., use `msg` or
`message` consistently for falkor.log), and ensure the "Required" and
"Description" cells line up vertically with the header pipes.

Comment on lines 209 to +212
return "id: " + e.id +
" type: " + e.type +
" startNode: " + e.startNode.id +
" endNode: " + e.endNode.id +
" sourceNode: " + e.source.id +
" targetNode: " + e.target.id +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Replace hard tabs with spaces in the example.

Markdownlint reports hard tabs in the example, which can render inconsistently.

🧹 Suggested fix
-			" type: " + e.type +
-			" sourceNode: " + e.source.id +
-			" targetNode: " + e.target.id +
+        " type: " + e.type +
+        " sourceNode: " + e.source.id +
+        " targetNode: " + e.target.id +
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
return "id: " + e.id +
" type: " + e.type +
" startNode: " + e.startNode.id +
" endNode: " + e.endNode.id +
" sourceNode: " + e.source.id +
" targetNode: " + e.target.id +
return "id: " + e.id +
" type: " + e.type +
" sourceNode: " + e.source.id +
" targetNode: " + e.target.id +
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

210-210: Hard tabs
Column: 1

(MD010, no-hard-tabs)


211-211: Hard tabs
Column: 1

(MD010, no-hard-tabs)


212-212: Hard tabs
Column: 1

(MD010, no-hard-tabs)

🤖 Prompt for AI Agents
In `@udfs/index.md` around lines 209 - 212, The example return expression using
concatenation of e.id, e.type, e.source.id and e.target.id contains hard tab
characters; update the markdown code block so all tabs are replaced with spaces
(use consistent 2 or 4 spaces for indentation) around the return line and
subsequent concatenated lines, ensuring the lines with "return "id: " + e.id",
"+ " type: " + e.type", "+ " sourceNode: " + e.source.id", and "+ " targetNode:
" + e.target.id" use spaces instead of tabs.

udfs/index.md Outdated
Comment on lines 236 to 238
UDFs have access to a global `graph` object which represents the current graph executing the UDF.
The object exposes a single function `traverse` which is similar to the node's `getNeighbors` function (see docs above)
but can perform multi source traversal.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hyphenate “multi-source” for clarity.

Minor grammar fix recommended by lint.

✏️ Suggested edit
-The object exposes a single function `traverse` which is similar to the node's `getNeighbors` function (see docs above)
-but can perform multi source traversal.
+The object exposes a single function `traverse` which is similar to the node's `getNeighbors` function (see docs above)
+but can perform multi-source traversal.
-Using the multi source traversal can be faster than performing multiple individual calls to getNeighbors.
+Using the multi-source traversal can be faster than performing multiple individual calls to getNeighbors.

Also applies to: 254-254

🧰 Tools
🪛 LanguageTool

[grammar] ~238-~238: Use a hyphen to join words.
Context: ...n (see docs above) but can perform multi source traversal. ```javascript functio...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
In `@udfs/index.md` around lines 236 - 238, Update the wording to hyphenate
“multi-source” where it describes the traverse function: change the phrase that
reads "multi source traversal" to "multi-source traversal" in the UDF docs
referencing the global graph object and its traverse function (see the line that
compares traverse to the node's getNeighbors function). Apply the same
hyphenation at the other occurrence mentioned in the comment.

Comment on lines +259 to +290
#### falkor.log

##### Description
Logs a message to the database stdout

##### Syntax
```javascript
falkor.log(msg)
```

##### Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `message` | string | Yes | message to log |

##### falkor.register

##### Description
Register a function to the database

##### Syntax
```javascript
falkor.register(name, function)
```

##### Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | expose function under this name |
| `function` | function pointer | Yes | function to expose |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid duplicate subheadings and fix table alignment.

Markdownlint flags duplicate headings and table alignment issues in this section.

🧭 Suggested structure
-#### falkor.log
-
-##### Description
+#### falkor.log
+##### falkor.log — Description
...
-##### Syntax
+##### falkor.log — Syntax
...
-##### Parameters
+##### falkor.log — Parameters
-##### falkor.register
-
-##### Description
+#### falkor.register
+##### falkor.register — Description
...
-##### Syntax
+##### falkor.register — Syntax
...
-##### Parameters
+##### falkor.register — Parameters

Also align the table pipes under the headers for both parameter tables to satisfy MD060.

🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

273-273: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


273-273: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


277-277: Multiple headings with the same content

(MD024, no-duplicate-heading)


280-280: Multiple headings with the same content

(MD024, no-duplicate-heading)


285-285: Multiple headings with the same content

(MD024, no-duplicate-heading)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)

🤖 Prompt for AI Agents
In `@udfs/index.md` around lines 259 - 290, Remove the duplicated
"falkor.register" subheading and ensure each function has a single unique
heading (keep "falkor.log" and then a separate "falkor.register" section only
once); fix the parameter tables for both functions by aligning the table pipe
columns under the header (MD060) and make parameter names consistent with the
syntax examples (e.g., use `msg` or `message` consistently for falkor.log), and
ensure the "Required" and "Description" cells line up vertically with the header
pipes.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@udfs/index.md`:
- Line 266: The example call uses falkor.log(msg) but the parameter table
documents "message"; update the parameter table entries (the two occurrences
referenced) to use the parameter name "msg" to match the syntax example so the
parameter name is consistent with the example call falkor.log(msg).
- Line 251: Fix the typo in the sentence that refers to the `falkor` global by
changing "objects" to "object" so it reads "The `falkor` global object
represents the FalkorDB database and is used mostly to register UDFs"; update
the text in udfs/index.md where the phrase "The `falkor` global objects" appears
(look for the line containing the backticked `falkor`) to the corrected singular
form.


##### Syntax
```javascript
falkor.log(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Parameter name mismatch between syntax and table.

The syntax example uses msg but the parameter table documents message. These should match for clarity.

🔧 Proposed fix

Option 1: Change syntax to match table

-falkor.log(msg)
+falkor.log(message)

Option 2: Change table to match syntax (preferred for brevity)

-| `message` | string | Yes | message to log |
+| `msg` | string | Yes | message to log |

Also applies to: 273-273

🤖 Prompt for AI Agents
In `@udfs/index.md` at line 266, The example call uses falkor.log(msg) but the
parameter table documents "message"; update the parameter table entries (the two
occurrences referenced) to use the parameter name "msg" to match the syntax
example so the parameter name is consistent with the example call
falkor.log(msg).

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
udfs/index.md (1)

198-203: Align Edge property description with source / target.

The sentence still references startNode/endNode while the bullets now use source/target. Update the description to match the new names to avoid confusion.

✏️ Proposed edit
-In a UDF, an edge object exposes its  `ID`, `type`, `startNode`,`endNode` and `attributes` via the corresponding properties:
+In a UDF, an edge object exposes its  `ID`, `type`, `source`, `target` and `attributes` via the corresponding properties:
🤖 Fix all issues with AI agents
In `@udfs/index.md`:
- Around line 280-290: The docs use the reserved word "function" as a parameter
name in the falkor.register signature and parameter table; change that
identifier to a valid name such as "fn" or "callback" everywhere (both in the
syntax line "falkor.register(name, function)" and the Parameters table entry for
`function`) so the example is valid JavaScript and consistent with the
falkor.register API.
- Around line 251-253: Add a period after the phrase "used mostly to register
UDFs" and capitalize the first letter of the following sentence so the
description of the falkor global object reads as two separate sentences; ensure
the terms "falkor" (global object), "FalkorDB", and "UDFs" remain unchanged
aside from the punctuation and capitalization fix.

udfs/index.md Outdated
Comment on lines 251 to 253
The `falkor` global object represents the FalkorDB database and is used mostly to register UDFs
the object exposes two functions:

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a period and capitalize the next sentence.

The sentence reads as a run-on.

✏️ Proposed edit
-The `falkor` global object represents the FalkorDB database and is used mostly to register UDFs
-the object exposes two functions:
+The `falkor` global object represents the FalkorDB database and is used mostly to register UDFs.
+The object exposes two functions:
🤖 Prompt for AI Agents
In `@udfs/index.md` around lines 251 - 253, Add a period after the phrase "used
mostly to register UDFs" and capitalize the first letter of the following
sentence so the description of the falkor global object reads as two separate
sentences; ensure the terms "falkor" (global object), "FalkorDB", and "UDFs"
remain unchanged aside from the punctuation and capitalization fix.

Comment on lines +280 to +290
##### Syntax
```javascript
falkor.register(name, function)
```

##### Parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `name` | string | Yes | expose function under this name |
| `function` | function pointer | Yes | function to expose |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Avoid using reserved keyword function as a parameter name.

In JavaScript, function is a reserved keyword and cannot be used as an identifier. Use fn or callback in the syntax and parameter table.

✏️ Proposed edit
-falkor.register(name, function)
+falkor.register(name, fn)
-| `function` | function pointer | Yes | function to expose |
+| `fn` | function pointer | Yes | function to expose |
🧰 Tools
🪛 markdownlint-cli2 (0.20.0)

280-280: Multiple headings with the same content

(MD024, no-duplicate-heading)


285-285: Multiple headings with the same content

(MD024, no-duplicate-heading)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


289-289: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)


290-290: Table column style
Table pipe does not align with header for style "aligned"

(MD060, table-column-style)

🤖 Prompt for AI Agents
In `@udfs/index.md` around lines 280 - 290, The docs use the reserved word
"function" as a parameter name in the falkor.register signature and parameter
table; change that identifier to a valid name such as "fn" or "callback"
everywhere (both in the syntax line "falkor.register(name, function)" and the
Parameters table entry for `function`) so the example is valid JavaScript and
consistent with the falkor.register API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants