Skip to content

Commit 9d1067e

Browse files
committed
Merge remote-tracking branch 'origin/main' into call-docs
2 parents 087f7a6 + 32ab1a4 commit 9d1067e

File tree

8 files changed

+43
-8
lines changed

8 files changed

+43
-8
lines changed

.changeset/crazy-signs-kick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@neo4j/cypher-builder": patch
3+
---
4+
5+
Deprecates `Call.importWith` in favor of scope variables in `Call` constructor

.changeset/lazy-buckets-peel.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
"@neo4j/cypher-builder": patch
3+
---
4+
5+
Deprecate apoc functions and procedures. These will no longer be supported in version 3 of Cypher Builder:
6+
7+
- `apoc.date.convertFormat`
8+
- `apoc.util.validate`
9+
- `apoc.util.validatePredicate`
10+
- `apoc.cypher.runFirstColumnMany`
11+
- `apoc.cypher.runFirstColumnSingle`
12+
13+
These can still be used by using the `Function` class directly:
14+
15+
```js
16+
const convertFormat = new Cypher.Function("apoc.date.convertFormat", [
17+
new Cypher.Variable(),
18+
new Cypher.Literal("iso_zoned_date_time"),
19+
new Cypher.Literal("iso_offset_date_time"),
20+
]);
21+
```

docs/modules/ROOT/pages/functions.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ This differentiates functions from clauses and other elements of the Cypher Buil
2626
====
2727

2828
Exposed functions have the closest possible name to their Cypher counterpart, and reside in the same namespace.
29-
For example, this query:
29+
For example:
3030

3131
[source, javascript]
3232
----
33-
Cypher.apoc.cypher.runFirstColumnSingle()
33+
Cypher.db.nameFromElementId("1234")
3434
----
3535

36-
Is equivalent to the Cypher function:
36+
Generates the Cypher function:
3737

3838
[source, cypher]
3939
----
40-
apoc.cypher.runFirstColumnSingle()
40+
db.nameFromElementId("1234")
4141
----
4242

4343
== Custom functions
@@ -46,7 +46,7 @@ In some cases, you may need to use functions that are not available in Cypher Bu
4646
For instance, if you are using plugins or some of the newest features of Neo4j.
4747

4848
For these cases, you can use the class `Function` to create custom functions.
49-
This example calls link:https://neo4j.com/docs/cypher-manual/current/functions/mathematical-numeric/#functions-isnan[`isNan`] as a custom function:
49+
This example calls an arbitrary function `myFunction`:
5050

5151
[source, javascript]
5252
----

docs/modules/ROOT/pages/subqueries/call.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ CALL (*) {
8787
}
8888
----
8989

90+
[role=label--deprecated]
9091
== `.importWith`
9192

9293
[WARNING]
@@ -96,7 +97,7 @@ This method is deprecated in favor of <<_variable_scope>>.
9697

9798
[WARNING]
9899
====
99-
ImportWith cannot be used if scope variables are defined and will throw an error.
100+
`ImportWith` cannot be used if scope variables are defined and will throw an error.
100101
====
101102

102103

src/clauses/Call.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export type CallInTransactionOptions = {
6060
retry?: number | boolean;
6161
};
6262

63-
/**
63+
/** Adds a `CALL` subquery
64+
* @param subquery - A clause to be wrapped in a `CALL` clause
65+
* @param variableScope - A list of variables to pass to the scope of the clause: `CALL (var0) {`
6466
* @see {@link https://neo4j.com/docs/cypher-manual/current/clauses/call-subquery/ | Cypher Documentation}
6567
* @group Subqueries
6668
*/
@@ -81,7 +83,8 @@ export class Call extends Clause {
8183
}
8284

8385
/** Adds a `WITH` statement inside `CALL {`, this `WITH` can is used to import variables outside of the subquery
84-
* @see {@link https://neo4j.com/docs/cypher-manual/current/subqueries/call-subquery/#call-importing-variables | Cypher Documentation}
86+
* @see {@link https://neo4j.com/docs/cypher-manual/current/subqueries/call-subquery/#call-importing-variables | Cypher Documentation}
87+
* @deprecated Use constructor parameter `variableScope` instead
8588
*/
8689
public importWith(...params: Array<Variable | "*">): this {
8790
if (this._importWith) {

src/namespaces/apoc/cypher/run-first-column.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type { Expr } from "../../../types";
2626

2727
/**
2828
* @group Functions
29+
* @deprecated apoc methods will no longer be supported in Cypher Builder version 3
2930
* @see [Apoc Documentation](https://neo4j.com/docs/apoc/current/overview/apoc.cypher/apoc.cypher.runFirstColumnMany/)
3031
*/
3132
export function runFirstColumnMany(
@@ -37,6 +38,7 @@ export function runFirstColumnMany(
3738

3839
/**
3940
* @group Functions
41+
* @deprecated apoc methods will no longer be supported in Cypher Builder version 3
4042
* @see [Apoc Documentation](https://neo4j.com/docs/apoc/current/overview/apoc.cypher/apoc.cypher.runFirstColumnSingle/)
4143
*/
4244
export function runFirstColumnSingle(

src/namespaces/apoc/date.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import type { Expr } from "../../types";
2525
/**
2626
* @group Functions
2727
* @see [Apoc Documentation](https://neo4j.com/docs/apoc/current/overview/apoc.date/apoc.date.convertFormat/)
28+
* @deprecated apoc methods will no longer be supported in Cypher Builder version 3
2829
* @example
2930
* ```ts
3031
* Cypher.apoc.date.convertFormat(

src/namespaces/apoc/util.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { normalizeVariable } from "../../utils/normalize-variable";
2727

2828
/**
2929
* @group Procedures
30+
* @deprecated apoc methods will no longer be supported in Cypher Builder version 3
3031
* @see [Apoc Documentation](https://neo4j.com/docs/apoc/current/overview/apoc.util/apoc.util.validate/)
3132
*/
3233
export function validate(
@@ -40,6 +41,7 @@ export function validate(
4041

4142
/**
4243
* @group Functions
44+
* @deprecated apoc methods will no longer be supported in Cypher Builder version 3
4345
* @see [Apoc Documentation](https://neo4j.com/docs/apoc/current/overview/apoc.util/apoc.util.validatePredicate/)
4446
*/
4547
export function validatePredicate(predicate: Predicate, message: string): CypherFunction {

0 commit comments

Comments
 (0)