Skip to main content
The Neo4jResourceClient allows you to execute Cypher queries against Neo4j graph databases for node and relationship operations.

Usage

import { myNeo4jClient } from "./clients";

const result = await myNeo4jClient.invoke(
  "MATCH (u:User {id: $id}) RETURN u",
  { id: "123" },
  "get-user"
);

if (result.ok) {
  console.log(result.result.rows);
}

Inputs

The invoke method accepts the following arguments:
cypher
string
required
The Cypher query string to execute. Use $paramName for parameterized queries.
params
Record<string, unknown>
An object of named parameters for the Cypher query.
invocationKey
string
required
A unique identifier for this operation, used for tracing and logging.
timeoutMs
number
Optional timeout in milliseconds for the query execution.

Outputs

On success (ok: true), the result object contains:
kind
"database"
Discriminator for the response type.
rows
Record<string, unknown>[]
An array of objects representing the records returned by the query.