diff --git a/packages/graphql/src/translate/create-connect-and-params.test.ts b/packages/graphql/src/translate/create-connect-and-params.test.ts index 403bed110f..3f65596100 100644 --- a/packages/graphql/src/translate/create-connect-and-params.test.ts +++ b/packages/graphql/src/translate/create-connect-and-params.test.ts @@ -127,30 +127,26 @@ describe("createConnectAndParams", () => { expect(result[0]).toMatchInlineSnapshot(` "WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this0_node:Movie) WHERE this0_node.title = $this0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this0_node CREATE (this)-[:\`SIMILAR\`]->(this0_node) } } WITH this, this0_node - CALL { + CALL(*) { WITH this, this0_node OPTIONAL MATCH (this0_node_similarMovies0_node:Movie) WHERE this0_node_similarMovies0_node.title = $this0_node_similarMovies0_node_param0 - CALL { - WITH * + CALL(*) { WITH this, collect(this0_node_similarMovies0_node) as connectedNodes, collect(this0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_node UNWIND connectedNodes as this0_node_similarMovies0_node CREATE (this0_node)-[:\`SIMILAR\`]->(this0_node_similarMovies0_node) diff --git a/packages/graphql/src/translate/create-connect-and-params.ts b/packages/graphql/src/translate/create-connect-and-params.ts index db88d31dc7..93133a0765 100644 --- a/packages/graphql/src/translate/create-connect-and-params.ts +++ b/packages/graphql/src/translate/create-connect-and-params.ts @@ -160,8 +160,7 @@ function createConnectAndParams({ Replace with subclauses https://neo4j.com/developer/kb/conditional-cypher-execution/ https://neo4j.slack.com/archives/C02PUHA7C/p1603458561099100 */ - subquery.push("\tCALL {"); - subquery.push("\t\tWITH *"); + subquery.push("\tCALL(*) {"); const withVarsInner = [ ...withVars.filter((v) => v !== parentVar), `collect(${nodeName}) as connectedNodes`, @@ -170,8 +169,7 @@ function createConnectAndParams({ subquery.push(`\t\tWITH ${filterMetaVariable(withVarsInner).join(", ")}`); - subquery.push("\t\tCALL {"); // - subquery.push("\t\t\tWITH connectedNodes, parentNodes"); // + subquery.push("\t\tCALL(connectedNodes, parentNodes) {"); subquery.push(`\t\t\tUNWIND parentNodes as ${parentVar}`); subquery.push(`\t\t\tUNWIND connectedNodes as ${nodeName}`); subquery.push(`\t\t\tCREATE (${parentVar})${inStr}${relTypeStr}${outStr}(${nodeName})`); @@ -326,7 +324,7 @@ function createConnectAndParams({ } }); if (subqueries.length > 0) { - inner.push(subqueries.join("\n}\nCALL {\n\t")); + inner.push(subqueries.join("\n}\nCALL(*) {\n\t")); } } else { const targetNode = refNodes[0]; @@ -342,7 +340,7 @@ function createConnectAndParams({ } if (inner.length > 0) { - res.connects.push("CALL {"); + res.connects.push("CALL(*) {"); res.connects.push(...inner); res.connects.push("}"); } diff --git a/packages/graphql/src/translate/create-delete-and-params.ts b/packages/graphql/src/translate/create-delete-and-params.ts index 0d3d3e5db4..04068a247b 100644 --- a/packages/graphql/src/translate/create-delete-and-params.ts +++ b/packages/graphql/src/translate/create-delete-and-params.ts @@ -103,10 +103,7 @@ function createDeleteAndParams({ const labels = refNode.getLabelString(context); innerStrs.push("WITH *"); - innerStrs.push("CALL {"); - if (withVars) { - innerStrs.push(`WITH *`); - } + innerStrs.push("CALL(*) {"); innerStrs.push( `OPTIONAL MATCH (${parentVar})${inStr}${relTypeStr}${outStr}(${variableName}${labels})` ); @@ -211,8 +208,7 @@ function createDeleteAndParams({ const statements = [ `WITH ${relationshipVariable}, collect(DISTINCT ${variableName}) AS ${nodeToDelete}`, - "CALL {", - `\tWITH ${nodeToDelete}`, + `CALL(${nodeToDelete}) {`, `\tUNWIND ${nodeToDelete} AS x`, `\tDETACH DELETE x`, `}`, diff --git a/packages/graphql/src/translate/create-disconnect-and-params.test.ts b/packages/graphql/src/translate/create-disconnect-and-params.test.ts index 8e904d2b1b..e30aaa740e 100644 --- a/packages/graphql/src/translate/create-disconnect-and-params.test.ts +++ b/packages/graphql/src/translate/create-disconnect-and-params.test.ts @@ -136,24 +136,22 @@ describe("createDisconnectAndParams", () => { expect(result[0]).toMatchInlineSnapshot(` "WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this0_rel:\`SIMILAR\`]->(this0:Movie) WHERE this0.title = $this0_where_Movie_this0param0 - CALL { - WITH this0, this0_rel, this - WITH collect(this0) as this0, this0_rel, this - UNWIND this0 as x + CALL (this0, this0_rel, this) { + WITH collect(this0) as this0_x, this0_rel, this + UNWIND this0_x as x DELETE this0_rel } - CALL { + CALL(*) { WITH this, this0 OPTIONAL MATCH (this0)-[this0_similarMovies0_rel:\`SIMILAR\`]->(this0_similarMovies0:Movie) WHERE this0_similarMovies0.title = $this0_disconnect_similarMovies0_where_Movie_this0_similarMovies0param0 - CALL { - WITH this0_similarMovies0, this0_similarMovies0_rel, this0 - WITH collect(this0_similarMovies0) as this0_similarMovies0, this0_similarMovies0_rel, this0 - UNWIND this0_similarMovies0 as x + CALL (this0_similarMovies0, this0_similarMovies0_rel, this0) { + WITH collect(this0_similarMovies0) as this0_similarMovies0_x, this0_similarMovies0_rel, this0 + UNWIND this0_similarMovies0_x as x DELETE this0_similarMovies0_rel } RETURN count(*) AS disconnect_this0_similarMovies_Movie diff --git a/packages/graphql/src/translate/create-disconnect-and-params.ts b/packages/graphql/src/translate/create-disconnect-and-params.ts index 285d063929..9681ea145e 100644 --- a/packages/graphql/src/translate/create-disconnect-and-params.ts +++ b/packages/graphql/src/translate/create-disconnect-and-params.ts @@ -152,11 +152,10 @@ function createDisconnectAndParams({ } } - subquery.push("CALL {"); + subquery.push(`CALL (${variableName}, ${relVarName}, ${parentVar}) {`); // Trick to avoid execution on null values - subquery.push(`\tWITH ${variableName}, ${relVarName}, ${parentVar}`); - subquery.push(`\tWITH collect(${variableName}) as ${variableName}, ${relVarName}, ${parentVar}`); - subquery.push(`\tUNWIND ${variableName} as x`); + subquery.push(`\tWITH collect(${variableName}) as ${variableName}_x, ${relVarName}, ${parentVar}`); + subquery.push(`\tUNWIND ${variableName}_x as x`); subquery.push(`\tDELETE ${relVarName}`); @@ -266,7 +265,7 @@ function createDisconnectAndParams({ } }); if (subqueries.length > 0) { - inner.push(subqueries.join("\n}\nCALL {\n\t")); + inner.push(subqueries.join("\n}\nCALL(*) {\n\t")); } } else { const subquery = createSubqueryContents(refNodes[0] as Node, disconnect, index); @@ -275,7 +274,7 @@ function createDisconnectAndParams({ } if (inner.length > 0) { - res.disconnects.push("CALL {"); + res.disconnects.push("CALL(*) {"); res.disconnects.push(...inner); res.disconnects.push("}"); } diff --git a/packages/graphql/src/translate/create-relationship-validation-clauses.ts b/packages/graphql/src/translate/create-relationship-validation-clauses.ts index 1d4a6291ae..aa8d1288b8 100644 --- a/packages/graphql/src/translate/create-relationship-validation-clauses.ts +++ b/packages/graphql/src/translate/create-relationship-validation-clauses.ts @@ -72,7 +72,7 @@ export function createRelationshipValidationClauses({ .with([Cypher.count(relVarnameCypher), cVariable]) .where(Cypher.apoc.util.validatePredicate(predicateCypher, errorMsg)) .return([returnVar, new Cypher.Variable()]); - return new Cypher.Call(match).importWith(varName); + return new Cypher.Call(match, [varName]); }) ); } diff --git a/packages/graphql/src/translate/create-update-and-params.ts b/packages/graphql/src/translate/create-update-and-params.ts index 8f5220fc14..a4b557a419 100644 --- a/packages/graphql/src/translate/create-update-and-params.ts +++ b/packages/graphql/src/translate/create-update-and-params.ts @@ -318,7 +318,7 @@ export default function createUpdateAndParams({ subquery.push( `WITH ${withVars.join(", ")}`, - "CALL {", + "CALL(*) {", indentBlock(innerUpdate.join("\n")), "}" ); @@ -483,11 +483,11 @@ export default function createUpdateAndParams({ }); if (relationField.interface) { res.strs.push(`WITH ${withVars.join(", ")}`); - res.strs.push(`CALL {\n\t WITH ${withVars.join(", ")}\n\t`); + res.strs.push(`CALL (${withVars.join(", ")}) {\n\t`); const subqueriesWithMetaPassedOn = subqueries.map( (each, i) => each + `\n}\n${intermediateWithMetaStatements[i] || ""}` ); - res.strs.push(subqueriesWithMetaPassedOn.join(`\nCALL {\n\t WITH ${withVars.join(", ")}\n\t`)); + res.strs.push(subqueriesWithMetaPassedOn.join(`\nCALL (${withVars.join(", ")}){\n\t`)); } else { res.strs.push(subqueries.join("\n")); } diff --git a/packages/graphql/src/translate/queryAST/ast/filters/ConnectionFilter.ts b/packages/graphql/src/translate/queryAST/ast/filters/ConnectionFilter.ts index 135336c333..d6b9e6eff0 100644 --- a/packages/graphql/src/translate/queryAST/ast/filters/ConnectionFilter.ts +++ b/packages/graphql/src/translate/queryAST/ast/filters/ConnectionFilter.ts @@ -206,7 +206,7 @@ export class ConnectionFilter extends Filter { const subqueries = this.innerFilters.flatMap((f) => { const nestedSubqueries = f .getSubqueries(queryASTContext) - .map((sq) => new Cypher.Call(sq).importWith(queryASTContext.target)); + .map((sq) => new Cypher.Call(sq, [queryASTContext.target])); const selection = f.getSelection(queryASTContext); const predicate = f.getPredicate(queryASTContext); const clauses = [...selection, ...nestedSubqueries]; @@ -253,8 +253,7 @@ export class ConnectionFilter extends Filter { if (predicate) { const returnVar = new Cypher.Variable(); truthyFilters.push(returnVar); - return new Cypher.Call(sq) - .importWith(queryASTContext.target) + return new Cypher.Call(sq, [queryASTContext.target]) .with("*") .where(predicate) .return([Cypher.gt(Cypher.count(queryASTContext.target), new Cypher.Literal(0)), returnVar]); @@ -274,8 +273,7 @@ export class ConnectionFilter extends Filter { if (predicate) { const returnVar = new Cypher.Variable(); falsyFilters.push(returnVar); - return new Cypher.Call(sq) - .importWith(queryASTContext.target) + return new Cypher.Call(sq, [queryASTContext.target]) .with("*") .where(Cypher.not(predicate)) .return([Cypher.gt(Cypher.count(queryASTContext.target), new Cypher.Literal(0)), returnVar]); diff --git a/packages/graphql/src/translate/queryAST/ast/filters/RelationshipFilter.ts b/packages/graphql/src/translate/queryAST/ast/filters/RelationshipFilter.ts index d89e82a48a..4087aefed1 100644 --- a/packages/graphql/src/translate/queryAST/ast/filters/RelationshipFilter.ts +++ b/packages/graphql/src/translate/queryAST/ast/filters/RelationshipFilter.ts @@ -236,7 +236,7 @@ export class RelationshipFilter extends Filter { const returnVar = new Cypher.Variable(); returnVariables.push(returnVar); const nestedSubqueries = f.getSubqueries(context).map((sq) => { - return new Cypher.Call(sq).importWith(context.target); + return new Cypher.Call(sq, [context.target]); }); let predicate = f.getPredicate(context); diff --git a/packages/graphql/src/translate/queryAST/ast/operations/ConnectionReadOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/ConnectionReadOperation.ts index c174d4d28f..76e0819d15 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/ConnectionReadOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/ConnectionReadOperation.ts @@ -158,11 +158,11 @@ export class ConnectionReadOperation extends Operation { } const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map((sq) => { - return new Cypher.Call(sq).importWith(nestedContext.target); + return new Cypher.Call(sq, [nestedContext.target]); }); const normalFilterSubqueries = this.getFilterSubqueries(nestedContext).map((sq) => { - return new Cypher.Call(sq).importWith(nestedContext.target); + return new Cypher.Call(sq, [nestedContext.target]); }); const filtersSubqueries = [...authFilterSubqueries, ...normalFilterSubqueries]; @@ -171,11 +171,10 @@ export class ConnectionReadOperation extends Operation { const isTopLevel = !this.relationship; const aggregationSubqueries = (this.aggregationField?.getSubqueries(context) ?? []).map((sq) => { - const subquery = new Cypher.Call(sq); if (!isTopLevel) { - return subquery.importWith(context.target); + return new Cypher.Call(sq, [context.target]); } else { - return subquery; + return new Cypher.Call(sq); } }); @@ -240,8 +239,9 @@ export class ConnectionReadOperation extends Operation { if (aggregationSubqueries.length > 0) { connectionClauses = new Cypher.Call( // NOTE: this call is only needed when aggregate is used - Cypher.utils.concat(connectionClauses, new Cypher.Return(edgesProjectionVar, totalCount)) - ).importWith("*"); + Cypher.utils.concat(connectionClauses, new Cypher.Return(edgesProjectionVar, totalCount)), + "*" + ); } return { @@ -303,8 +303,9 @@ export class ConnectionReadOperation extends Operation { paginationWith, ...postPaginationSubqueries, new Cypher.Return([Cypher.collect(edgeProjectionMap), returnVar]) - ) - ).importWith(edgesVar); + ), + [edgesVar] + ); } protected createProjectionMapForNode(context: QueryASTContext): Cypher.Map { diff --git a/packages/graphql/src/translate/queryAST/ast/operations/CypherEntityOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/CypherEntityOperation.ts index de839a4258..0d2b6f1f27 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/CypherEntityOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/CypherEntityOperation.ts @@ -52,8 +52,8 @@ export class CypherEntityOperation extends ReadOperation { ...this.getCypherFieldsSubqueries(nestedContext) ); - const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map((sq) => - new Cypher.Call(sq).importWith(nestedContext.target) + const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map( + (sq) => new Cypher.Call(sq, [nestedContext.target]) ); const authPredicates = this.getAuthFilterPredicate(nestedContext); diff --git a/packages/graphql/src/translate/queryAST/ast/operations/DeleteOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/DeleteOperation.ts index 2e9a352334..3d7cd23a81 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/DeleteOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/DeleteOperation.ts @@ -80,7 +80,7 @@ export class DeleteOperation extends MutationOperation { this.validateSelection(selection); const filterSubqueries = wrapSubqueriesInCypherCalls(context, this.filters, [context.target]); const authBeforeSubqueries = this.getAuthFilterSubqueries(context).map((c) => { - return new Cypher.Call(c).importWith(context.target); + return new Cypher.Call(c, [context.target]); }); const predicate = this.getPredicate(context); const validations = this.getValidations(context); @@ -112,7 +112,7 @@ export class DeleteOperation extends MutationOperation { const filterSubqueries = wrapSubqueriesInCypherCalls(context, this.filters, [context.target]); const authBeforeSubqueries = this.getAuthFilterSubqueries(context).map((c) => { - return new Cypher.Call(c).importWith(context.target); + return new Cypher.Call(c, [context.target]); }); const extraSelections = this.getExtraSelections(context); const predicate = this.getPredicate(context); @@ -124,7 +124,7 @@ export class DeleteOperation extends MutationOperation { const unwindDeleteVar = new Cypher.Variable(); const deleteClause = new Cypher.Unwind([deleteVar, unwindDeleteVar]).detachDelete(unwindDeleteVar); - const deleteBlock = new Cypher.Call(deleteClause).importWith(deleteVar); + const deleteBlock = new Cypher.Call(deleteClause, [deleteVar]); const nestedOperations: (Cypher.Call | Cypher.With)[] = this.getNestedDeleteSubQueries(context); const statements = this.appendFilters( [selection, ...extraSelections, ...filterSubqueries, ...authBeforeSubqueries], @@ -187,7 +187,7 @@ export class DeleteOperation extends MutationOperation { const nestedOperations: Cypher.Call[] = []; for (const nestedDeleteOperation of this.nestedOperations) { const { clauses } = nestedDeleteOperation.transpile(context); - nestedOperations.push(...clauses.map((c) => new Cypher.Call(c).importWith("*"))); + nestedOperations.push(...clauses.map((c) => new Cypher.Call(c, "*"))); } return nestedOperations; } diff --git a/packages/graphql/src/translate/queryAST/ast/operations/ReadOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/ReadOperation.ts index f729a2d6ea..46126beab0 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/ReadOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/ReadOperation.ts @@ -138,8 +138,8 @@ export class ReadOperation extends Operation { const cypherFieldSubqueries = this.getCypherFieldsSubqueries(nestedContext); const sortSubqueries = wrapSubqueriesInCypherCalls(nestedContext, this.sortFields, [nestedContext.target]); - const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map((sq) => - new Cypher.Call(sq).importWith(nestedContext.target) + const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map( + (sq) => new Cypher.Call(sq, [nestedContext.target]) ); const authFiltersPredicate = this.getAuthFilterPredicate(nestedContext); diff --git a/packages/graphql/src/translate/queryAST/ast/operations/UnwindCreateOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/UnwindCreateOperation.ts index 19d92544f9..92ec3a1af9 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/UnwindCreateOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/UnwindCreateOperation.ts @@ -125,7 +125,7 @@ export class UnwindCreateOperation extends MutationOperation { const nestedSubqueries = setSubqueries.flatMap((clause) => [ new Cypher.With(nestedContext.target, this.unwindVariable), - new Cypher.Call(clause).importWith(nestedContext.target, this.unwindVariable), + new Cypher.Call(clause, [nestedContext.target, this.unwindVariable]), ]); const authorizationClauses = this.getAuthorizationClauses(nestedContext); @@ -150,8 +150,9 @@ export class UnwindCreateOperation extends MutationOperation { ); } else { subQueryClause = new Cypher.Call( - Cypher.utils.concat(unwindCreateClauses, new Cypher.Return(nestedContext.target)) - ).importWith(this.unwindVariable); + Cypher.utils.concat(unwindCreateClauses, new Cypher.Return(nestedContext.target)), + [this.unwindVariable] + ); } const projectionContext = new QueryASTContext({ ...nestedContext, diff --git a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeConnectionReadOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeConnectionReadOperation.ts index 79b2abd3e6..876b4de43c 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeConnectionReadOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeConnectionReadOperation.ts @@ -60,10 +60,11 @@ export class CompositeConnectionReadOperation extends Operation { const union = new Cypher.Union(...nestedSubqueries); - const nestedSubquery = new Cypher.Call(new Cypher.Call(union).return([Cypher.collect(edgeVar), edgesVar])); - if (context.target) { - nestedSubquery.importWith(context.target); - } + const contextTarget = context.target ? [context.target] : []; + const nestedSubquery = new Cypher.Call( + new Cypher.Call(union).return([Cypher.collect(edgeVar), edgesVar]), + contextTarget + ); let orderSubquery: Cypher.Call | undefined; @@ -97,7 +98,7 @@ export class CompositeConnectionReadOperation extends Operation { extraWithOrder.return([Cypher.collect(edgeVar), edgesVar2]); returnEdgesVar = edgesVar2; - orderSubquery = new Cypher.Call(extraWithOrder).importWith(edgesVar); + orderSubquery = new Cypher.Call(extraWithOrder, [edgesVar]); } const { @@ -126,9 +127,7 @@ export class CompositeConnectionReadOperation extends Operation { clauses: [ Cypher.utils.concat( nestedSubquery, - ...aggregateSubqueries.map((clause) => - new Cypher.Call(clause).importWith(...filterTruthy([context.target])) - ), + ...aggregateSubqueries.map((clause) => new Cypher.Call(clause, filterTruthy([context.target]))), subqueryWith, orderSubquery, returnClause diff --git a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeCypherOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeCypherOperation.ts index c2a258951f..4047b70be3 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeCypherOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeCypherOperation.ts @@ -66,14 +66,15 @@ export class CompositeCypherOperation extends Operation { const { clauses } = partial.transpile(partialContext); return Cypher.utils.concat(new Cypher.With("*"), ...clauses); }); - const partialsSubquery = new Cypher.Call(new Cypher.Union(...partialClauses)).return( + const partialsSubquery = new Cypher.Call(new Cypher.Union(...partialClauses), "*").return( partialContext.returnVariable ); const returnExpr = this.getReturnExpression(nestedContext, returnVariable); - const subquery = new Cypher.Call(partialsSubquery) - .importWith(nestedContext.target) - .return([returnExpr, nestedContext.returnVariable]); + const subquery = new Cypher.Call(partialsSubquery, [nestedContext.target]).return([ + returnExpr, + nestedContext.returnVariable, + ]); return { clauses: [Cypher.utils.concat(matchClause, subquery)], projectionExpr: nestedContext.returnVariable, diff --git a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadOperation.ts b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadOperation.ts index 72fa1a3e62..3cd7749fea 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadOperation.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadOperation.ts @@ -74,7 +74,7 @@ export class CompositeReadOperation extends Operation { if (this.relationship && !this.relationship.isList) { aggrExpr = Cypher.head(aggrExpr); } - const nestedSubquery = new Cypher.Call(new Cypher.Union(...nestedSubqueries)).with(context.returnVariable); + const nestedSubquery = new Cypher.Call(new Cypher.Union(...nestedSubqueries), "*").with(context.returnVariable); if (this.sortFields.length > 0) { nestedSubquery.orderBy(...this.getSortFields(context, context.returnVariable)); diff --git a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadPartial.ts b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadPartial.ts index b993886696..65cbe70ff4 100644 --- a/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadPartial.ts +++ b/packages/graphql/src/translate/queryAST/ast/operations/composite/CompositeReadPartial.ts @@ -52,8 +52,8 @@ export class CompositeReadPartial extends ReadOperation { const filterSubqueries = wrapSubqueriesInCypherCalls(nestedContext, this.filters, [nestedContext.target]); const filterPredicates = this.getPredicates(nestedContext); - const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map((sq) => - new Cypher.Call(sq).importWith(nestedContext.target) + const authFilterSubqueries = this.getAuthFilterSubqueries(nestedContext).map( + (sq) => new Cypher.Call(sq, [nestedContext.target]) ); const authFiltersPredicate = this.getAuthFilterPredicate(nestedContext); const validations = this.getValidations(nestedContext); @@ -73,7 +73,7 @@ export class CompositeReadPartial extends ReadOperation { const subqueries = Cypher.utils.concat(...this.getFieldsSubqueries(nestedContext), ...cypherFieldSubqueries); const sortSubqueries = this.sortFields .flatMap((sq) => sq.getSubqueries(nestedContext)) - .map((sq) => new Cypher.Call(sq).importWith(nestedContext.target)); + .map((sq) => new Cypher.Call(sq, [nestedContext.target])); const ret = this.getProjectionClause(nestedContext, context.returnVariable); @@ -149,8 +149,8 @@ export class CompositeReadPartial extends ReadOperation { __id: Cypher.id(context.target), }); - const withClause = new Cypher.With([projection, context.target]); + const withClause = new Cypher.With([projection, returnVariable]); - return withClause.return([context.target, returnVariable]); + return withClause.return(returnVariable); } } diff --git a/packages/graphql/src/translate/queryAST/ast/selection/CustomCypherSelection.ts b/packages/graphql/src/translate/queryAST/ast/selection/CustomCypherSelection.ts index 09dc010682..d4315953be 100644 --- a/packages/graphql/src/translate/queryAST/ast/selection/CustomCypherSelection.ts +++ b/packages/graphql/src/translate/queryAST/ast/selection/CustomCypherSelection.ts @@ -82,8 +82,9 @@ export class CustomCypherSelection extends EntitySelection { if (this.isNested && context.target) { const aliasTargetToPublicTarget = new Cypher.With([context.target, CYPHER_TARGET_VARIABLE]); - statementSubquery = new Cypher.Call(Cypher.utils.concat(aliasTargetToPublicTarget, statementCypherQuery)); - statementSubquery.importWith(context.target); + statementSubquery = new Cypher.Call(Cypher.utils.concat(aliasTargetToPublicTarget, statementCypherQuery), [ + context.target, + ]); } else { statementSubquery = new Cypher.Call(statementCypherQuery); } diff --git a/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-call.ts b/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-call.ts index 9bdb722bbb..67e5d838e7 100644 --- a/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-call.ts +++ b/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-call.ts @@ -21,5 +21,5 @@ import Cypher from "@neo4j/cypher-builder"; /** Wraps provided queries in Call statements with inner target */ export function wrapSubqueryInCall(subquery: Cypher.Clause, target: Cypher.Variable): Cypher.Call { - return new Cypher.Call(subquery).importWith(target); + return new Cypher.Call(subquery, [target]); } diff --git a/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-calls.ts b/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-calls.ts index 1c0d44a2c7..e1cf16f200 100644 --- a/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-calls.ts +++ b/packages/graphql/src/translate/queryAST/utils/wrap-subquery-in-calls.ts @@ -33,10 +33,6 @@ export function wrapSubqueriesInCypherCalls( return f.getSubqueries(context); }) ).map((sq) => { - const call = new Cypher.Call(sq); - if (withArgs) { - call.importWith(...withArgs); - } - return call; + return new Cypher.Call(sq, withArgs); }); } diff --git a/packages/graphql/src/translate/translate-create.ts b/packages/graphql/src/translate/translate-create.ts index 622fda9b3e..6c3c866710 100644 --- a/packages/graphql/src/translate/translate-create.ts +++ b/packages/graphql/src/translate/translate-create.ts @@ -70,7 +70,7 @@ export default async function translateCreate({ throw new Error("Expected varName to be defined"); } - const create = [`CALL {`]; + const create = [`CALL(*) {`]; const withVars = [varName]; projectionWith.push(varName); @@ -133,7 +133,7 @@ export default async function translateCreate({ if (queryASTResult.clauses.length) { projectedVariables.push(queryASTResult.projectionExpr as Cypher.Node); const clause = Cypher.utils.concat(...queryASTResult.clauses); - return new Cypher.Call(clause).importWith(varName); + return new Cypher.Call(clause, [varName]); } }) ) diff --git a/packages/graphql/src/translate/utils/math.ts b/packages/graphql/src/translate/utils/math.ts index 9667cd364e..2664614730 100644 --- a/packages/graphql/src/translate/utils/math.ts +++ b/packages/graphql/src/translate/utils/math.ts @@ -133,9 +133,7 @@ export function buildMathStatements( const statements: string[] = []; const mathScope = Array.from(new Set([scope, ...withVars])); statements.push(`WITH ${mathScope.join(", ")}`); - statements.push(`CALL {`); - // Importing WITH - statements.push(`WITH ${scope}`); + statements.push(`CALL(${scope}) {`); statements.push(`WITH ${scope}`); // Validations statements.push(`WHERE ${validatePredicates.join(" AND ")}`); diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts index f86d5f2776..3cd03b7ccc 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-alias.test.ts @@ -69,10 +69,8 @@ describe("Field Level Aggregations Alias", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 ORDER BY size(this1.name) DESC @@ -109,10 +107,8 @@ describe("Field Level Aggregations Alias", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this0 RETURN { max: max(this0.screentime) } AS var2 diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts index d70673d9a9..6b3a60d70e 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-edge.test.ts @@ -72,10 +72,8 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this0 RETURN { min: min(this0.screentime), max: max(this0.screentime), average: avg(this0.screentime), sum: sum(this0.screentime) } AS var2 diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts index e8439ebbbc..0e8b31b788 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-labels.test.ts @@ -69,10 +69,8 @@ describe("Field Level Aggregations Alias", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Film) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH DISTINCT this1 ORDER BY size(this1.name) DESC diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-where.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-where.test.ts index b7349d14a0..8f829486c2 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-where.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations-where.test.ts @@ -66,10 +66,8 @@ describe("Field Level Aggregations Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WHERE this1.age > $param0 RETURN { nodes: count(DISTINCT this1) } AS var2 @@ -117,20 +115,16 @@ describe("Field Level Aggregations Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WHERE this1.name CONTAINS $param0 RETURN { nodes: count(DISTINCT this1) } AS var2 } RETURN { aggregate: { count: var2 } } AS var3 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this4:DIRECTED]-(this5:Person) WHERE this5.name CONTAINS $param1 RETURN { nodes: count(DISTINCT this5) } AS var6 diff --git a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations.test.ts b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations.test.ts index b5f980477d..9d8328d937 100644 --- a/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations.test.ts +++ b/packages/graphql/tests/tck/aggregations/field-level-aggregations/field-level-aggregations.test.ts @@ -66,10 +66,8 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) RETURN { nodes: count(DISTINCT this1), edges: count(DISTINCT this0) } AS var2 } @@ -107,15 +105,12 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) RETURN { nodes: count(DISTINCT this1) } AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:ACTED_IN]-(this4:Actor) WITH DISTINCT this4 ORDER BY size(this4.name) DESC @@ -155,10 +150,8 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 RETURN { min: min(this1.age), max: max(this1.age), average: avg(this1.age), sum: sum(this1.age) } AS var2 @@ -195,10 +188,8 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 ORDER BY size(this1.name) DESC @@ -235,10 +226,8 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH DISTINCT this1 RETURN { min: apoc.date.convertFormat(toString(min(this1.released)), \\"iso_zoned_date_time\\", \\"iso_offset_date_time\\") } AS var2 @@ -280,18 +269,15 @@ describe("Field Level Aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 ORDER BY size(this1.name) DESC WITH collect(this1.name) AS list RETURN { longest: head(list), shortest: last(list) } AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:ACTED_IN]-(this4:Actor) WITH DISTINCT this4 RETURN { min: min(this4.age), max: max(this4.age), average: avg(this4.age), sum: sum(this4.age) } AS var5 diff --git a/packages/graphql/tests/tck/aggregations/where/authorization-with-aggregation-filter.test.ts b/packages/graphql/tests/tck/aggregations/where/authorization-with-aggregation-filter.test.ts index 85308b126d..34e9c8c58e 100644 --- a/packages/graphql/tests/tck/aggregations/where/authorization-with-aggregation-filter.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/authorization-with-aggregation-filter.test.ts @@ -59,8 +59,7 @@ describe("Authorization with aggregation filter rule", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) = $param0 AS var2 @@ -96,8 +95,7 @@ describe("Authorization with aggregation filter rule", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Post) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:LIKES]-(this2:User) WITH DISTINCT this2 RETURN count(this2) = $param0 AS var3 @@ -106,8 +104,7 @@ describe("Authorization with aggregation filter rule", () => { WHERE ($isAuthenticated = true AND var3 = true) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { content: this0.content, __resolveType: \\"Post\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/aggregations/where/connection-filters-with-aggregations.test.ts b/packages/graphql/tests/tck/aggregations/where/connection-filters-with-aggregations.test.ts index bd2d87e6b9..6c03475048 100644 --- a/packages/graphql/tests/tck/aggregations/where/connection-filters-with-aggregations.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/connection-filters-with-aggregations.test.ts @@ -78,10 +78,8 @@ describe("Field Level Aggregations Edge Filters", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE (this1.title = $param0 AND this0.screentime = $param1) WITH DISTINCT this1 @@ -127,10 +125,8 @@ describe("Field Level Aggregations Edge Filters", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -146,8 +142,7 @@ describe("Field Level Aggregations Edge Filters", () => { } RETURN collect(edge) AS edges } - CALL { - WITH this + CALL (this) { CALL { WITH this MATCH (this)-[this4:ACTED_IN]->(this5:Movie) diff --git a/packages/graphql/tests/tck/aggregations/where/count-edges.test.ts b/packages/graphql/tests/tck/aggregations/where/count-edges.test.ts index 5b99fd55f7..2c0abfc313 100644 --- a/packages/graphql/tests/tck/aggregations/where/count-edges.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/count-edges.test.ts @@ -55,8 +55,7 @@ describe("Cypher Aggregations where with count edges", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:LIKES]->(this1:User) RETURN count(this0) = $param0 AS var2 } @@ -89,8 +88,7 @@ describe("Cypher Aggregations where with count edges", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:LIKES]->(this1:User) RETURN count(this0) < $param0 AS var2 } @@ -123,14 +121,12 @@ describe("Cypher Aggregations where with count edges", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:LIKES]->(this1:User) WITH DISTINCT this1 RETURN count(this1) = $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this3:LIKES]->(this4:User) RETURN count(this3) = $param1 AS var5 } diff --git a/packages/graphql/tests/tck/aggregations/where/count-nested.test.ts b/packages/graphql/tests/tck/aggregations/where/count-nested.test.ts index e1946a1996..4cead6018d 100644 --- a/packages/graphql/tests/tck/aggregations/where/count-nested.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/count-nested.test.ts @@ -59,12 +59,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) = $param0 AS var4 @@ -104,12 +102,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) < $param0 AS var4 @@ -149,12 +145,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) <= $param0 AS var4 @@ -194,12 +188,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) > $param0 AS var4 @@ -239,12 +231,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) >= $param0 AS var4 @@ -284,12 +274,10 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:HAS_POST]->(this3:Post) WITH DISTINCT this3 RETURN count(this3) IN $param0 AS var4 diff --git a/packages/graphql/tests/tck/aggregations/where/count.test.ts b/packages/graphql/tests/tck/aggregations/where/count.test.ts index 6262af6b57..8d0e0708dd 100644 --- a/packages/graphql/tests/tck/aggregations/where/count.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/count.test.ts @@ -55,8 +55,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) = $param0 AS var2 @@ -90,8 +89,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) < $param0 AS var2 @@ -125,8 +123,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) <= $param0 AS var2 @@ -160,8 +157,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 @@ -195,8 +191,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) >= $param0 AS var2 @@ -230,8 +225,7 @@ describe("Cypher Aggregations where with count", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) IN $param0 AS var2 diff --git a/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts index d3d6a8286d..2641fdc2db 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/bigint.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someBigInt) = $param0 AS var2 } @@ -94,8 +93,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someBigInt) > $param0 AS var2 } @@ -128,8 +126,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someBigInt) >= $param0 AS var2 } @@ -162,8 +159,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someBigInt) < $param0 AS var2 } @@ -196,8 +192,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someBigInt) <= $param0 AS var2 } @@ -230,8 +225,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someBigInt) = $param0 AS var2 } @@ -264,8 +258,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someBigInt) > $param0 AS var2 } @@ -298,8 +291,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someBigInt) >= $param0 AS var2 } @@ -332,8 +324,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someBigInt) < $param0 AS var2 } @@ -366,8 +357,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someBigInt) <= $param0 AS var2 } @@ -400,8 +390,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someBigInt) = $param0 AS var2 } @@ -434,8 +423,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someBigInt) > $param0 AS var2 } @@ -468,8 +456,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someBigInt) >= $param0 AS var2 } @@ -502,8 +489,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someBigInt) < $param0 AS var2 } @@ -536,8 +522,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someBigInt) <= $param0 AS var2 } @@ -570,8 +555,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someBigInt) = $param0 AS var2 } @@ -604,8 +588,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someBigInt) > $param0 AS var2 } @@ -638,8 +621,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someBigInt) >= $param0 AS var2 } @@ -672,8 +654,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someBigInt) < $param0 AS var2 } @@ -706,8 +687,7 @@ describe("Cypher Aggregations where edge with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someBigInt) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts index b272aad9c3..8cefb4478b 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/datetime.test.ts @@ -62,8 +62,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someDateTime) = datetime($param0) AS var2 } @@ -95,8 +94,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someDateTime) > datetime($param0) AS var2 } @@ -128,8 +126,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someDateTime) >= datetime($param0) AS var2 } @@ -161,8 +158,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someDateTime) < datetime($param0) AS var2 } @@ -194,8 +190,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someDateTime) <= datetime($param0) AS var2 } @@ -227,8 +222,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someDateTime) = datetime($param0) AS var2 } @@ -260,8 +254,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someDateTime) > datetime($param0) AS var2 } @@ -293,8 +286,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someDateTime) >= datetime($param0) AS var2 } @@ -326,8 +318,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someDateTime) < datetime($param0) AS var2 } @@ -359,8 +350,7 @@ describe("Cypher Aggregations where edge with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someDateTime) <= datetime($param0) AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts index 3971db945c..ef5155a7a5 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/duration.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this0.someDuration)) = (datetime() + $param0) AS var2 } @@ -102,8 +101,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this0.someDuration)) > (datetime() + $param0) AS var2 } @@ -144,8 +142,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this0.someDuration)) >= (datetime() + $param0) AS var2 } @@ -186,8 +183,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this0.someDuration)) < (datetime() + $param0) AS var2 } @@ -228,8 +224,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this0.someDuration)) <= (datetime() + $param0) AS var2 } @@ -270,8 +265,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this0.someDuration)) = (datetime() + $param0) AS var2 } @@ -312,8 +306,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this0.someDuration)) > (datetime() + $param0) AS var2 } @@ -354,8 +347,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this0.someDuration)) >= (datetime() + $param0) AS var2 } @@ -396,8 +388,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this0.someDuration)) < (datetime() + $param0) AS var2 } @@ -438,8 +429,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this0.someDuration)) <= (datetime() + $param0) AS var2 } @@ -480,8 +470,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this0.someDuration)) = (datetime() + $param0) AS var2 } @@ -522,8 +511,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this0.someDuration)) > (datetime() + $param0) AS var2 } @@ -564,8 +552,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this0.someDuration)) >= (datetime() + $param0) AS var2 } @@ -606,8 +593,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this0.someDuration)) < (datetime() + $param0) AS var2 } @@ -648,8 +634,7 @@ describe("Cypher Aggregations where edge with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this0.someDuration)) <= (datetime() + $param0) AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts index fdcfef8e8c..f985c35f15 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/float.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someFloat) = $param0 AS var2 } @@ -91,8 +90,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someFloat) > $param0 AS var2 } @@ -122,8 +120,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someFloat) >= $param0 AS var2 } @@ -153,8 +150,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someFloat) < $param0 AS var2 } @@ -184,8 +180,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someFloat) <= $param0 AS var2 } @@ -215,8 +210,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someFloat) = $param0 AS var2 } @@ -246,8 +240,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someFloat) > $param0 AS var2 } @@ -277,8 +270,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someFloat) >= $param0 AS var2 } @@ -308,8 +300,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someFloat) < $param0 AS var2 } @@ -339,8 +330,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someFloat) <= $param0 AS var2 } @@ -370,8 +360,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someFloat) = $param0 AS var2 } @@ -401,8 +390,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someFloat) > $param0 AS var2 } @@ -432,8 +420,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someFloat) >= $param0 AS var2 } @@ -463,8 +450,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someFloat) < $param0 AS var2 } @@ -494,8 +480,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someFloat) <= $param0 AS var2 } @@ -525,8 +510,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someFloat) = $param0 AS var2 } @@ -556,8 +540,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someFloat) > $param0 AS var2 } @@ -587,8 +570,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someFloat) >= $param0 AS var2 } @@ -618,8 +600,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someFloat) < $param0 AS var2 } @@ -649,8 +630,7 @@ describe("Cypher Aggregations where edge with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someFloat) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts index c90fa3a7a7..833903348f 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/int.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someInt) = $param0 AS var2 } @@ -91,8 +90,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someInt) > $param0 AS var2 } @@ -122,8 +120,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someInt) >= $param0 AS var2 } @@ -153,8 +150,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someInt) < $param0 AS var2 } @@ -184,8 +180,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this0.someInt) <= $param0 AS var2 } @@ -215,8 +210,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someInt) = $param0 AS var2 } @@ -249,8 +243,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someInt) > $param0 AS var2 } @@ -283,8 +276,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someInt) >= $param0 AS var2 } @@ -317,8 +309,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someInt) < $param0 AS var2 } @@ -351,8 +342,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this0.someInt) <= $param0 AS var2 } @@ -385,8 +375,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someInt) = $param0 AS var2 } @@ -419,8 +408,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someInt) > $param0 AS var2 } @@ -453,8 +441,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someInt) >= $param0 AS var2 } @@ -487,8 +474,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someInt) < $param0 AS var2 } @@ -521,8 +507,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someInt) <= $param0 AS var2 } @@ -555,8 +540,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someInt) = $param0 AS var2 } @@ -589,8 +573,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someInt) > $param0 AS var2 } @@ -623,8 +606,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someInt) >= $param0 AS var2 } @@ -657,8 +639,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someInt) < $param0 AS var2 } @@ -691,8 +672,7 @@ describe("Cypher Aggregations where edge with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someInt) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/interface-relationship.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/interface-relationship.test.ts index 7a3e3d11c3..0a6c9d5d74 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/interface-relationship.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/interface-relationship.test.ts @@ -81,8 +81,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1) WHERE (this1:Movie OR this1:Series) RETURN count(this1) < $param0 AS var2 @@ -121,30 +120,28 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:Actor) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:ACTED_IN]->(this2) WHERE (this2:Movie OR this2:Series) RETURN avg(size(this1.role)) < $param0 AS var3 } WITH * WHERE var3 = true - WITH this0 { .name, __resolveType: \\"Actor\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { .name, __resolveType: \\"Actor\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this4:Cameo) - CALL { - WITH this4 + CALL (this4) { MATCH (this4)-[this5:APPEARED_IN]->(this6) WHERE (this6:Movie OR this6:Series) RETURN min(size(this5.role)) < $param1 AS var7 } WITH * WHERE var7 = true - WITH this4 { .name, __resolveType: \\"Cameo\\", __id: id(this4) } AS this4 - RETURN this4 AS this + WITH this4 { .name, __resolveType: \\"Cameo\\", __id: id(this4) } AS this + RETURN this } WITH this RETURN this AS this" @@ -176,36 +173,33 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:Actor) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:ACTED_IN]->(this2) WHERE (this2:Movie OR this2:Series) RETURN count(this2) <= $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this4:ACTED_IN]->(this5) WHERE (this5:Movie OR this5:Series) RETURN avg(size(this4.role)) < $param1 AS var6 } WITH * WHERE (var3 = true AND var6 = true) - WITH this0 { .name, __resolveType: \\"Actor\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { .name, __resolveType: \\"Actor\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this7:Cameo) - CALL { - WITH this7 + CALL (this7) { MATCH (this7)-[this8:APPEARED_IN]->(this9) WHERE (this9:Movie OR this9:Series) RETURN count(this9) <= $param2 AS var10 } WITH * WHERE var10 = true - WITH this7 { .name, __resolveType: \\"Cameo\\", __id: id(this7) } AS this7 - RETURN this7 AS this + WITH this7 { .name, __resolveType: \\"Cameo\\", __id: id(this7) } AS this + RETURN this } WITH this RETURN this AS this" diff --git a/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts index 1ff2276856..82317c231d 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/localdatetime.test.ts @@ -62,8 +62,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalDateTime) = $param0 AS var2 } @@ -103,8 +102,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalDateTime) > $param0 AS var2 } @@ -144,8 +142,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalDateTime) >= $param0 AS var2 } @@ -185,8 +182,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalDateTime) < $param0 AS var2 } @@ -226,8 +222,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalDateTime) <= $param0 AS var2 } @@ -267,8 +262,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalDateTime) = $param0 AS var2 } @@ -308,8 +302,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalDateTime) > $param0 AS var2 } @@ -349,8 +342,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalDateTime) >= $param0 AS var2 } @@ -390,8 +382,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalDateTime) < $param0 AS var2 } @@ -431,8 +422,7 @@ describe("Cypher Aggregations where edge with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalDateTime) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts index 68ff7561d7..5774f1bb3d 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/localtime.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalTime) = $param0 AS var2 } @@ -96,8 +95,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalTime) > $param0 AS var2 } @@ -132,8 +130,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalTime) >= $param0 AS var2 } @@ -168,8 +165,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalTime) < $param0 AS var2 } @@ -204,8 +200,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someLocalTime) <= $param0 AS var2 } @@ -240,8 +235,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalTime) = $param0 AS var2 } @@ -276,8 +270,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalTime) > $param0 AS var2 } @@ -312,8 +305,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalTime) >= $param0 AS var2 } @@ -348,8 +340,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalTime) < $param0 AS var2 } @@ -384,8 +375,7 @@ describe("Cypher Aggregations where edge with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someLocalTime) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts index 241cfc90bc..767dd88e1a 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/string.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this0.someString)) = $param0 AS var2 } @@ -94,8 +93,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this0.someString)) > $param0 AS var2 } @@ -128,8 +126,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this0.someString)) >= $param0 AS var2 } @@ -162,8 +159,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this0.someString)) < $param0 AS var2 } @@ -196,8 +192,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this0.someString)) <= $param0 AS var2 } @@ -230,8 +225,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this0.someString)) = $param0 AS var2 } @@ -264,8 +258,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this0.someString)) > $param0 AS var2 } @@ -298,8 +291,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this0.someString)) >= $param0 AS var2 } @@ -332,8 +324,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this0.someString)) < $param0 AS var2 } @@ -366,8 +357,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this0.someString)) <= $param0 AS var2 } @@ -400,8 +390,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this0.someString)) = $param0 AS var2 } @@ -431,8 +420,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this0.someString)) > $param0 AS var2 } @@ -462,8 +450,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this0.someString)) >= $param0 AS var2 } @@ -493,8 +480,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this0.someString)) < $param0 AS var2 } @@ -524,8 +510,7 @@ describe("Cypher Aggregations where edge with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this0.someString)) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts b/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts index 6314488e88..09008b3c0f 100644 --- a/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/edge/time.test.ts @@ -60,8 +60,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someTime) = time($param0) AS var2 } @@ -91,8 +90,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someTime) > time($param0) AS var2 } @@ -122,8 +120,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someTime) >= time($param0) AS var2 } @@ -153,8 +150,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someTime) < time($param0) AS var2 } @@ -184,8 +180,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this0.someTime) <= time($param0) AS var2 } @@ -215,8 +210,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someTime) = time($param0) AS var2 } @@ -246,8 +240,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someTime) > time($param0) AS var2 } @@ -277,8 +270,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someTime) >= time($param0) AS var2 } @@ -308,8 +300,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someTime) < time($param0) AS var2 } @@ -339,8 +330,7 @@ describe("Cypher Aggregations where edge with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this0.someTime) <= time($param0) AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/logical.test.ts b/packages/graphql/tests/tck/aggregations/where/logical.test.ts index 0a3729ed68..88531caf7c 100644 --- a/packages/graphql/tests/tck/aggregations/where/logical.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/logical.test.ts @@ -61,14 +61,12 @@ describe("Cypher Aggregations where with logical AND plus OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) WITH DISTINCT this4 RETURN count(this4) < $param1 AS var5 @@ -112,14 +110,12 @@ describe("Cypher Aggregations where with logical AND plus OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) WITH DISTINCT this4 RETURN count(this4) < $param1 AS var5 @@ -157,8 +153,7 @@ describe("Cypher Aggregations where with logical AND plus OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 @@ -201,26 +196,22 @@ describe("Cypher Aggregations where with logical AND plus OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) WITH DISTINCT this4 RETURN count(this4) < $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) WITH DISTINCT this7 RETURN count(this7) > $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) WITH DISTINCT this10 RETURN count(this10) < $param3 AS var11 @@ -279,32 +270,27 @@ describe("Cypher Aggregations where with logical AND plus OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) WITH DISTINCT this4 RETURN count(this4) < $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) WITH DISTINCT this7 RETURN count(this7) > $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) WITH DISTINCT this10 RETURN count(this10) < $param3 AS var11 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this12:LIKES]-(this13:User) WITH DISTINCT this13 RETURN count(this13) < $param4 AS var14 diff --git a/packages/graphql/tests/tck/aggregations/where/node/bigint.test.ts b/packages/graphql/tests/tck/aggregations/where/node/bigint.test.ts index 7e0c773bb8..2f2853e8a7 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/bigint.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/bigint.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someBigInt) = $param0 AS var2 } @@ -90,8 +89,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someBigInt) > $param0 AS var2 } @@ -124,8 +122,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someBigInt) >= $param0 AS var2 } @@ -158,8 +155,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someBigInt) < $param0 AS var2 } @@ -192,8 +188,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someBigInt) <= $param0 AS var2 } @@ -226,8 +221,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someBigInt) = $param0 AS var2 } @@ -260,8 +254,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someBigInt) > $param0 AS var2 } @@ -294,8 +287,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someBigInt) >= $param0 AS var2 } @@ -328,8 +320,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someBigInt) < $param0 AS var2 } @@ -362,8 +353,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someBigInt) <= $param0 AS var2 } @@ -396,8 +386,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someBigInt) = $param0 AS var2 } @@ -430,8 +419,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someBigInt) > $param0 AS var2 } @@ -464,8 +452,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someBigInt) >= $param0 AS var2 } @@ -498,8 +485,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someBigInt) < $param0 AS var2 } @@ -532,8 +518,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someBigInt) <= $param0 AS var2 } @@ -566,8 +551,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someBigInt) = $param0 AS var2 } @@ -600,8 +584,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someBigInt) > $param0 AS var2 } @@ -634,8 +617,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someBigInt) >= $param0 AS var2 } @@ -668,8 +650,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someBigInt) < $param0 AS var2 } @@ -702,8 +683,7 @@ describe("Cypher Aggregations where node with BigInt", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someBigInt) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/datetime.test.ts b/packages/graphql/tests/tck/aggregations/where/node/datetime.test.ts index 80acc84aa7..2aaa1e0aba 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/datetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/datetime.test.ts @@ -58,8 +58,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someDateTime) = datetime($param0) AS var2 } @@ -91,8 +90,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someDateTime) > datetime($param0) AS var2 } @@ -124,8 +122,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someDateTime) >= datetime($param0) AS var2 } @@ -157,8 +154,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someDateTime) < datetime($param0) AS var2 } @@ -190,8 +186,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someDateTime) <= datetime($param0) AS var2 } @@ -223,8 +218,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someDateTime) = datetime($param0) AS var2 } @@ -256,8 +250,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someDateTime) > datetime($param0) AS var2 } @@ -289,8 +282,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someDateTime) >= datetime($param0) AS var2 } @@ -322,8 +314,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someDateTime) < datetime($param0) AS var2 } @@ -355,8 +346,7 @@ describe("Cypher Aggregations where node with DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someDateTime) <= datetime($param0) AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/duration.test.ts b/packages/graphql/tests/tck/aggregations/where/node/duration.test.ts index bec8fb66e8..c2ba405b92 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/duration.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/duration.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this1.someDuration)) = (datetime() + $param0) AS var2 } @@ -98,8 +97,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this1.someDuration)) > (datetime() + $param0) AS var2 } @@ -140,8 +138,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this1.someDuration)) >= (datetime() + $param0) AS var2 } @@ -182,8 +179,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this1.someDuration)) < (datetime() + $param0) AS var2 } @@ -224,8 +220,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + avg(this1.someDuration)) <= (datetime() + $param0) AS var2 } @@ -266,8 +261,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this1.someDuration)) = (datetime() + $param0) AS var2 } @@ -308,8 +302,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this1.someDuration)) > (datetime() + $param0) AS var2 } @@ -350,8 +343,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this1.someDuration)) >= (datetime() + $param0) AS var2 } @@ -392,8 +384,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this1.someDuration)) < (datetime() + $param0) AS var2 } @@ -434,8 +425,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + min(this1.someDuration)) <= (datetime() + $param0) AS var2 } @@ -476,8 +466,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this1.someDuration)) = (datetime() + $param0) AS var2 } @@ -518,8 +507,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this1.someDuration)) > (datetime() + $param0) AS var2 } @@ -560,8 +548,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this1.someDuration)) >= (datetime() + $param0) AS var2 } @@ -602,8 +589,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this1.someDuration)) < (datetime() + $param0) AS var2 } @@ -644,8 +630,7 @@ describe("Cypher Aggregations where node with Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN (datetime() + max(this1.someDuration)) <= (datetime() + $param0) AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/float.test.ts b/packages/graphql/tests/tck/aggregations/where/node/float.test.ts index 61fc49dc78..2103126094 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/float.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/float.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someFloat) = $param0 AS var2 } @@ -87,8 +86,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someFloat) > $param0 AS var2 } @@ -118,8 +116,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someFloat) >= $param0 AS var2 } @@ -149,8 +146,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someFloat) < $param0 AS var2 } @@ -180,8 +176,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someFloat) <= $param0 AS var2 } @@ -211,8 +206,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someFloat) = $param0 AS var2 } @@ -242,8 +236,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someFloat) > $param0 AS var2 } @@ -273,8 +266,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someFloat) >= $param0 AS var2 } @@ -304,8 +296,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someFloat) < $param0 AS var2 } @@ -335,8 +326,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someFloat) <= $param0 AS var2 } @@ -366,8 +356,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someFloat) = $param0 AS var2 } @@ -397,8 +386,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someFloat) > $param0 AS var2 } @@ -428,8 +416,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someFloat) >= $param0 AS var2 } @@ -459,8 +446,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someFloat) < $param0 AS var2 } @@ -490,8 +476,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someFloat) <= $param0 AS var2 } @@ -521,8 +506,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someFloat) = $param0 AS var2 } @@ -552,8 +536,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someFloat) > $param0 AS var2 } @@ -583,8 +566,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someFloat) >= $param0 AS var2 } @@ -614,8 +596,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someFloat) < $param0 AS var2 } @@ -645,8 +626,7 @@ describe("Cypher Aggregations where node with Float", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someFloat) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/int.test.ts b/packages/graphql/tests/tck/aggregations/where/node/int.test.ts index 28358f6785..9785fd9d6f 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/int.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/int.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN avg(this1.someInt) = $param0 AS var2 @@ -88,8 +87,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN avg(this1.someInt) > $param0 AS var2 @@ -120,8 +118,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN avg(this1.someInt) >= $param0 AS var2 @@ -152,8 +149,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN avg(this1.someInt) < $param0 AS var2 @@ -184,8 +180,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN avg(this1.someInt) <= $param0 AS var2 @@ -216,8 +211,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN sum(this1.someInt) = $param0 AS var2 @@ -251,8 +245,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN sum(this1.someInt) > $param0 AS var2 @@ -286,8 +279,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN sum(this1.someInt) >= $param0 AS var2 @@ -321,8 +313,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN sum(this1.someInt) < $param0 AS var2 @@ -356,8 +347,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN sum(this1.someInt) <= $param0 AS var2 @@ -391,8 +381,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someInt) = $param0 AS var2 @@ -426,8 +415,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someInt) > $param0 AS var2 @@ -461,8 +449,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someInt) >= $param0 AS var2 @@ -496,8 +483,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someInt) < $param0 AS var2 @@ -531,8 +517,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someInt) <= $param0 AS var2 @@ -566,8 +551,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someInt) = $param0 AS var2 @@ -601,8 +585,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someInt) > $param0 AS var2 @@ -636,8 +619,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someInt) >= $param0 AS var2 @@ -671,8 +653,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someInt) < $param0 AS var2 @@ -706,8 +687,7 @@ describe("Cypher Aggregations where node with Int", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someInt) <= $param0 AS var2 diff --git a/packages/graphql/tests/tck/aggregations/where/node/localdatetime.test.ts b/packages/graphql/tests/tck/aggregations/where/node/localdatetime.test.ts index af98b44bc6..cd189f221f 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/localdatetime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/localdatetime.test.ts @@ -58,8 +58,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalDateTime) = $param0 AS var2 } @@ -99,8 +98,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalDateTime) > $param0 AS var2 } @@ -140,8 +138,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalDateTime) >= $param0 AS var2 } @@ -181,8 +178,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalDateTime) < $param0 AS var2 } @@ -222,8 +218,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalDateTime) <= $param0 AS var2 } @@ -263,8 +258,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalDateTime) = $param0 AS var2 } @@ -304,8 +298,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalDateTime) > $param0 AS var2 } @@ -345,8 +338,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalDateTime) >= $param0 AS var2 } @@ -386,8 +378,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalDateTime) < $param0 AS var2 } @@ -427,8 +418,7 @@ describe("Cypher Aggregations where node with LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalDateTime) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/localtime.test.ts b/packages/graphql/tests/tck/aggregations/where/node/localtime.test.ts index f8f023ab12..a5e75af227 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/localtime.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/localtime.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalTime) = $param0 AS var2 } @@ -92,8 +91,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalTime) > $param0 AS var2 } @@ -128,8 +126,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalTime) >= $param0 AS var2 } @@ -164,8 +161,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalTime) < $param0 AS var2 } @@ -200,8 +196,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someLocalTime) <= $param0 AS var2 } @@ -236,8 +231,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalTime) = $param0 AS var2 } @@ -272,8 +266,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalTime) > $param0 AS var2 } @@ -308,8 +301,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalTime) >= $param0 AS var2 } @@ -344,8 +336,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalTime) < $param0 AS var2 } @@ -380,8 +371,7 @@ describe("Cypher Aggregations where node with LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someLocalTime) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/aggregations/where/node/string.test.ts b/packages/graphql/tests/tck/aggregations/where/node/string.test.ts index a4cef0ccea..7e13632d1f 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/string.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/string.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this1.name)) = $param0 AS var2 } @@ -90,8 +89,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this1.name)) > $param0 AS var2 } @@ -124,8 +122,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this1.name)) >= $param0 AS var2 } @@ -158,8 +155,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this1.name)) < $param0 AS var2 } @@ -192,8 +188,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(size(this1.name)) <= $param0 AS var2 } @@ -226,8 +221,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this1.name)) = $param0 AS var2 } @@ -260,8 +254,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this1.name)) > $param0 AS var2 } @@ -294,8 +287,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this1.name)) >= $param0 AS var2 } @@ -328,8 +320,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this1.name)) < $param0 AS var2 } @@ -362,8 +353,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(size(this1.name)) <= $param0 AS var2 } @@ -396,8 +386,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this1.name)) = $param0 AS var2 } @@ -427,8 +416,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this1.name)) > $param0 AS var2 } @@ -458,8 +446,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this1.name)) >= $param0 AS var2 } @@ -489,8 +476,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this1.name)) < $param0 AS var2 } @@ -520,8 +506,7 @@ describe("Cypher Aggregations where node with String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(size(this1.name)) <= $param0 AS var2 } @@ -584,8 +569,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN min(size(this1.name)) = $param0 AS var2 @@ -619,8 +603,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN min(size(this1.name)) > $param0 AS var2 @@ -654,8 +637,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN min(size(this1.name)) >= $param0 AS var2 @@ -689,8 +671,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN min(size(this1.name)) < $param0 AS var2 @@ -724,8 +705,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN min(size(this1.name)) <= $param0 AS var2 @@ -759,8 +739,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN max(size(this1.name)) = $param0 AS var2 @@ -794,8 +773,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN max(size(this1.name)) > $param0 AS var2 @@ -829,8 +807,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN max(size(this1.name)) >= $param0 AS var2 @@ -864,8 +841,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN max(size(this1.name)) < $param0 AS var2 @@ -899,8 +875,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN max(size(this1.name)) <= $param0 AS var2 @@ -934,8 +909,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN avg(size(this1.name)) = $param0 AS var2 @@ -966,8 +940,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN avg(size(this1.name)) > $param0 AS var2 @@ -998,8 +971,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN avg(size(this1.name)) >= $param0 AS var2 @@ -1030,8 +1002,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN avg(size(this1.name)) < $param0 AS var2 @@ -1062,8 +1033,7 @@ describe("Cypher Aggregations where node with String interface relationships of expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1) WHERE (this1:User:Employee OR this1:Person) RETURN avg(size(this1.name)) <= $param0 AS var2 diff --git a/packages/graphql/tests/tck/aggregations/where/node/time.test.ts b/packages/graphql/tests/tck/aggregations/where/node/time.test.ts index b7f666ba13..f72f936f5d 100644 --- a/packages/graphql/tests/tck/aggregations/where/node/time.test.ts +++ b/packages/graphql/tests/tck/aggregations/where/node/time.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someTime) = time($param0) AS var2 @@ -88,8 +87,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someTime) > time($param0) AS var2 @@ -120,8 +118,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someTime) >= time($param0) AS var2 @@ -152,8 +149,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someTime) < time($param0) AS var2 @@ -184,8 +180,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN min(this1.someTime) <= time($param0) AS var2 @@ -216,8 +211,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someTime) = time($param0) AS var2 @@ -248,8 +242,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someTime) > time($param0) AS var2 @@ -280,8 +273,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someTime) >= time($param0) AS var2 @@ -312,8 +304,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someTime) < time($param0) AS var2 @@ -344,8 +335,7 @@ describe("Cypher Aggregations where node with Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) WITH DISTINCT this1 RETURN max(this1.someTime) <= time($param0) AS var2 diff --git a/packages/graphql/tests/tck/alias.test.ts b/packages/graphql/tests/tck/alias.test.ts index a425c7e015..b26e293d7c 100644 --- a/packages/graphql/tests/tck/alias.test.ts +++ b/packages/graphql/tests/tck/alias.test.ts @@ -72,10 +72,8 @@ describe("Cypher Alias", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN m @@ -84,8 +82,7 @@ describe("Cypher Alias", () => { WITH this0 { aliasCustomId: this0.id } AS this0 RETURN collect(this0) AS var1 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Actor) WITH DISTINCT this3 WITH this3 { aliasActorsName: this3.name } AS this3 diff --git a/packages/graphql/tests/tck/array-methods.test.ts b/packages/graphql/tests/tck/array-methods.test.ts index 01848b623e..dd8edc0629 100644 --- a/packages/graphql/tests/tck/array-methods.test.ts +++ b/packages/graphql/tests/tck/array-methods.test.ts @@ -498,27 +498,24 @@ describe("Arrays Methods", () => { MATCH (this:Actor) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) SET this_acted_in0_relationship.pay = this_acted_in0_relationship.pay + $updateActors.args.update.actedIn[0].update.edge.pay_PUSH RETURN count(*) AS update_this_actedIn0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .title } AS update_this1 RETURN collect(update_this1) AS update_var2 } - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this3:ACTED_IN]->(update_this4:Movie) WITH collect({ node: update_this4, relationship: update_this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this4, edge.relationship AS update_this3 RETURN collect({ properties: { pay: update_this3.pay, __resolveType: \\"ActedIn\\" }, node: { __id: id(update_this4), __resolveType: \\"Movie\\" } }) AS update_var5 @@ -602,27 +599,24 @@ describe("Arrays Methods", () => { MATCH (this:Actor) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) SET this_acted_in0_relationship.pay = this_acted_in0_relationship.pay[0..-$updateActors.args.update.actedIn[0].update.edge.pay_POP] RETURN count(*) AS update_this_actedIn0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .title } AS update_this1 RETURN collect(update_this1) AS update_var2 } - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this3:ACTED_IN]->(update_this4:Movie) WITH collect({ node: update_this4, relationship: update_this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this4, edge.relationship AS update_this3 RETURN collect({ properties: { pay: update_this3.pay, __resolveType: \\"ActedIn\\" }, node: { __id: id(update_this4), __resolveType: \\"Movie\\" } }) AS update_var5 diff --git a/packages/graphql/tests/tck/connections/alias.test.ts b/packages/graphql/tests/tck/connections/alias.test.ts index fc631596ab..7bc86604be 100644 --- a/packages/graphql/tests/tck/connections/alias.test.ts +++ b/packages/graphql/tests/tck/connections/alias.test.ts @@ -62,13 +62,11 @@ describe("Connections Alias", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { __id: id(this1), __resolveType: \\"Actor\\" } }) AS var2 @@ -116,28 +114,24 @@ describe("Connections Alias", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 } RETURN { edges: var2, totalCount: totalCount } AS var3 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param2 WITH collect({ node: this5, relationship: this4 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this5, edge.relationship AS this4 RETURN collect({ properties: { screenTime: this4.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this5.name, __resolveType: \\"Actor\\" } }) AS var6 diff --git a/packages/graphql/tests/tck/connections/filtering/composite.test.ts b/packages/graphql/tests/tck/connections/filtering/composite.test.ts index 7e0e2bc098..4ff1e3420c 100644 --- a/packages/graphql/tests/tck/connections/filtering/composite.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/composite.test.ts @@ -78,14 +78,12 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE ((this1.firstName = $param1 AND this1.lastName = $param2) AND (this0.screenTime > $param3 AND this0.screenTime < $param4)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 @@ -143,14 +141,12 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (NOT (this1.firstName = $param1 AND this1.lastName = $param2) AND NOT (this0.screenTime > $param3 AND this0.screenTime < $param4)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 @@ -210,14 +206,12 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE ((this1.firstName = $param1 AND this1.lastName = $param2) OR (this0.screenTime > $param3 AND this0.screenTime < $param4)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 @@ -279,14 +273,12 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT ((this1.firstName = $param1 AND this1.lastName = $param2) OR (this0.screenTime > $param3 AND this0.screenTime < $param4)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 @@ -357,14 +349,12 @@ describe("Cypher -> Connections -> Filtering -> Composite", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT (((this1.firstName = $param1 AND this1.lastName = $param2) OR (this0.screenTime > $param3 AND this0.screenTime < $param4)) AND (this1.firstName = $param5 AND this1.lastName = $param6)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/interface-relationships.test.ts b/packages/graphql/tests/tck/connections/filtering/interface-relationships.test.ts index c66405d5b1..53a16ca14a 100644 --- a/packages/graphql/tests/tck/connections/filtering/interface-relationships.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/interface-relationships.test.ts @@ -100,18 +100,17 @@ describe("interface relationships with aliased fields", () => { ELSE this1.title END = $param0 AND (this1:Movie OR this1:Series)) } - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:ACTED_IN]->(this3:Movie) - WITH this3 { .runtime, title: this3.movieTitle, __resolveType: \\"Movie\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { .runtime, title: this3.movieTitle, __resolveType: \\"Movie\\", __id: id(this3) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this5:ACTED_IN]->(this6:Series) - WITH this6 { .episodes, title: this6.seriesTitle, __resolveType: \\"Series\\", __id: id(this6) } AS this6 - RETURN this6 AS var4 + WITH this6 { .episodes, title: this6.seriesTitle, __resolveType: \\"Series\\", __id: id(this6) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 @@ -190,18 +189,17 @@ describe("interface relationships with aliased fields", () => { WHEN this0:Series THEN this0.seriesTitle ELSE this0.title END = $jwt.title) AND (this0:Movie OR this0:Series)) | 1]) > 0), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:ACTED_IN]->(this3:Movie) - WITH this3 { .runtime, title: this3.movieTitle, __resolveType: \\"Movie\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { .runtime, title: this3.movieTitle, __resolveType: \\"Movie\\", __id: id(this3) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this5:ACTED_IN]->(this6:Series) - WITH this6 { .episodes, title: this6.seriesTitle, __resolveType: \\"Series\\", __id: id(this6) } AS this6 - RETURN this6 AS var4 + WITH this6 { .episodes, title: this6.seriesTitle, __resolveType: \\"Series\\", __id: id(this6) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 diff --git a/packages/graphql/tests/tck/connections/filtering/node/and.test.ts b/packages/graphql/tests/tck/connections/filtering/node/and.test.ts index 128cba28c7..a743eaaf20 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/and.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/and.test.ts @@ -74,14 +74,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> AND", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (this1.firstName = $param0 AND this1.lastName = $param1) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 @@ -124,14 +122,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> AND", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT (this1.firstName = $param0) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts b/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts index 4e31d6a561..eabb798c1f 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/arrays.test.ts @@ -71,14 +71,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Arrays", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name IN $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -123,14 +121,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Arrays", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE $param0 IN this1.favouriteColours WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, favouriteColours: this1.favouriteColours, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts b/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts index 0c02b5aae4..f2d5aa9236 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/equality.test.ts @@ -70,14 +70,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Equality", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -118,14 +116,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Equality", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT (this1.name = $param0) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts b/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts index 2fe5beebb7..b7d56fb70a 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/numerical.test.ts @@ -72,14 +72,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Numerical", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.age < $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, age: this1.age, __resolveType: \\"Actor\\" } }) AS var2 @@ -124,14 +122,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Numerical", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.age <= $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, age: this1.age, __resolveType: \\"Actor\\" } }) AS var2 @@ -176,14 +172,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Numerical", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.age > $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, age: this1.age, __resolveType: \\"Actor\\" } }) AS var2 @@ -228,14 +222,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Numerical", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.age >= $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, age: this1.age, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/or.test.ts b/packages/graphql/tests/tck/connections/filtering/node/or.test.ts index ffdd522061..c37b9e379c 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/or.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/or.test.ts @@ -74,14 +74,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (this1.firstName = $param0 OR this1.lastName = $param1) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { firstName: this1.firstName, lastName: this1.lastName, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/points.test.ts b/packages/graphql/tests/tck/connections/filtering/node/points.test.ts index c3b2a72d37..469760b721 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/points.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/points.test.ts @@ -88,14 +88,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> Points", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE point.distance(this1.currentLocation, point($param0.point)) = $param0.distance WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, currentLocation: this1.currentLocation, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/node/relationship.test.ts b/packages/graphql/tests/tck/connections/filtering/node/relationship.test.ts index c9b226a23a..de0d912f10 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/relationship.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/relationship.test.ts @@ -63,8 +63,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE EXISTS { MATCH (this1)-[:ACTED_IN]->(this2:Movie) @@ -72,8 +71,7 @@ describe("Cypher -> Connections -> Filtering -> Node -> Relationship", () => { } WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var3 diff --git a/packages/graphql/tests/tck/connections/filtering/node/string.test.ts b/packages/graphql/tests/tck/connections/filtering/node/string.test.ts index 3b76c0769b..14cc91f7a5 100644 --- a/packages/graphql/tests/tck/connections/filtering/node/string.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/node/string.test.ts @@ -78,14 +78,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name CONTAINS $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -126,14 +124,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name STARTS WITH $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -174,14 +170,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name ENDS WITH $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -222,14 +216,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name =~ $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -270,14 +262,12 @@ describe("Cypher -> Connections -> Filtering -> Node -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE toLower(this1.name) CONTAINS toLower($param0) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts index 1e7369a0b3..9afacf31ee 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/and.test.ts @@ -74,14 +74,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> AND", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (this0.role ENDS WITH $param0 AND this0.screenTime < $param1) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -127,14 +125,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> AND", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT (this0.role ENDS WITH $param0) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts index 3836d7b1e3..03fecd0b1c 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/arrays.test.ts @@ -71,14 +71,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Arrays", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime IN $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -128,14 +126,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Arrays", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE $param0 IN this0.quotes WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts index 498e205ee4..dde79fe8bb 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/equality.test.ts @@ -70,14 +70,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Equality", () => expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime = $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -121,14 +119,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Equality", () => expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE NOT (this0.screenTime = $param0) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts index 7bd8d0ac49..b86f5a4015 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/numerical.test.ts @@ -70,14 +70,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Numerical", () = expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime < $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -121,14 +119,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Numerical", () = expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime <= $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -172,14 +168,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Numerical", () = expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime > $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -223,14 +217,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Numerical", () = expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.screenTime >= $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts index 847c897c68..fcd4298c69 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/or.test.ts @@ -74,14 +74,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> OR", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (this0.role ENDS WITH $param0 OR this0.screenTime < $param1) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts index 211930e4e8..3798196aa7 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/points.test.ts @@ -86,14 +86,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Points", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE point.distance(this0.location, point($param0.point)) = $param0.distance WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, location: this0.location, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts index 95492e1721..e96a4032ab 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/string.test.ts @@ -78,14 +78,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.role CONTAINS $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -126,14 +124,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.role STARTS WITH $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -174,14 +170,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.role ENDS WITH $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -222,14 +216,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> String", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this0.role =~ $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { role: this0.role, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts b/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts index 8a195874e2..3182ef652b 100644 --- a/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts +++ b/packages/graphql/tests/tck/connections/filtering/relationship/temporal.test.ts @@ -76,14 +76,12 @@ describe("Cypher -> Connections -> Filtering -> Relationship -> Temporal", () => expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE (this0.startDate > $param0 AND this0.endDateTime < datetime($param1)) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { startDate: this0.startDate, endDateTime: apoc.date.convertFormat(toString(this0.endDateTime), \\"iso_zoned_date_time\\", \\"iso_offset_date_time\\"), __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/connections/interfaces.test.ts b/packages/graphql/tests/tck/connections/interfaces.test.ts index d1b69b23a5..6b970596de 100644 --- a/packages/graphql/tests/tck/connections/interfaces.test.ts +++ b/packages/graphql/tests/tck/connections/interfaces.test.ts @@ -85,10 +85,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -142,10 +140,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -206,10 +202,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -278,10 +272,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -297,8 +289,7 @@ describe("Cypher -> Connections -> Interfaces", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.properties.screenTime ASC @@ -342,10 +333,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -361,8 +350,7 @@ describe("Cypher -> Connections -> Interfaces", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.node.title ASC @@ -405,10 +393,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -424,8 +410,7 @@ describe("Cypher -> Connections -> Interfaces", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.properties.screenTime ASC @@ -468,10 +453,8 @@ describe("Cypher -> Connections -> Interfaces", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -487,8 +470,7 @@ describe("Cypher -> Connections -> Interfaces", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.node.title ASC diff --git a/packages/graphql/tests/tck/connections/mixed-nesting.test.ts b/packages/graphql/tests/tck/connections/mixed-nesting.test.ts index ce6778c476..092a1f99a4 100644 --- a/packages/graphql/tests/tck/connections/mixed-nesting.test.ts +++ b/packages/graphql/tests/tck/connections/mixed-nesting.test.ts @@ -74,18 +74,15 @@ describe("Mixed nesting", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE NOT (this3.title = $param2) WITH DISTINCT this3 @@ -143,28 +140,23 @@ describe("Mixed nesting", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE NOT (this3.title = $param2) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) WHERE NOT (this5.name = $param3) WITH DISTINCT this5 @@ -220,19 +212,16 @@ describe("Mixed nesting", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE NOT (this3.title = $param2) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 RETURN collect({ properties: { screenTime: this2.screenTime, __resolveType: \\"ActedIn\\" }, node: { title: this3.title, __resolveType: \\"Movie\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/connections/projections/create.test.ts b/packages/graphql/tests/tck/connections/projections/create.test.ts index 48964693a0..82fd253109 100644 --- a/packages/graphql/tests/tck/connections/projections/create.test.ts +++ b/packages/graphql/tests/tck/connections/projections/create.test.ts @@ -72,20 +72,17 @@ describe("Cypher -> Connections -> Projections -> Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this2:ACTED_IN]-(create_this3:Actor) WITH collect({ node: create_this3, relationship: create_this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this3, edge.relationship AS create_this2 RETURN collect({ properties: { screenTime: create_this2.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this3.name, __resolveType: \\"Actor\\" } }) AS create_var4 @@ -132,20 +129,17 @@ describe("Cypher -> Connections -> Projections -> Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this2:ACTED_IN]-(create_this3:Actor) WITH collect({ node: create_this3, relationship: create_this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this3, edge.relationship AS create_this2 RETURN collect({ properties: { screenTime: create_this2.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this3.name, __resolveType: \\"Actor\\" } }) AS create_var4 @@ -195,21 +189,18 @@ describe("Cypher -> Connections -> Projections -> Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this2:ACTED_IN]-(create_this3:Actor) WHERE create_this3.name = $create_param1 WITH collect({ node: create_this3, relationship: create_this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this3, edge.relationship AS create_this2 RETURN collect({ properties: { screenTime: create_this2.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this3.name, __resolveType: \\"Actor\\" } }) AS create_var4 diff --git a/packages/graphql/tests/tck/connections/projections/projections.test.ts b/packages/graphql/tests/tck/connections/projections/projections.test.ts index e4237595d9..1da756e307 100644 --- a/packages/graphql/tests/tck/connections/projections/projections.test.ts +++ b/packages/graphql/tests/tck/connections/projections/projections.test.ts @@ -67,13 +67,11 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { __id: id(this1), __resolveType: \\"Actor\\" } }) AS var2 @@ -113,13 +111,11 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { __id: id(this1), __resolveType: \\"Actor\\" } }) AS var2 @@ -154,13 +150,11 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -201,10 +195,8 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Actor) WHERE this.name = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -255,10 +247,8 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Actor) WHERE this.name = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -309,13 +299,11 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -355,13 +343,11 @@ describe("Relay Cursor Connection projections", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * diff --git a/packages/graphql/tests/tck/connections/projections/update.test.ts b/packages/graphql/tests/tck/connections/projections/update.test.ts index 1ddea1d4a1..07dd32d7f6 100644 --- a/packages/graphql/tests/tck/connections/projections/update.test.ts +++ b/packages/graphql/tests/tck/connections/projections/update.test.ts @@ -74,13 +74,11 @@ describe("Cypher -> Connections -> Projections -> Update", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { - WITH this + CALL (this) { MATCH (this)<-[update_this0:ACTED_IN]-(update_this1:Actor) WITH collect({ node: update_this1, relationship: update_this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this1, edge.relationship AS update_this0 RETURN collect({ properties: { screenTime: update_this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: update_this1.name, __resolveType: \\"Actor\\" } }) AS update_var2 diff --git a/packages/graphql/tests/tck/connections/relationship-properties.test.ts b/packages/graphql/tests/tck/connections/relationship-properties.test.ts index b59444722b..e357fdc657 100644 --- a/packages/graphql/tests/tck/connections/relationship-properties.test.ts +++ b/packages/graphql/tests/tck/connections/relationship-properties.test.ts @@ -72,13 +72,11 @@ describe("Relationship Properties Cypher", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -120,14 +118,12 @@ describe("Relationship Properties Cypher", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { screenTime: this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -170,13 +166,11 @@ describe("Relationship Properties Cypher", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -218,13 +212,11 @@ describe("Relationship Properties Cypher", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -261,13 +253,11 @@ describe("Relationship Properties Cypher", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -317,22 +307,18 @@ describe("Relationship Properties Cypher", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 RETURN collect({ properties: { screenTime: this2.screenTime, __resolveType: \\"ActedIn\\" }, node: { title: this3.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -398,31 +384,25 @@ describe("Relationship Properties Cypher", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) WITH collect({ node: this5, relationship: this4 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this5, edge.relationship AS this4 RETURN collect({ properties: { screenTime: this4.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: this5.name, __resolveType: \\"Actor\\" } }) AS var6 diff --git a/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts index 59edbcd45f..9278d0d0f6 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/connect.test.ts @@ -71,18 +71,16 @@ describe("Relationship Properties Connect Cypher", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actors_connect0_node:Actor) - CALL { - WITH * + CALL(*) { WITH collect(this0_actors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actors_connect0_node CREATE (this0)<-[this0_actors_connect0_relationship:ACTED_IN]-(this0_actors_connect0_node) @@ -94,15 +92,12 @@ describe("Relationship Properties Connect Cypher", () => { } RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ACTED_IN]-(create_this1:Actor) WITH collect({ node: create_this1, relationship: create_this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this1, edge.relationship AS create_this0 RETURN collect({ properties: { screenTime: create_this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this1.name, __resolveType: \\"Actor\\" } }) AS create_var2 @@ -160,19 +155,17 @@ describe("Relationship Properties Connect Cypher", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actors_connect0_node:Actor) WHERE this0_actors_connect0_node.name = $this0_actors_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_actors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actors_connect0_node CREATE (this0)<-[this0_actors_connect0_relationship:ACTED_IN]-(this0_actors_connect0_node) @@ -184,15 +177,12 @@ describe("Relationship Properties Connect Cypher", () => { } RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ACTED_IN]-(create_this1:Actor) WITH collect({ node: create_this1, relationship: create_this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this1, edge.relationship AS create_this0 RETURN collect({ properties: { screenTime: create_this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this1.name, __resolveType: \\"Actor\\" } }) AS create_var2 @@ -248,14 +238,12 @@ describe("Relationship Properties Connect Cypher", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect0_node:Actor) - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect0_node CREATE (this)<-[this_actors0_connect0_relationship:ACTED_IN]-(this_actors0_connect0_node) @@ -266,13 +254,11 @@ describe("Relationship Properties Connect Cypher", () => { RETURN count(*) AS connect_this_actors0_connect_Actor0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)<-[update_this0:ACTED_IN]-(update_this1:Actor) WITH collect({ node: update_this1, relationship: update_this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this1, edge.relationship AS update_this0 RETURN collect({ properties: { screenTime: update_this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: update_this1.name, __resolveType: \\"Actor\\" } }) AS update_var2 @@ -329,15 +315,13 @@ describe("Relationship Properties Connect Cypher", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect0_node:Actor) WHERE this_actors0_connect0_node.name = $this_actors0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect0_node CREATE (this)<-[this_actors0_connect0_relationship:ACTED_IN]-(this_actors0_connect0_node) @@ -348,13 +332,11 @@ describe("Relationship Properties Connect Cypher", () => { RETURN count(*) AS connect_this_actors0_connect_Actor0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)<-[update_this0:ACTED_IN]-(update_this1:Actor) WITH collect({ node: update_this1, relationship: update_this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this1, edge.relationship AS update_this0 RETURN collect({ properties: { screenTime: update_this0.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: update_this1.name, __resolveType: \\"Actor\\" } }) AS update_var2 diff --git a/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts index a20364e245..229e595af4 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/create.test.ts @@ -79,14 +79,12 @@ describe("Relationship Properties Create Cypher", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -98,13 +96,11 @@ describe("Relationship Properties Create Cypher", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH collect({ node: create_this7, relationship: create_this6 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this7, edge.relationship AS create_this6 RETURN collect({ properties: { screenTime: create_this6.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this7.name, __resolveType: \\"Actor\\" } }) AS create_var8 diff --git a/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts b/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts index 65e0479ff3..2c60a0bf8a 100644 --- a/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts +++ b/packages/graphql/tests/tck/connections/relationship_properties/update.test.ts @@ -71,7 +71,7 @@ describe("Cypher -> Connections -> Relationship Properties -> Update", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 @@ -146,7 +146,7 @@ describe("Cypher -> Connections -> Relationship Properties -> Update", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 diff --git a/packages/graphql/tests/tck/connections/sort.test.ts b/packages/graphql/tests/tck/connections/sort.test.ts index 0258b4d91a..9c65ba76a3 100644 --- a/packages/graphql/tests/tck/connections/sort.test.ts +++ b/packages/graphql/tests/tck/connections/sort.test.ts @@ -79,20 +79,17 @@ describe("Relationship Properties Cypher", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * ORDER BY this0.title ASC LIMIT $param0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { name: this2.name, __resolveType: \\"Actor\\" } }) AS var3 @@ -141,14 +138,11 @@ describe("Relationship Properties Cypher", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } @@ -158,13 +152,11 @@ describe("Relationship Properties Cypher", () => { WITH * ORDER BY this0.title DESC, var2 ASC LIMIT $param0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this3:ACTED_IN]-(this4:Actor) WITH collect({ node: this4, relationship: this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this4, edge.relationship AS this3 RETURN collect({ node: { name: this4.name, __resolveType: \\"Actor\\" } }) AS var5 diff --git a/packages/graphql/tests/tck/connections/top-level-interfaces.test.ts b/packages/graphql/tests/tck/connections/top-level-interfaces.test.ts index ad2ab7e387..29d5956871 100644 --- a/packages/graphql/tests/tck/connections/top-level-interfaces.test.ts +++ b/packages/graphql/tests/tck/connections/top-level-interfaces.test.ts @@ -79,7 +79,7 @@ describe("Top level interface connections", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL () { CALL { MATCH (this0:Movie) WHERE this0.title = $param0 @@ -125,7 +125,7 @@ describe("Top level interface connections", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL () { CALL { MATCH (this0:Movie) WHERE this0.title = $param0 @@ -141,8 +141,7 @@ describe("Top level interface connections", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge LIMIT $param2 diff --git a/packages/graphql/tests/tck/connections/unions.test.ts b/packages/graphql/tests/tck/connections/unions.test.ts index b337cdfb5b..796ff08184 100644 --- a/packages/graphql/tests/tck/connections/unions.test.ts +++ b/packages/graphql/tests/tck/connections/unions.test.ts @@ -82,10 +82,8 @@ describe("Cypher -> Connections -> Unions", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:WROTE]->(this1:Book) @@ -143,10 +141,8 @@ describe("Cypher -> Connections -> Unions", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:WROTE]->(this1:Book) @@ -208,10 +204,8 @@ describe("Cypher -> Connections -> Unions", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:WROTE]->(this1:Book) @@ -282,10 +276,8 @@ describe("Cypher -> Connections -> Unions", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:WROTE]->(this1:Book) @@ -353,10 +345,8 @@ describe("Cypher -> Connections -> Unions", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:WROTE]->(this1:Book) @@ -372,8 +362,7 @@ describe("Cypher -> Connections -> Unions", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.properties.words ASC diff --git a/packages/graphql/tests/tck/deprecated/aggregations/where/node/int-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/aggregations/where/node/int-deprecated.test.ts index 7a2913ce85..2bce95b29c 100644 --- a/packages/graphql/tests/tck/deprecated/aggregations/where/node/int-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/aggregations/where/node/int-deprecated.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someInt) = $param0 AS var2 } @@ -87,8 +86,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someInt) > $param0 AS var2 } @@ -118,8 +116,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someInt) >= $param0 AS var2 } @@ -149,8 +146,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someInt) < $param0 AS var2 } @@ -180,8 +176,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN avg(this1.someInt) <= $param0 AS var2 } @@ -211,8 +206,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someInt) = $param0 AS var2 } @@ -245,8 +239,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someInt) > $param0 AS var2 } @@ -279,8 +272,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someInt) >= $param0 AS var2 } @@ -313,8 +305,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someInt) < $param0 AS var2 } @@ -347,8 +338,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN sum(this1.someInt) <= $param0 AS var2 } @@ -381,8 +371,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someInt) = $param0 AS var2 } @@ -415,8 +404,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someInt) > $param0 AS var2 } @@ -449,8 +437,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someInt) >= $param0 AS var2 } @@ -483,8 +470,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someInt) < $param0 AS var2 } @@ -517,8 +503,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someInt) <= $param0 AS var2 } @@ -551,8 +536,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someInt) = $param0 AS var2 } @@ -585,8 +569,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someInt) > $param0 AS var2 } @@ -619,8 +602,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someInt) >= $param0 AS var2 } @@ -653,8 +635,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someInt) < $param0 AS var2 } @@ -687,8 +668,7 @@ describe("Cypher Aggregations where node with Int - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someInt) <= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/deprecated/aggregations/where/node/time-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/aggregations/where/node/time-deprecated.test.ts index 4259220c6e..ca4375b603 100644 --- a/packages/graphql/tests/tck/deprecated/aggregations/where/node/time-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/aggregations/where/node/time-deprecated.test.ts @@ -56,8 +56,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someTime) = time($param0) AS var2 } @@ -87,8 +86,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someTime) > time($param0) AS var2 } @@ -118,8 +116,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someTime) >= time($param0) AS var2 } @@ -149,8 +146,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someTime) < time($param0) AS var2 } @@ -180,8 +176,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN min(this1.someTime) <= time($param0) AS var2 } @@ -211,8 +206,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someTime) = time($param0) AS var2 } @@ -242,8 +236,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someTime) > time($param0) AS var2 } @@ -273,8 +266,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someTime) >= time($param0) AS var2 } @@ -304,8 +296,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someTime) < time($param0) AS var2 } @@ -335,8 +326,7 @@ describe("Cypher Aggregations where node with Time - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN max(this1.someTime) <= time($param0) AS var2 } diff --git a/packages/graphql/tests/tck/deprecated/cypher-sort-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/cypher-sort-deprecated.test.ts index 42fe975db8..5fd2069479 100644 --- a/packages/graphql/tests/tck/deprecated/cypher-sort-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/cypher-sort-deprecated.test.ts @@ -177,10 +177,8 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -210,10 +208,8 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -241,10 +237,8 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -344,8 +338,7 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -374,8 +367,7 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -405,14 +397,11 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (this)<-[:HAS_GENRE]-(movie:Movie) RETURN count(DISTINCT movie) as result @@ -463,14 +452,11 @@ describe("Cypher sort deprecated", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } @@ -480,19 +466,15 @@ describe("Cypher sort deprecated", () => { WITH * ORDER BY this0.title DESC, var2 ASC LIMIT $param0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this3:ACTED_IN]-(this4:Actor) WITH collect({ node: this4, relationship: this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this4, edge.relationship AS this3 - CALL { - WITH this4 - CALL { - WITH this4 + CALL (this4) { + CALL (this4) { WITH this4 AS this MATCH (this)-[r:ACTED_IN]->(:Movie) RETURN sum(r.screenTime) as sum @@ -552,19 +534,15 @@ describe("Cypher sort deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } @@ -574,19 +552,15 @@ describe("Cypher sort deprecated", () => { WITH * ORDER BY this1.title DESC, var3 ASC LIMIT $param0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this4:ACTED_IN]-(this5:Actor) WITH collect({ node: this5, relationship: this4 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this5, edge.relationship AS this4 - CALL { - WITH this5 - CALL { - WITH this5 + CALL (this5) { + CALL (this5) { WITH this5 AS this MATCH (this)-[r:ACTED_IN]->(:Movie) RETURN sum(r.screenTime) as sum diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/count-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/count-deprecated.test.ts index e89b86cda4..dee1d48c4d 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/count-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/count-deprecated.test.ts @@ -55,8 +55,7 @@ describe("Cypher Aggregations where with count, deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) = $param0 AS var2 } @@ -89,8 +88,7 @@ describe("Cypher Aggregations where with count, deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) < $param0 AS var2 } @@ -123,8 +121,7 @@ describe("Cypher Aggregations where with count, deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) <= $param0 AS var2 } @@ -157,8 +154,7 @@ describe("Cypher Aggregations where with count, deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } @@ -191,8 +187,7 @@ describe("Cypher Aggregations where with count, deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) >= $param0 AS var2 } diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-list-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-list-deprecated.test.ts index a27a6e3b1b..0ea8f92723 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-list-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-list-deprecated.test.ts @@ -52,10 +52,8 @@ describe("cypher directive filtering - Lists - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN ['a', 'b', 'c'] as list } diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-one-to-one-relationship-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-one-to-one-relationship-deprecated.test.ts index f1f3bb2e6b..e18970f9b6 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-one-to-one-relationship-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-one-to-one-relationship-deprecated.test.ts @@ -67,10 +67,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:ACTED_IN]->(actor:Actor) RETURN actor @@ -136,10 +134,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:ACTED_IN]->(actor:Actor) RETURN actor @@ -214,10 +210,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -227,10 +221,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.name = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -294,10 +286,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -365,10 +355,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -452,10 +440,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -465,19 +451,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -486,10 +468,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -576,10 +556,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -589,19 +567,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -610,10 +584,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -699,10 +671,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -712,19 +682,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -733,10 +699,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -822,10 +786,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -835,19 +797,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -856,10 +814,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -946,10 +902,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -959,19 +913,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -980,10 +930,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1070,10 +1018,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1083,19 +1029,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1104,10 +1046,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1193,10 +1133,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1206,19 +1144,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1227,10 +1161,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1316,10 +1248,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1329,19 +1259,15 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1350,10 +1276,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1442,10 +1366,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1455,27 +1377,21 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this3:ACTED_IN]-(this4:Person) WITH DISTINCT this4 - CALL { - WITH this4 + CALL (this4) { MATCH (this4)-[this5:ACTED_IN]->(this6:Movie) WITH DISTINCT this6 - CALL { - WITH this6 - CALL { - WITH this6 + CALL (this6) { + CALL (this6) { WITH this6 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1490,10 +1406,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () WITH this4 { .name, movies: var9 } AS this4 RETURN collect(this4) AS var10 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1569,10 +1483,8 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1582,13 +1494,11 @@ describe("cypher directive filtering - One To One Relationship - deprecated", () } WITH * WHERE (this.title ENDS WITH $param0 AND this1.name = $param1) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Person) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 RETURN collect({ node: { name: this3.name, __resolveType: \\"Person\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-scalar-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-scalar-deprecated.test.ts index cdcd392e44..bcb91c19a5 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-scalar-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/cypher-filtering-scalar-deprecated.test.ts @@ -53,10 +53,8 @@ describe("cypher directive filtering - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -66,10 +64,8 @@ describe("cypher directive filtering - deprecated", () => { } WITH * WHERE (this.title = $param0 AND var1 >= $param1) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -123,10 +119,8 @@ describe("cypher directive filtering - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -136,10 +130,8 @@ describe("cypher directive filtering - deprecated", () => { } WITH * WHERE (this.title = $param0 AND var1 >= $param1) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -193,10 +185,8 @@ describe("cypher directive filtering - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/delete-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/delete-deprecated.test.ts index 8f5e37027a..da40229f35 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/delete-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/delete-deprecated.test.ts @@ -87,13 +87,11 @@ describe("Cypher Delete - Deprecated", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } @@ -134,24 +132,20 @@ describe("Cypher Delete - Deprecated", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param2 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -193,25 +187,21 @@ describe("Cypher Delete - Deprecated", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE this3.id = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -258,37 +248,31 @@ describe("Cypher Delete - Deprecated", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE this3.id = $param2 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param3 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } WITH this2, collect(DISTINCT this3) AS var8 - CALL { - WITH var8 + CALL (var8) { UNWIND var8 AS var9 DETACH DELETE var9 } } WITH this0, collect(DISTINCT this1) AS var10 - CALL { - WITH var10 + CALL (var10) { UNWIND var10 AS var11 DETACH DELETE var11 } diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/delete-interface-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/delete-interface-deprecated.test.ts index b2e01e71af..2fd99e135d 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/delete-interface-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/delete-interface-deprecated.test.ts @@ -121,24 +121,20 @@ describe("Cypher Delete - interface - deprecated", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE this5.title = $param2 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -175,24 +171,20 @@ describe("Cypher Delete - interface - deprecated", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE (this1.title = $param1 AND this1:Movie) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE (this5.title = $param2 AND this5:Movie) WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -231,24 +223,20 @@ describe("Cypher Delete - interface - deprecated", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE (this1.title = $param1 OR this1.title = $param2) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE (this5.title = $param3 OR this5.title = $param4) WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -292,48 +280,40 @@ describe("Cypher Delete - interface - deprecated", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) WHERE this3.name = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this8:ACTED_IN]->(this9:Series) WHERE this9.title = $param3 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this9)<-[this10:ACTED_IN]-(this11:Actor) WHERE this11.name = $param4 WITH this10, collect(DISTINCT this11) AS var12 - CALL { - WITH var12 + CALL (var12) { UNWIND var12 AS var13 DETACH DELETE var13 } } WITH this8, collect(DISTINCT this9) AS var14 - CALL { - WITH var14 + CALL (var14) { UNWIND var14 AS var15 DETACH DELETE var15 } diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/node-label-interface-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/node-label-interface-deprecated.test.ts index d1a4729f40..ebca663411 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/node-label-interface-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/node-label-interface-deprecated.test.ts @@ -68,20 +68,19 @@ describe("Node directive with interface - deprecated", () => { "CYPHER 5 MATCH (this:Film) WHERE this.title = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Category:ExtraLabel1:ExtraLabel2) WHERE this1.name = $param1 - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Film) WHERE this4.name = $param2 - WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 SKIP $param3 diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/projection-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/projection-deprecated.test.ts index 43742d61ad..67ca842d36 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/projection-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/projection-deprecated.test.ts @@ -109,8 +109,7 @@ describe("Cypher Auth Projection - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id diff --git a/packages/graphql/tests/tck/deprecated/generic-filtering/roles-deprecated.test.ts b/packages/graphql/tests/tck/deprecated/generic-filtering/roles-deprecated.test.ts index 34220d7543..8b0490e3c5 100644 --- a/packages/graphql/tests/tck/deprecated/generic-filtering/roles-deprecated.test.ts +++ b/packages/graphql/tests/tck/deprecated/generic-filtering/roles-deprecated.test.ts @@ -194,10 +194,8 @@ describe("Cypher Auth Roles - deprecated", () => { WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_HISTORY]->(h:History) RETURN h } @@ -245,8 +243,7 @@ describe("Cypher Auth Roles - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id @@ -297,8 +294,7 @@ describe("Cypher Auth Roles - deprecated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id, @@ -453,15 +449,13 @@ describe("Cypher Auth Roles - deprecated", () => { WITH * WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -523,19 +517,17 @@ describe("Cypher Auth Roles - deprecated", () => { "CYPHER 5 MATCH (this:Comment) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_comment0_relationship:HAS_COMMENT]-(this_post0:Post) WITH * - CALL { + CALL(*) { WITH this, this_post0 OPTIONAL MATCH (this_post0_creator0_connect0_node:User) WHERE this_post0_creator0_connect0_node.id = $this_post0_creator0_connect0_node_param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH this, collect(this_post0_creator0_connect0_node) as connectedNodes, collect(this_post0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_post0 UNWIND connectedNodes as this_post0_creator0_connect0_node CREATE (this_post0)-[:HAS_POST]->(this_post0_creator0_connect0_node) @@ -592,14 +584,13 @@ describe("Cypher Auth Roles - deprecated", () => { WITH * WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } WITH this, this_posts0_disconnect0 @@ -659,18 +650,17 @@ describe("Cypher Auth Roles - deprecated", () => { "CYPHER 5 MATCH (this:Comment) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_comment0_relationship:HAS_COMMENT]-(this_post0:Post) WITH this, this_post0 - CALL { + CALL(*) { WITH this, this_post0 OPTIONAL MATCH (this_post0)-[this_post0_creator0_disconnect0_rel:HAS_POST]->(this_post0_creator0_disconnect0:User) WHERE this_post0_creator0_disconnect0.id = $updateComments_args_update_post0_update_node_creator0_disconnect0_where_User_this_post0_creator0_disconnect0param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0 - WITH collect(this_post0_creator0_disconnect0) as this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0 - UNWIND this_post0_creator0_disconnect0 as x + CALL (this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0) { + WITH collect(this_post0_creator0_disconnect0) as this_post0_creator0_disconnect0_x, this_post0_creator0_disconnect0_rel, this_post0 + UNWIND this_post0_creator0_disconnect0_x as x DELETE this_post0_creator0_disconnect0_rel } WITH this, this_post0, this_post0_creator0_disconnect0 @@ -783,13 +773,11 @@ describe("Cypher Auth Roles - deprecated", () => { MATCH (this:User) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } diff --git a/packages/graphql/tests/tck/deprecated/issues/6005.test.ts b/packages/graphql/tests/tck/deprecated/issues/6005.test.ts index 2f2ae77aa7..00213ef842 100644 --- a/packages/graphql/tests/tck/deprecated/issues/6005.test.ts +++ b/packages/graphql/tests/tck/deprecated/issues/6005.test.ts @@ -61,8 +61,7 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) RETURN count(this1) = $param0 AS var2 } @@ -96,12 +95,10 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) RETURN count(this3) = $param0 AS var4 } @@ -136,11 +133,9 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[:ACTED_IN]-(this0:Actor) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:ACTED_IN]->(this2:Movie) RETURN count(this2) = $param0 AS var3 } diff --git a/packages/graphql/tests/tck/directives/alias.test.ts b/packages/graphql/tests/tck/directives/alias.test.ts index 2c57d9bb6c..2d0b46874d 100644 --- a/packages/graphql/tests/tck/directives/alias.test.ts +++ b/packages/graphql/tests/tck/directives/alias.test.ts @@ -67,8 +67,7 @@ describe("Cypher alias directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH DISTINCT this1 WITH this1 { .title, rating: this1.ratingPropInDb } AS this1 @@ -107,13 +106,11 @@ describe("Cypher alias directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ properties: { character: this0.characterPropInDb, screenTime: this0.screenTime, __resolveType: \\"ActorActedInProps\\" }, node: { title: this1.title, rating: this1.ratingPropInDb, __resolveType: \\"Movie\\" } }) AS var2 @@ -172,15 +169,13 @@ describe("Cypher alias directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Actor) SET create_this1.name = create_var0.name, create_this1.cityPropInDb = create_var0.city WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actedIn.create AS create_var2 CREATE (create_this3:Movie) SET @@ -194,20 +189,17 @@ describe("Cypher alias directive", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this6:ACTED_IN]->(create_this7:Movie) WITH DISTINCT create_this7 WITH create_this7 { .title, rating: create_this7.ratingPropInDb } AS create_this7 RETURN collect(create_this7) AS create_var8 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this9:ACTED_IN]->(create_this10:Movie) WITH collect({ node: create_this10, relationship: create_this9 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this10, edge.relationship AS create_this9 RETURN collect({ properties: { character: create_this9.characterPropInDb, screenTime: create_this9.screenTime, __resolveType: \\"ActorActedInProps\\" }, node: { title: create_this10.title, rating: create_this10.ratingPropInDb, __resolveType: \\"Movie\\" } }) AS create_var11 diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/allow/allow.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/allow/allow.test.ts index eb1be911fb..3510d8069b 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/allow/allow.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/allow/allow.test.ts @@ -198,8 +198,7 @@ describe("Cypher Auth Allow", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -250,8 +249,7 @@ describe("Cypher Auth Allow", () => { MATCH (this)<-[:HAS_POST]-(this0:User) WHERE ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this1:HAS_POST]-(this2:User) WITH DISTINCT this2 WITH * @@ -301,8 +299,7 @@ describe("Cypher Auth Allow", () => { WITH * WHERE this.id = $param0 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -311,8 +308,7 @@ describe("Cypher Auth Allow", () => { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this3:HAS_COMMENT]->(this4:Comment) WITH DISTINCT this4 WITH * @@ -462,7 +458,7 @@ describe("Cypher Auth Allow", () => { WHERE ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_post0_relationship:HAS_POST]-(this_creator0:User) WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this_creator0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) @@ -521,7 +517,7 @@ describe("Cypher Auth Allow", () => { WHERE ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_post0_relationship:HAS_POST]-(this_creator0:User) WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this_creator0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) @@ -614,8 +610,7 @@ describe("Cypher Auth Allow", () => { WHERE this.id = $param0 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE this1.id = $param3 CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { @@ -623,8 +618,7 @@ describe("Cypher Auth Allow", () => { WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this0, collect(DISTINCT this1) AS var3 - CALL { - WITH var3 + CALL (var3) { UNWIND var3 AS var4 DETACH DELETE var4 } @@ -673,17 +667,16 @@ describe("Cypher Auth Allow", () => { WITH * WHERE (this.id = $param0 AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE this_posts0_disconnect0.id = $updateUsers_args_update_posts0_disconnect0_where_Post_this_posts0_disconnect0param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this_posts0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } RETURN count(*) AS disconnect_this_posts0_disconnect_Post @@ -762,7 +755,7 @@ describe("Cypher Auth Allow", () => { WHERE ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_post0_disconnect0_rel:HAS_COMMENT]-(this_post0_disconnect0:Post) WHERE (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { @@ -772,23 +765,21 @@ describe("Cypher Auth Allow", () => { MATCH (this_post0_disconnect0)<-[:HAS_POST]-(authorization__before_this1:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this1.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_post0_disconnect0, this_post0_disconnect0_rel, this - WITH collect(this_post0_disconnect0) as this_post0_disconnect0, this_post0_disconnect0_rel, this - UNWIND this_post0_disconnect0 as x + CALL (this_post0_disconnect0, this_post0_disconnect0_rel, this) { + WITH collect(this_post0_disconnect0) as this_post0_disconnect0_x, this_post0_disconnect0_rel, this + UNWIND this_post0_disconnect0_x as x DELETE this_post0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_post0_disconnect0 OPTIONAL MATCH (this_post0_disconnect0)<-[this_post0_disconnect0_creator0_rel:HAS_POST]-(this_post0_disconnect0_creator0:User) WHERE this_post0_disconnect0_creator0.id = $updateComments_args_update_post0_disconnect0_disconnect_creator0_where_User_this_post0_disconnect0_creator0param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this_post0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this_post0_disconnect0_creator0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_post0_disconnect0_creator0, this_post0_disconnect0_creator0_rel, this_post0_disconnect0 - WITH collect(this_post0_disconnect0_creator0) as this_post0_disconnect0_creator0, this_post0_disconnect0_creator0_rel, this_post0_disconnect0 - UNWIND this_post0_disconnect0_creator0 as x + CALL (this_post0_disconnect0_creator0, this_post0_disconnect0_creator0_rel, this_post0_disconnect0) { + WITH collect(this_post0_disconnect0_creator0) as this_post0_disconnect0_creator0_x, this_post0_disconnect0_creator0_rel, this_post0_disconnect0 + UNWIND this_post0_disconnect0_creator0_x as x DELETE this_post0_disconnect0_creator0_rel } RETURN count(*) AS disconnect_this_post0_disconnect0_creator_User @@ -871,18 +862,16 @@ describe("Cypher Auth Allow", () => { WITH * WHERE (this.id = $param0 AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE this_posts0_connect0_node.id = $this_posts0_connect0_node_param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this_posts0_connect0_node)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/allow/interface-relationships/implementation-allow.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/allow/interface-relationships/implementation-allow.test.ts index 30927e8cf9..47e6cf9188 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/allow/interface-relationships/implementation-allow.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/allow/interface-relationships/implementation-allow.test.ts @@ -96,13 +96,12 @@ describe("@auth allow on specific interface implementation", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) - WITH this1 { .id, .content, __resolveType: \\"Comment\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .id, .content, __resolveType: \\"Comment\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:HAS_CONTENT]->(this4:Post) @@ -110,8 +109,8 @@ describe("@auth allow on specific interface implementation", () => { MATCH (this4)<-[:HAS_CONTENT]-(this5:User) WHERE ($jwt.sub IS NOT NULL AND this5.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this4 { .id, .content, __resolveType: \\"Post\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .id, .content, __resolveType: \\"Post\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -157,14 +156,13 @@ describe("@auth allow on specific interface implementation", () => { "CYPHER 5 MATCH (this:User) WHERE this.id = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) WHERE this1.id = $param1 - WITH this1 { __resolveType: \\"Comment\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { __resolveType: \\"Comment\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:HAS_CONTENT]->(this4:Post) @@ -173,16 +171,15 @@ describe("@auth allow on specific interface implementation", () => { MATCH (this4)<-[:HAS_CONTENT]-(this5:User) WHERE ($jwt.sub IS NOT NULL AND this5.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this4 + CALL (this4) { MATCH (this4)-[this6:HAS_COMMENT]->(this7:Comment) WHERE this7.id = $param5 WITH DISTINCT this7 WITH this7 { .content } AS this7 RETURN collect(this7) AS var8 } - WITH this4 { comments: var8, __resolveType: \\"Post\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { comments: var8, __resolveType: \\"Post\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -234,10 +231,9 @@ describe("@auth allow on specific interface implementation", () => { MATCH (this:User) WHERE this.id = $param0 WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Comment) SET this_content0.id = $this_update_content0_id_SET @@ -245,10 +241,9 @@ describe("@auth allow on specific interface implementation", () => { } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Post) WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { @@ -261,13 +256,12 @@ describe("@auth allow on specific interface implementation", () => { RETURN count(*) AS update_this_Post } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[update_this0:HAS_CONTENT]->(update_this1:Comment) - WITH update_this1 { .id, __resolveType: \\"Comment\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var2 + WITH update_this1 { .id, __resolveType: \\"Comment\\", __id: id(update_this1) } AS update_var2 + RETURN update_var2 UNION WITH * MATCH (this)-[update_this3:HAS_CONTENT]->(update_this4:Post) @@ -275,8 +269,8 @@ describe("@auth allow on specific interface implementation", () => { MATCH (update_this4)<-[:HAS_CONTENT]-(update_this5:User) WHERE ($jwt.sub IS NOT NULL AND update_this5.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH update_this4 { .id, __resolveType: \\"Post\\", __id: id(update_this4) } AS update_this4 - RETURN update_this4 AS update_var2 + WITH update_this4 { .id, __resolveType: \\"Post\\", __id: id(update_this4) } AS update_var2 + RETURN update_var2 } WITH update_var2 RETURN collect(update_var2) AS update_var2 @@ -322,19 +316,16 @@ describe("@auth allow on specific interface implementation", () => { MATCH (this:User) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) WHERE this1.id = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:HAS_CONTENT]->(this5:Post) WHERE this5.id = $param2 CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { @@ -342,8 +333,7 @@ describe("@auth allow on specific interface implementation", () => { WHERE ($jwt.sub IS NOT NULL AND this6.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this4, collect(DISTINCT this5) AS var7 - CALL { - WITH var7 + CALL (var7) { UNWIND var7 AS var8 DETACH DELETE var8 } diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/interface-relationships/implementation-is-authenticated.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/interface-relationships/implementation-is-authenticated.test.ts index 4aee939bbb..135ad11817 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/interface-relationships/implementation-is-authenticated.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/interface-relationships/implementation-is-authenticated.test.ts @@ -80,8 +80,7 @@ describe("Cypher Auth isAuthenticated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Post) SET create_this1.id = create_var0.id, @@ -122,8 +121,7 @@ describe("Cypher Auth isAuthenticated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Comment) SET create_this1.id = create_var0.id, @@ -275,22 +273,18 @@ describe("Cypher Auth isAuthenticated", () => { "CYPHER 5 MATCH (this:User) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:HAS_CONTENT]->(this5:Post) WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/is-authenticated.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/is-authenticated.test.ts index 01f5d5e243..3867351dfd 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/is-authenticated.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/is-authenticated/is-authenticated.test.ts @@ -133,10 +133,8 @@ describe("Cypher Auth isAuthenticated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_HISTORY]->(h:History) RETURN h } @@ -169,8 +167,7 @@ describe("Cypher Auth isAuthenticated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id @@ -209,8 +206,7 @@ describe("Cypher Auth isAuthenticated", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id, @@ -339,12 +335,10 @@ describe("Cypher Auth isAuthenticated", () => { "CYPHER 5 MATCH (this:User) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/roles-where.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/roles-where.test.ts index d1834fc898..52375ce0f2 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/roles-where.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/roles-where.test.ts @@ -187,8 +187,7 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -245,8 +244,7 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) @@ -254,8 +252,7 @@ describe("Cypher Auth Where with Roles", () => { } AND ($jwt.roles IS NOT NULL AND $param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 @@ -308,8 +305,7 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE this1.id = $param4 CALL apoc.util.validate(NOT (($isAuthenticated = true AND EXISTS { @@ -318,8 +314,7 @@ describe("Cypher Auth Where with Roles", () => { } AND ($jwt.roles IS NOT NULL AND $param5 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param6 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 @@ -369,8 +364,7 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -427,17 +421,16 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this1 { .id, __resolveType: \\"Post\\", __id: id(this1) } AS this1 - RETURN this1 AS var3 + WITH this1 { .id, __resolveType: \\"Post\\", __id: id(this1) } AS var3 + RETURN var3 } WITH var3 RETURN collect(var3) AS var3 @@ -490,10 +483,8 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_POST]->(this1:Post) @@ -558,10 +549,8 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_POST]->(this1:Post) @@ -726,7 +715,7 @@ describe("Cypher Auth Where with Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_post0_relationship:HAS_POST]->(this_posts0:Post) WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { @@ -745,8 +734,7 @@ describe("Cypher Auth Where with Roles", () => { WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization__after_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__after_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $update_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $update_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:HAS_POST]->(update_this1:Post) WITH DISTINCT update_this1 WITH * @@ -841,16 +829,14 @@ describe("Cypher Auth Where with Roles", () => { MATCH (this:User) CALL apoc.util.validate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this0, collect(DISTINCT this1) AS var3 - CALL { - WITH var3 + CALL (var3) { UNWIND var3 AS var4 DETACH DELETE var4 } @@ -898,24 +884,22 @@ describe("Cypher Auth Where with Roles", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_posts_connect0_node:Post) WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this0_posts_connect0_node)<-[:HAS_POST]-(authorization_0_before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization_0_before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization_0_before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization_0_before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH * + CALL(*) { WITH collect(this0_posts_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_posts_connect0_node CREATE (this0)-[:HAS_POST]->(this0_posts_connect0_node) @@ -933,8 +917,7 @@ describe("Cypher Auth Where with Roles", () => { WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization_0_after_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization_0_after_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -990,24 +973,22 @@ describe("Cypher Auth Where with Roles", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_posts_connect0_node:Post) WHERE this0_posts_connect0_node.id = $this0_posts_connect0_node_param0 AND apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this0_posts_connect0_node)<-[:HAS_POST]-(authorization_0_before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization_0_before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization_0_before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization_0_before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH * + CALL(*) { WITH collect(this0_posts_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_posts_connect0_node CREATE (this0)-[:HAS_POST]->(this0_posts_connect0_node) @@ -1025,8 +1006,7 @@ describe("Cypher Auth Where with Roles", () => { WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization_0_after_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization_0_after_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -1078,18 +1058,16 @@ describe("Cypher Auth Where with Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE (apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_connect0_node)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization__before_param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -1158,18 +1136,16 @@ describe("Cypher Auth Where with Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE this_posts0_connect0_node.id = $this_posts0_connect0_node_param0 AND (apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_connect0_node)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization__before_param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -1239,17 +1215,16 @@ describe("Cypher Auth Where with Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE (apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization__before_param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } WITH this, this_posts0_disconnect0 @@ -1314,17 +1289,16 @@ describe("Cypher Auth Where with Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE this_posts0_disconnect0.id = $updateUsers_args_update_posts0_disconnect0_where_Post_this_posts0_disconnect0param0 AND (apoc.util.validatePredicate(NOT (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub) AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) } AND ($jwt.roles IS NOT NULL AND $authorization__before_param4 IN $jwt.roles)) OR ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param5 IN $jwt.roles))), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } WITH this, this_posts0_disconnect0 diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/roles/roles.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/roles/roles.test.ts index 3d5780b574..b965d8e1c7 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/roles/roles.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/roles/roles.test.ts @@ -197,10 +197,8 @@ describe("Cypher Auth Roles", () => { WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_HISTORY]->(h:History) RETURN h } @@ -248,8 +246,7 @@ describe("Cypher Auth Roles", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id @@ -300,8 +297,7 @@ describe("Cypher Auth Roles", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id, @@ -456,15 +452,13 @@ describe("Cypher Auth Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -528,19 +522,17 @@ describe("Cypher Auth Roles", () => { "CYPHER 5 MATCH (this:Comment) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_comment0_relationship:HAS_COMMENT]-(this_post0:Post) WITH * - CALL { + CALL(*) { WITH this, this_post0 OPTIONAL MATCH (this_post0_creator0_connect0_node:User) WHERE this_post0_creator0_connect0_node.id = $this_post0_creator0_connect0_node_param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH this, collect(this_post0_creator0_connect0_node) as connectedNodes, collect(this_post0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_post0 UNWIND connectedNodes as this_post0_creator0_connect0_node CREATE (this_post0)-[:HAS_POST]->(this_post0_creator0_connect0_node) @@ -597,14 +589,13 @@ describe("Cypher Auth Roles", () => { WITH * WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } WITH this, this_posts0_disconnect0 @@ -666,18 +657,17 @@ describe("Cypher Auth Roles", () => { "CYPHER 5 MATCH (this:Comment) WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_has_comment0_relationship:HAS_COMMENT]-(this_post0:Post) WITH this, this_post0 - CALL { + CALL(*) { WITH this, this_post0 OPTIONAL MATCH (this_post0)-[this_post0_creator0_disconnect0_rel:HAS_POST]->(this_post0_creator0_disconnect0:User) WHERE this_post0_creator0_disconnect0.id = $updateComments_args_update_post0_update_node_creator0_disconnect0_where_User_this_post0_creator0_disconnect0param0 AND (apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization__before_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0 - WITH collect(this_post0_creator0_disconnect0) as this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0 - UNWIND this_post0_creator0_disconnect0 as x + CALL (this_post0_creator0_disconnect0, this_post0_creator0_disconnect0_rel, this_post0) { + WITH collect(this_post0_creator0_disconnect0) as this_post0_creator0_disconnect0_x, this_post0_creator0_disconnect0_rel, this_post0 + UNWIND this_post0_creator0_disconnect0_x as x DELETE this_post0_creator0_disconnect0_rel } WITH this, this_post0, this_post0_creator0_disconnect0 @@ -792,13 +782,11 @@ describe("Cypher Auth Roles", () => { MATCH (this:User) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param2 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/validate/interface-relationships/implementation-bind.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/validate/interface-relationships/implementation-bind.test.ts index 53e59bbe15..41a574962a 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/validate/interface-relationships/implementation-bind.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/validate/interface-relationships/implementation-bind.test.ts @@ -118,7 +118,7 @@ describe("Cypher Auth Allow", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name @@ -137,8 +137,7 @@ describe("Cypher Auth Allow", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -199,7 +198,7 @@ describe("Cypher Auth Allow", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name @@ -215,8 +214,7 @@ describe("Cypher Auth Allow", () => { WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0_contentComment0_node_creator0_node.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -271,15 +269,14 @@ describe("Cypher Auth Allow", () => { MATCH (this:User) WHERE this.id = $param0 WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Comment) WHERE this_content0.id = $updateUsers_args_update_content0_where_this_content0param0 WITH this, this_content0 - CALL { + CALL(*) { WITH this, this_content0 MATCH (this_content0)<-[this_content0_has_content0_relationship:HAS_CONTENT]-(this_content0_creator0:User) SET this_content0_creator0.id = $this_update_content0_creator0_id_SET @@ -291,15 +288,14 @@ describe("Cypher Auth Allow", () => { } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Post) WHERE this_content0.id = $updateUsers_args_update_content0_where_this_content0param0 WITH this, this_content0 - CALL { + CALL(*) { WITH this, this_content0 MATCH (this_content0)<-[this_content0_has_content0_relationship:HAS_CONTENT]-(this_content0_creator0:User) SET this_content0_creator0.id = $this_update_content0_creator0_id_SET diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/validate/validate.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/validate/validate.test.ts index da36e9d152..33ca1f8c9e 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/validate/validate.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/validate/validate.test.ts @@ -89,8 +89,7 @@ describe("Cypher Auth Allow", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id, @@ -152,23 +151,20 @@ describe("Cypher Auth Allow", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id, create_this1.name = create_var0.name WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.posts.create AS create_var2 CREATE (create_this3:Post) SET create_this3.id = create_var2.node.id MERGE (create_this1)-[create_this4:HAS_POST]->(create_this3) WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.creator.create AS create_var5 CREATE (create_this6:User) SET @@ -302,12 +298,12 @@ describe("Cypher Auth Allow", () => { MATCH (this:User) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_post0_relationship:HAS_POST]->(this_posts0:Post) WHERE this_posts0.id = $updateUsers_args_update_posts0_where_this_posts0param0 WITH this, this_posts0 - CALL { + CALL(*) { WITH this, this_posts0 MATCH (this_posts0)<-[this_posts0_has_post0_relationship:HAS_POST]-(this_posts0_creator0:User) SET this_posts0_creator0.id = $this_update_posts0_creator0_id_SET @@ -393,15 +389,13 @@ describe("Cypher Auth Allow", () => { MATCH (this:Post) WHERE this.id = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_creator0_connect0_node:User) WHERE this_creator0_connect0_node.id = $this_creator0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_creator0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_creator0_connect0_node CREATE (this)<-[:HAS_POST]-(this_creator0_connect0_node) @@ -458,14 +452,13 @@ describe("Cypher Auth Allow", () => { MATCH (this:Post) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_creator0_disconnect0_rel:HAS_POST]-(this_creator0_disconnect0:User) WHERE this_creator0_disconnect0.id = $updatePosts_args_update_creator0_disconnect0_where_User_this_creator0_disconnect0param0 - CALL { - WITH this_creator0_disconnect0, this_creator0_disconnect0_rel, this - WITH collect(this_creator0_disconnect0) as this_creator0_disconnect0, this_creator0_disconnect0_rel, this - UNWIND this_creator0_disconnect0 as x + CALL (this_creator0_disconnect0, this_creator0_disconnect0_rel, this) { + WITH collect(this_creator0_disconnect0) as this_creator0_disconnect0_x, this_creator0_disconnect0_rel, this + UNWIND this_creator0_disconnect0_x as x DELETE this_creator0_disconnect0_rel } WITH this, this_creator0_disconnect0 diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/where/connection-auth-filter.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/where/connection-auth-filter.test.ts index e042b1ef10..87f73d19ef 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/where/connection-auth-filter.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/where/connection-auth-filter.test.ts @@ -100,8 +100,7 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { id: this0.id, __resolveType: \\"User\\" } }) AS var1 @@ -146,8 +145,7 @@ describe("Connection auth filter", () => { WHERE (this0.name = $param0 AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub))) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { id: this0.id, __resolveType: \\"User\\" } }) AS var1 @@ -196,12 +194,10 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) WITH DISTINCT this2 WITH * @@ -261,12 +257,10 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this2)<-[:HAS_POST]-(this3:User) @@ -274,8 +268,7 @@ describe("Connection auth filter", () => { }) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { content: this2.content, __resolveType: \\"Post\\" } }) AS var4 @@ -331,12 +324,10 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) WHERE (this2.id = $param2 AND ($isAuthenticated = true AND EXISTS { MATCH (this2)<-[:HAS_POST]-(this3:User) @@ -344,8 +335,7 @@ describe("Connection auth filter", () => { })) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { content: this2.content, __resolveType: \\"Post\\" } }) AS var4 @@ -398,12 +388,10 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) WITH DISTINCT this2 WITH * @@ -462,21 +450,19 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)-[this1:HAS_POST]->(this2:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this2)<-[:HAS_POST]-(this3:User) WHERE ($jwt.sub IS NOT NULL AND this3.id = $jwt.sub) }) - WITH this2 { .id, __resolveType: \\"Post\\", __id: id(this2) } AS this2 - RETURN this2 AS var4 + WITH this2 { .id, __resolveType: \\"Post\\", __id: id(this2) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 @@ -532,14 +518,11 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { CALL { WITH this0 MATCH (this0)-[this1:HAS_POST]->(this2:Post) @@ -607,14 +590,11 @@ describe("Connection auth filter", () => { WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { CALL { WITH this0 MATCH (this0)-[this1:HAS_POST]->(this2:Post) diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/where/interface-relationships/implementation-where.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/where/interface-relationships/implementation-where.test.ts index d4c214761c..36ca1661bc 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/where/interface-relationships/implementation-where.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/where/interface-relationships/implementation-where.test.ts @@ -191,13 +191,12 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) - WITH this1 { __resolveType: \\"Comment\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { __resolveType: \\"Comment\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:HAS_CONTENT]->(this4:Post) @@ -205,8 +204,8 @@ describe("Cypher Auth Where", () => { MATCH (this4)<-[:HAS_CONTENT]-(this5:User) WHERE ($jwt.sub IS NOT NULL AND this5.id = $jwt.sub) }) - WITH this4 { .id, __resolveType: \\"Post\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .id, __resolveType: \\"Post\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -253,10 +252,8 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) @@ -320,10 +317,8 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) @@ -477,10 +472,9 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Comment) SET this_content0.id = $this_update_content0_id_SET @@ -488,10 +482,9 @@ describe("Cypher Auth Where", () => { } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_content0_relationship:HAS_CONTENT]->(this_content0:Post) WHERE ($isAuthenticated = true AND EXISTS { @@ -611,26 +604,22 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_CONTENT]->(this1:Comment) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:HAS_CONTENT]->(this5:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this5)<-[:HAS_CONTENT]-(this6:User) WHERE ($jwt.sub IS NOT NULL AND this6.id = $jwt.sub) }) WITH this4, collect(DISTINCT this5) AS var7 - CALL { - WITH var7 + CALL (var7) { UNWIND var7 AS var8 DETACH DELETE var8 } @@ -672,20 +661,18 @@ describe("Cypher Auth Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_content_connect0_node:Comment) - CALL { - WITH * + CALL(*) { WITH collect(this0_content_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_content_connect0_node CREATE (this0)-[:HAS_CONTENT]->(this0_content_connect0_node) @@ -694,18 +681,16 @@ describe("Cypher Auth Where", () => { WITH this0, this0_content_connect0_node RETURN count(*) AS connect_this0_content_connect_Comment0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_content_connect1_node:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this0_content_connect1_node)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) - CALL { - WITH * + CALL(*) { WITH collect(this0_content_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_content_connect1_node CREATE (this0)-[:HAS_CONTENT]->(this0_content_connect1_node) @@ -716,8 +701,7 @@ describe("Cypher Auth Where", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -765,21 +749,19 @@ describe("Cypher Auth Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_content_connect0_node:Comment) WHERE this0_content_connect0_node.id = $this0_content_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_content_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_content_connect0_node CREATE (this0)-[:HAS_CONTENT]->(this0_content_connect0_node) @@ -788,18 +770,16 @@ describe("Cypher Auth Where", () => { WITH this0, this0_content_connect0_node RETURN count(*) AS connect_this0_content_connect_Comment0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_content_connect1_node:Post) WHERE this0_content_connect1_node.id = $this0_content_connect1_node_param0 AND ($isAuthenticated = true AND EXISTS { MATCH (this0_content_connect1_node)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) - CALL { - WITH * + CALL(*) { WITH collect(this0_content_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_content_connect1_node CREATE (this0)-[:HAS_CONTENT]->(this0_content_connect1_node) @@ -810,8 +790,7 @@ describe("Cypher Auth Where", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -856,18 +835,15 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { - WITH this + CALL (this) { WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_content0_connect0_node:Comment) WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH * + CALL(*) { WITH collect(this_content0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_content0_connect0_node CREATE (this)-[:HAS_CONTENT]->(this_content0_connect0_node) @@ -878,21 +854,18 @@ describe("Cypher Auth Where", () => { } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_content0_connect0_node:Post) WHERE (($isAuthenticated = true AND EXISTS { MATCH (this_content0_connect0_node)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub))) - CALL { - WITH * + CALL(*) { WITH collect(this_content0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_content0_connect0_node CREATE (this)-[:HAS_CONTENT]->(this_content0_connect0_node) @@ -942,18 +915,15 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { - WITH this + CALL (this) { WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_content0_connect0_node:Comment) WHERE this_content0_connect0_node.id = $this_content0_connect0_node_param0 AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH * + CALL(*) { WITH collect(this_content0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_content0_connect0_node CREATE (this)-[:HAS_CONTENT]->(this_content0_connect0_node) @@ -964,21 +934,18 @@ describe("Cypher Auth Where", () => { } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_content0_connect0_node:Post) WHERE this_content0_connect0_node.id = $this_content0_connect0_node_param0 AND (($isAuthenticated = true AND EXISTS { MATCH (this_content0_connect0_node)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub))) - CALL { - WITH * + CALL(*) { WITH collect(this_content0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_content0_connect0_node CREATE (this)-[:HAS_CONTENT]->(this_content0_connect0_node) @@ -1029,37 +996,33 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_content0_disconnect0_rel:HAS_CONTENT]->(this_content0_disconnect0:Comment) WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this_content0_disconnect0, this_content0_disconnect0_rel, this - WITH collect(this_content0_disconnect0) as this_content0_disconnect0, this_content0_disconnect0_rel, this - UNWIND this_content0_disconnect0 as x + CALL (this_content0_disconnect0, this_content0_disconnect0_rel, this) { + WITH collect(this_content0_disconnect0) as this_content0_disconnect0_x, this_content0_disconnect0_rel, this + UNWIND this_content0_disconnect0_x as x DELETE this_content0_disconnect0_rel } RETURN count(*) AS disconnect_this_content0_disconnect_Comment } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_content0_disconnect0_rel:HAS_CONTENT]->(this_content0_disconnect0:Post) WHERE (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) AND ($isAuthenticated = true AND EXISTS { MATCH (this_content0_disconnect0)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) })) - CALL { - WITH this_content0_disconnect0, this_content0_disconnect0_rel, this - WITH collect(this_content0_disconnect0) as this_content0_disconnect0, this_content0_disconnect0_rel, this - UNWIND this_content0_disconnect0 as x + CALL (this_content0_disconnect0, this_content0_disconnect0_rel, this) { + WITH collect(this_content0_disconnect0) as this_content0_disconnect0_x, this_content0_disconnect0_rel, this + UNWIND this_content0_disconnect0_x as x DELETE this_content0_disconnect0_rel } RETURN count(*) AS disconnect_this_content0_disconnect_Post @@ -1105,37 +1068,33 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_content0_disconnect0_rel:HAS_CONTENT]->(this_content0_disconnect0:Comment) WHERE this_content0_disconnect0.id = $updateUsers_args_update_content0_disconnect0_where_Comment_this_content0_disconnect0param0 AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this_content0_disconnect0, this_content0_disconnect0_rel, this - WITH collect(this_content0_disconnect0) as this_content0_disconnect0, this_content0_disconnect0_rel, this - UNWIND this_content0_disconnect0 as x + CALL (this_content0_disconnect0, this_content0_disconnect0_rel, this) { + WITH collect(this_content0_disconnect0) as this_content0_disconnect0_x, this_content0_disconnect0_rel, this + UNWIND this_content0_disconnect0_x as x DELETE this_content0_disconnect0_rel } RETURN count(*) AS disconnect_this_content0_disconnect_Comment } RETURN count(*) AS update_this_Comment } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_content0_disconnect0_rel:HAS_CONTENT]->(this_content0_disconnect0:Post) WHERE this_content0_disconnect0.id = $updateUsers_args_update_content0_disconnect0_where_Post_this_content0_disconnect0param0 AND (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) AND ($isAuthenticated = true AND EXISTS { MATCH (this_content0_disconnect0)<-[:HAS_CONTENT]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) })) - CALL { - WITH this_content0_disconnect0, this_content0_disconnect0_rel, this - WITH collect(this_content0_disconnect0) as this_content0_disconnect0, this_content0_disconnect0_rel, this - UNWIND this_content0_disconnect0 as x + CALL (this_content0_disconnect0, this_content0_disconnect0_rel, this) { + WITH collect(this_content0_disconnect0) as this_content0_disconnect0_x, this_content0_disconnect0_rel, this + UNWIND this_content0_disconnect0_x as x DELETE this_content0_disconnect0_rel } RETURN count(*) AS disconnect_this_content0_disconnect_Post diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/where/where.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/where/where.test.ts index 52b9d6c8ca..987acd3491 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/where/where.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/where/where.test.ts @@ -169,8 +169,7 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -223,8 +222,7 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) @@ -232,8 +230,7 @@ describe("Cypher Auth Where", () => { }) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 @@ -282,8 +279,7 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE (this1.id = $param2 AND ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) @@ -291,8 +287,7 @@ describe("Cypher Auth Where", () => { })) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 @@ -338,8 +333,7 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) WITH DISTINCT this1 WITH * @@ -391,17 +385,16 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) }) - WITH this1 { .id, __resolveType: \\"Post\\", __id: id(this1) } AS this1 - RETURN this1 AS var3 + WITH this1 { .id, __resolveType: \\"Post\\", __id: id(this1) } AS var3 + RETURN var3 } WITH var3 RETURN collect(var3) AS var3 @@ -450,10 +443,8 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_POST]->(this1:Post) @@ -514,10 +505,8 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HAS_POST]->(this1:Post) @@ -661,7 +650,7 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_post0_relationship:HAS_POST]->(this_posts0:Post) WHERE ($isAuthenticated = true AND EXISTS { @@ -673,8 +662,7 @@ describe("Cypher Auth Where", () => { } WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:HAS_POST]->(update_this1:Post) WITH DISTINCT update_this1 WITH * @@ -791,16 +779,14 @@ describe("Cypher Auth Where", () => { MATCH (this:User) WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_POST]->(this1:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) }) WITH this0, collect(DISTINCT this1) AS var3 - CALL { - WITH var3 + CALL (var3) { UNWIND var3 AS var4 DETACH DELETE var4 } @@ -844,24 +830,22 @@ describe("Cypher Auth Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_posts_connect0_node:Post) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this0_posts_connect0_node)<-[:HAS_POST]-(authorization_0_before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization_0_before_this0.id = $jwt.sub) }) - CALL { - WITH * + CALL(*) { WITH collect(this0_posts_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_posts_connect0_node CREATE (this0)-[:HAS_POST]->(this0_posts_connect0_node) @@ -872,8 +856,7 @@ describe("Cypher Auth Where", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -923,24 +906,22 @@ describe("Cypher Auth Where", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:User) SET this0.id = $this0_id SET this0.name = $this0_name SET this0.password = $this0_password WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_posts_connect0_node:Post) WHERE this0_posts_connect0_node.id = $this0_posts_connect0_node_param0 AND ($isAuthenticated = true AND EXISTS { MATCH (this0_posts_connect0_node)<-[:HAS_POST]-(authorization_0_before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization_0_before_this0.id = $jwt.sub) }) - CALL { - WITH * + CALL(*) { WITH collect(this0_posts_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_posts_connect0_node CREATE (this0)-[:HAS_POST]->(this0_posts_connect0_node) @@ -951,8 +932,7 @@ describe("Cypher Auth Where", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -998,18 +978,16 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_connect0_node)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub))) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -1059,18 +1037,16 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_posts0_connect0_node:Post) WHERE this_posts0_connect0_node.id = $this_posts0_connect0_node_param0 AND (($isAuthenticated = true AND EXISTS { MATCH (this_posts0_connect0_node)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) }) AND ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub))) - CALL { - WITH * + CALL(*) { WITH collect(this_posts0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_posts0_connect0_node CREATE (this)-[:HAS_POST]->(this_posts0_connect0_node) @@ -1121,17 +1097,16 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) AND ($isAuthenticated = true AND EXISTS { MATCH (this_posts0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) })) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } RETURN count(*) AS disconnect_this_posts0_disconnect_Post @@ -1177,17 +1152,16 @@ describe("Cypher Auth Where", () => { WITH * WHERE ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_posts0_disconnect0_rel:HAS_POST]->(this_posts0_disconnect0:Post) WHERE this_posts0_disconnect0.id = $updateUsers_args_update_posts0_disconnect0_where_Post_this_posts0_disconnect0param0 AND (($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)) AND ($isAuthenticated = true AND EXISTS { MATCH (this_posts0_disconnect0)<-[:HAS_POST]-(authorization__before_this0:User) WHERE ($jwt.sub IS NOT NULL AND authorization__before_this0.id = $jwt.sub) })) - CALL { - WITH this_posts0_disconnect0, this_posts0_disconnect0_rel, this - WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0, this_posts0_disconnect0_rel, this - UNWIND this_posts0_disconnect0 as x + CALL (this_posts0_disconnect0, this_posts0_disconnect0_rel, this) { + WITH collect(this_posts0_disconnect0) as this_posts0_disconnect0_x, this_posts0_disconnect0_rel, this + UNWIND this_posts0_disconnect0_x as x DELETE this_posts0_disconnect0_rel } RETURN count(*) AS disconnect_this_posts0_disconnect_Post diff --git a/packages/graphql/tests/tck/directives/authorization/projection-connection-union.test.ts b/packages/graphql/tests/tck/directives/authorization/projection-connection-union.test.ts index 8c2bc16039..b6e182a86b 100644 --- a/packages/graphql/tests/tck/directives/authorization/projection-connection-union.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/projection-connection-union.test.ts @@ -92,10 +92,8 @@ describe("Cypher Auth Projection On Connections On Unions", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:PUBLISHED]->(this1:Post) @@ -103,14 +101,12 @@ describe("Cypher Auth Projection On Connections On Unions", () => { MATCH (this1)<-[:HAS_POST]-(this2:User) WHERE ($jwt.sub IS NOT NULL AND this2.id = $jwt.sub) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this3:HAS_POST]-(this4:User) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this4.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this4, relationship: this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this4, edge.relationship AS this3 RETURN collect({ node: { name: this4.name, __resolveType: \\"User\\" } }) AS var5 diff --git a/packages/graphql/tests/tck/directives/authorization/projection-connection.test.ts b/packages/graphql/tests/tck/directives/authorization/projection-connection.test.ts index 9e00e25cb5..8bf026248f 100644 --- a/packages/graphql/tests/tck/directives/authorization/projection-connection.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/projection-connection.test.ts @@ -82,8 +82,7 @@ describe("Cypher Auth Projection On Connections", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) @@ -91,8 +90,7 @@ describe("Cypher Auth Projection On Connections", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 @@ -146,8 +144,7 @@ describe("Cypher Auth Projection On Connections", () => { MATCH (this:User) WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:User) @@ -155,18 +152,15 @@ describe("Cypher Auth Projection On Connections", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this3:HAS_POST]-(this4:User) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this4.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this4, relationship: this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this4, edge.relationship AS this3 RETURN collect({ node: { name: this4.name, __resolveType: \\"User\\" } }) AS var5 @@ -258,12 +252,10 @@ describe("Cypher Auth Projection On top-level connections", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this2)<-[:HAS_POST]-(this3:User) @@ -271,8 +263,7 @@ describe("Cypher Auth Projection On top-level connections", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { content: this2.content, __resolveType: \\"Post\\" } }) AS var4 @@ -333,12 +324,10 @@ describe("Cypher Auth Projection On top-level connections", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this0.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_POST]->(this2:Post) CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this2)<-[:HAS_POST]-(this3:User) @@ -346,18 +335,15 @@ describe("Cypher Auth Projection On top-level connections", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this4:HAS_POST]-(this5:User) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this5.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this5, relationship: this4 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this5, edge.relationship AS this4 RETURN collect({ node: { name: this5.name, __resolveType: \\"User\\" } }) AS var6 diff --git a/packages/graphql/tests/tck/directives/authorization/projection-interface-relationships.test.ts b/packages/graphql/tests/tck/directives/authorization/projection-interface-relationships.test.ts index 5fb0280bb6..ff66d501f8 100644 --- a/packages/graphql/tests/tck/directives/authorization/projection-interface-relationships.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/projection-interface-relationships.test.ts @@ -90,19 +90,18 @@ describe("Auth projections for interface relationship fields", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this4.episodes = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/directives/authorization/projection.test.ts b/packages/graphql/tests/tck/directives/authorization/projection.test.ts index 25f10214bb..406403a276 100644 --- a/packages/graphql/tests/tck/directives/authorization/projection.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/projection.test.ts @@ -109,8 +109,7 @@ describe("Cypher Auth Projection", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:User) SET create_this1.id = create_var0.id diff --git a/packages/graphql/tests/tck/directives/autogenerate.test.ts b/packages/graphql/tests/tck/directives/autogenerate.test.ts index 572c17626f..cb10491e80 100644 --- a/packages/graphql/tests/tck/directives/autogenerate.test.ts +++ b/packages/graphql/tests/tck/directives/autogenerate.test.ts @@ -54,8 +54,7 @@ describe("Cypher autogenerate directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = randomUUID(), diff --git a/packages/graphql/tests/tck/directives/coalesce.test.ts b/packages/graphql/tests/tck/directives/coalesce.test.ts index 3db5c69190..e4541fc7a5 100644 --- a/packages/graphql/tests/tck/directives/coalesce.test.ts +++ b/packages/graphql/tests/tck/directives/coalesce.test.ts @@ -206,14 +206,12 @@ describe("Cypher coalesce()", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE coalesce(this1.status, \\"ACTIVE\\") = $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { id: this1.id, status: coalesce(this1.status, \\"ACTIVE\\"), __resolveType: \\"Movie\\" } }) AS var2 @@ -270,14 +268,12 @@ describe("Cypher coalesce()", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE coalesce(this1.statuses, [\\"ACTIVE\\", \\"INACTIVE\\"]) = $param0 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { id: this1.id, statuses: coalesce(this1.statuses, [\\"ACTIVE\\", \\"INACTIVE\\"]), __resolveType: \\"Movie\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/directives/customResolver.test.ts b/packages/graphql/tests/tck/directives/customResolver.test.ts index fae3ba092c..fe0dee4755 100644 --- a/packages/graphql/tests/tck/directives/customResolver.test.ts +++ b/packages/graphql/tests/tck/directives/customResolver.test.ts @@ -254,18 +254,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -315,18 +314,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -351,18 +349,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -439,18 +436,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -500,18 +496,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -536,18 +531,17 @@ describe("@customResolver directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:WROTE]->(this1:Book) - WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .publicationYear, .title, __resolveType: \\"Book\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:WROTE]->(this4:Journal) - WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .publicationYear, .subject, __resolveType: \\"Journal\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/directives/cypher/cypher-interface.test.ts b/packages/graphql/tests/tck/directives/cypher/cypher-interface.test.ts index 87c31dea3e..521cab05af 100644 --- a/packages/graphql/tests/tck/directives/cypher/cypher-interface.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/cypher-interface.test.ts @@ -146,20 +146,19 @@ describe("Cypher directive on interface", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -192,20 +191,19 @@ describe("Cypher directive on interface", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -251,25 +249,20 @@ describe("Cypher directive on interface", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (m:Movie {title: $param1}) RETURN m @@ -281,22 +274,21 @@ describe("Cypher directive on interface", () => { WITH this1 { .name, movies: var3 } AS this1 RETURN collect(this1) AS var4 } - WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS var5 + RETURN var5 UNION WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this6:ACTED_IN]-(this7:Actor) WHERE this7.name = $param2 WITH DISTINCT this7 WITH this7 { .name } AS this7 RETURN collect(this7) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS var5 + RETURN var5 } RETURN var5 } @@ -332,20 +324,19 @@ describe("Cypher directive on interface", () => { LIMIT 1 } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -379,20 +370,19 @@ describe("Cypher directive on interface", () => { LIMIT 1 } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -438,25 +428,20 @@ describe("Cypher directive on interface", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (m:Movie {title: $param1}) RETURN m @@ -468,22 +453,21 @@ describe("Cypher directive on interface", () => { WITH this1 { .name, movies: var3 } AS this1 RETURN collect(this1) AS var4 } - WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS var5 + RETURN var5 UNION WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this6:ACTED_IN]-(this7:Actor) WHERE this7.name = $param2 WITH DISTINCT this7 WITH this7 { .name } AS this7 RETURN collect(this7) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS var5 + RETURN var5 } RETURN var5 } @@ -528,35 +512,28 @@ describe("Cypher directive on interface", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (n) WHERE (n:TVShow OR n:Movie) AND ($param0 IS NULL OR n.title = $param0) RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (m:Movie {title: $param1}) RETURN m @@ -568,22 +545,21 @@ describe("Cypher directive on interface", () => { WITH this1 { .name, movies: var3 } AS this1 RETURN collect(this1) AS var4 } - WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var4, __resolveType: \\"TVShow\\", __id: id(this0) } AS var5 + RETURN var5 UNION WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this6:ACTED_IN]-(this7:Actor) WHERE this7.name = $param2 WITH DISTINCT this7 WITH this7 { .name } AS this7 RETURN collect(this7) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var5 + WITH this0 { .title, actors: var8, __resolveType: \\"Movie\\", __id: id(this0) } AS var5 + RETURN var5 } RETURN var5 } diff --git a/packages/graphql/tests/tck/directives/cypher/cypher-union.test.ts b/packages/graphql/tests/tck/directives/cypher/cypher-union.test.ts index 8c45991781..116303a013 100644 --- a/packages/graphql/tests/tck/directives/cypher/cypher-union.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/cypher-union.test.ts @@ -149,20 +149,19 @@ describe("Cypher directive on union", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -195,20 +194,19 @@ describe("Cypher directive on union", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -255,39 +253,33 @@ describe("Cypher directive on union", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WHERE this2.name = $param1 WITH DISTINCT this2 WITH this2 { .name } AS this2 RETURN collect(this2) AS var3 } - WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS var4 + RETURN var4 UNION WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this5 - CALL { - WITH this5 - CALL { - WITH this5 + CALL (this5) { + CALL (this5) { WITH this5 AS this MATCH (m:Movie {title: $param2}) RETURN m @@ -299,8 +291,8 @@ describe("Cypher directive on union", () => { WITH this5 { .name, movies: var7 } AS this5 RETURN collect(this5) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS var4 + RETURN var4 } RETURN var4 } @@ -341,20 +333,19 @@ describe("Cypher directive on union", () => { LIMIT 1 } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .title, __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -388,20 +379,19 @@ describe("Cypher directive on union", () => { LIMIT 1 } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"Movie\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:TVShow - WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { __resolveType: \\"TVShow\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } @@ -448,39 +438,33 @@ describe("Cypher directive on union", () => { RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WHERE this2.name = $param1 WITH DISTINCT this2 WITH this2 { .name } AS this2 RETURN collect(this2) AS var3 } - WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS var4 + RETURN var4 UNION WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this5 - CALL { - WITH this5 - CALL { - WITH this5 + CALL (this5) { + CALL (this5) { WITH this5 AS this MATCH (m:Movie {title: $param2}) RETURN m @@ -492,8 +476,8 @@ describe("Cypher directive on union", () => { WITH this5 { .name, movies: var7 } AS this5 RETURN collect(this5) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS var4 + RETURN var4 } RETURN var4 } @@ -539,49 +523,41 @@ describe("Cypher directive on union", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (n) WHERE (n:TVShow OR n:Movie) AND ($param0 IS NULL OR n.title = $param0) RETURN n } WITH n AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WHERE this2.name = $param1 WITH DISTINCT this2 WITH this2 { .name } AS this2 RETURN collect(this2) AS var3 } - WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var3, __resolveType: \\"Movie\\", __id: id(this0) } AS var4 + RETURN var4 UNION WITH * MATCH (this0) WHERE this0:TVShow - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (a:Actor) RETURN a } WITH a AS this5 - CALL { - WITH this5 - CALL { - WITH this5 + CALL (this5) { + CALL (this5) { WITH this5 AS this MATCH (m:Movie {title: $param2}) RETURN m @@ -593,8 +569,8 @@ describe("Cypher directive on union", () => { WITH this5 { .name, movies: var7 } AS this5 RETURN collect(this5) AS var8 } - WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .title, actors: var8, __resolveType: \\"TVShow\\", __id: id(this0) } AS var4 + RETURN var4 } RETURN var4 } diff --git a/packages/graphql/tests/tck/directives/cypher/cypher.test.ts b/packages/graphql/tests/tck/directives/cypher/cypher.test.ts index 950ea3ae26..e1443081b8 100644 --- a/packages/graphql/tests/tck/directives/cypher/cypher.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/cypher.test.ts @@ -115,10 +115,8 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (a:Actor) RETURN a @@ -147,10 +145,8 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN rand() as res } @@ -179,10 +175,8 @@ describe("Cypher directive", () => { MATCH (this:Actor) WITH * LIMIT $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN rand() as res } @@ -216,10 +210,8 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN rand() as res } @@ -262,19 +254,15 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (a:Actor) RETURN a } WITH a AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (m:Movie {title: $param0}) RETURN m @@ -322,37 +310,29 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (a:Actor) RETURN a } WITH a AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (m:Movie {title: $param0}) RETURN m } WITH m AS this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (a:Actor) RETURN a } WITH a AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (m:Movie {title: $param1}) RETURN m @@ -401,19 +381,15 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (a:Actor) RETURN a } WITH a AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (m:Movie {title: $param0}) RETURN m @@ -482,8 +458,7 @@ describe("Cypher directive", () => { RETURN m } WITH m AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH DISTINCT this2 WITH this2 { .name } AS this2 @@ -546,8 +521,7 @@ describe("Cypher directive", () => { RETURN m } WITH m AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH DISTINCT this2 WITH this2 { .name } AS this2 @@ -605,17 +579,14 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie {title: $param0}) RETURN m } WITH m AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH DISTINCT this2 WITH this2 { .name } AS this2 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-aggregation.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-aggregation.test.ts index ac876f546d..68e1624e42 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-aggregation.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-aggregation.test.ts @@ -61,10 +61,8 @@ describe("cypher directive filtering - Aggregation", () => { "CYPHER 5 CALL { MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as s @@ -129,10 +127,8 @@ describe("cypher directive filtering - Aggregation", () => { "CYPHER 5 CALL { MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as s @@ -198,10 +194,8 @@ describe("cypher directive filtering - Aggregation", () => { "CYPHER 5 CALL { MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as s @@ -267,10 +261,8 @@ describe("cypher directive filtering - Aggregation", () => { "CYPHER 5 CALL { MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as s diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-auth.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-auth.test.ts index 1d9a093b3f..0196233a4d 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-auth.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-auth.test.ts @@ -68,10 +68,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello\\" AS s } @@ -139,10 +137,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello\\" AS s } @@ -151,10 +147,8 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE ($isAuthenticated = true AND ($jwt.custom_value IS NOT NULL AND var1 IS NOT NULL AND var1 = $jwt.custom_value)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello\\" AS s } @@ -274,13 +268,10 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this RETURN \\"hello\\" AS s } @@ -352,10 +343,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello\\" AS s } @@ -425,10 +414,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field AS s diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-connect.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-connect.test.ts index d60a5d3ff5..d2a0f80179 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-connect.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-connect.test.ts @@ -78,7 +78,7 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * @@ -86,13 +86,11 @@ describe("cypher directive filtering", () => { SET this0_actors0_node.name = $this0_actors0_node_name MERGE (this0)<-[:ACTED_IN]-(this0_actors0_node) WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actors_connect0_node:Actor) - CALL { - WITH this0_actors_connect0_node - CALL { - WITH this0_actors_connect0_node + CALL (this0_actors_connect0_node) { + CALL (this0_actors_connect0_node) { WITH this0_actors_connect0_node AS this RETURN \\"hello world!\\" AS s } @@ -104,11 +102,9 @@ describe("cypher directive filtering", () => { ELSE [NULL] END AS aggregateWhereFiltervar0 WITH *, aggregateWhereFiltervar0[0] AS this0_actors_connect0_node - CALL { - WITH * + CALL(*) { WITH collect(this0_actors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actors_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_actors_connect0_node) @@ -119,10 +115,8 @@ describe("cypher directive filtering", () => { } RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ACTED_IN]-(create_this1:Actor) WITH DISTINCT create_this1 WITH create_this1 { .name } AS create_this1 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list-auth.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list-auth.test.ts index 0a1a591e2e..4b6de1d45f 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list-auth.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list-auth.test.ts @@ -69,10 +69,8 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -83,10 +81,8 @@ describe("cypher directive filtering - List Auth", () => { } WITH * WHERE ($isAuthenticated = true AND ($jwt.custom_value IS NOT NULL AND var2 IS NOT NULL AND $jwt.custom_value IN var2)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -156,10 +152,8 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -230,10 +224,8 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -244,10 +236,8 @@ describe("cypher directive filtering - List Auth", () => { } WITH * WHERE ($isAuthenticated = true AND ($jwt.custom_value IS NOT NULL AND var2 IS NOT NULL AND $jwt.custom_value IN var2)) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -371,13 +361,10 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this) RETURN this.custom_field as list @@ -452,10 +439,8 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN this.custom_field as list @@ -527,10 +512,8 @@ describe("cypher directive filtering - List Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this) RETURN ['a', 'b', 'c'] as list diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list.test.ts index df6c60f92a..93557634c9 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-list.test.ts @@ -52,10 +52,8 @@ describe("cypher directive filtering - Lists", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN ['a', 'b', 'c'] as list } diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-misc.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-misc.test.ts index 009a5aba99..97eefcb823 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-misc.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-misc.test.ts @@ -64,10 +64,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } @@ -79,18 +77,15 @@ describe("cypher directive filtering - Auth", () => { MATCH (this)<-[:ACTED_IN]-(this2:Actor) WHERE this2.name = $param1 }) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } WITH s AS this3 RETURN this3 AS var4 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this5:ACTED_IN]-(this6:Actor) WITH DISTINCT this6 WITH this6 { .name } AS this6 @@ -147,14 +142,11 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH DISTINCT this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this RETURN \\"hello world!\\" AS s } @@ -216,10 +208,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } @@ -228,8 +218,7 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE var1 = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Actor) WHERE this3.name = $param1 WITH DISTINCT this3 @@ -301,20 +290,16 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } WITH s AS this0 RETURN this0 AS var1 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN 100 AS i } @@ -323,8 +308,7 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE (var1 = $param0 AND var3 > $param1) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this4:ACTED_IN]-(this5:Actor) WITH DISTINCT this5 WITH this5 { .name } AS this5 @@ -391,10 +375,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } @@ -403,14 +385,11 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE var1 = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Actor) WITH DISTINCT this3 - CALL { - WITH this3 - CALL { - WITH this3 + CALL (this3) { + CALL (this3) { WITH this3 AS this RETURN \\"goodbye!\\" AS s } diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-one-to-one-relationship.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-one-to-one-relationship.test.ts index 7bd0208cba..78e4f9bf1c 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-one-to-one-relationship.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-one-to-one-relationship.test.ts @@ -67,10 +67,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:ACTED_IN]->(actor:Actor) RETURN actor @@ -136,10 +134,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:ACTED_IN]->(actor:Actor) RETURN actor @@ -214,10 +210,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -227,10 +221,8 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.name = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -294,10 +286,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -365,10 +355,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -452,10 +440,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -465,19 +451,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -486,10 +468,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -576,10 +556,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -589,19 +567,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -610,10 +584,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -701,10 +673,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -714,19 +684,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -735,10 +701,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -826,10 +790,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -839,19 +801,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -860,10 +818,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -952,10 +908,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -965,19 +919,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -986,10 +936,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1078,10 +1026,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1091,19 +1037,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1112,10 +1054,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1203,10 +1143,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1216,19 +1154,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1237,10 +1171,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1328,10 +1260,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1341,19 +1271,15 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1362,10 +1288,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this3 { .name } AS this3 RETURN head(collect(this3)) AS var4 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1454,10 +1378,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie @@ -1467,27 +1389,21 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE this1.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:DIRECTED]->(movie:Movie) RETURN movie } WITH movie AS this2 - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this3:ACTED_IN]-(this4:Person) WITH DISTINCT this4 - CALL { - WITH this4 + CALL (this4) { MATCH (this4)-[this5:ACTED_IN]->(this6:Movie) WITH DISTINCT this6 - CALL { - WITH this6 - CALL { - WITH this6 + CALL (this6) { + CALL (this6) { WITH this6 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1502,10 +1418,8 @@ describe("cypher directive filtering - One To One Relationship", () => { WITH this4 { .name, movies: var9 } AS this4 RETURN collect(this4) AS var10 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1581,10 +1495,8 @@ describe("cypher directive filtering - One To One Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:DIRECTED]-(director:Person) RETURN director @@ -1594,13 +1506,11 @@ describe("cypher directive filtering - One To One Relationship", () => { } WITH * WHERE (this.title ENDS WITH $param0 AND this1.name = $param1) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Person) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 RETURN collect({ node: { name: this3.name, __resolveType: \\"Person\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-scalar.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-scalar.test.ts index 7a399b05f5..3f8421f36d 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-scalar.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-scalar.test.ts @@ -53,10 +53,8 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -66,10 +64,8 @@ describe("cypher directive filtering", () => { } WITH * WHERE (this.title = $param0 AND var1 >= $param1) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -123,10 +119,8 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -136,10 +130,8 @@ describe("cypher directive filtering", () => { } WITH * WHERE (this.title = $param0 AND var1 >= $param1) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c @@ -193,10 +185,8 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie) RETURN count(m) as c diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-sorting.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-sorting.test.ts index c1acbcb76f..72e7029559 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-sorting.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-sorting.test.ts @@ -62,10 +62,8 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this WITH this RETURN this.title AS s @@ -75,10 +73,8 @@ describe("cypher directive filtering", () => { } WITH * WHERE var1 STARTS WITH $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this WITH this RETURN this.title AS s @@ -88,8 +84,7 @@ describe("cypher directive filtering", () => { } WITH * ORDER BY var3 DESC - CALL { - WITH this + CALL (this) { MATCH (this)<-[this4:ACTED_IN]-(this5:Actor) WITH DISTINCT this5 WITH this5 { .name } AS this5 @@ -145,10 +140,8 @@ describe("cypher directive filtering", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN \\"hello world!\\" AS s } @@ -159,8 +152,7 @@ describe("cypher directive filtering", () => { WHERE var1 = $param0 WITH * ORDER BY this.title DESC - CALL { - WITH this + CALL (this) { MATCH (this)<-[this2:ACTED_IN]-(this3:Actor) WITH DISTINCT this3 WITH this3 { .name } AS this3 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-spatial.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-spatial.test.ts index 6090e13245..47956159a7 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-spatial.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-spatial.test.ts @@ -56,10 +56,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN point({ longitude: 1.0, latitude: 1.0 }) AS l } @@ -68,10 +66,8 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE point.distance(var1, point($param0.point)) = $param0.distance - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN point({ longitude: 1.0, latitude: 1.0 }) AS l } @@ -130,10 +126,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN point({ x: 1.0, y: 1.0, z: 1.0 }) AS l } @@ -142,10 +136,8 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE point.distance(var1, point($param0.point)) = $param0.distance - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN point({ x: 1.0, y: 1.0, z: 1.0 }) AS l } diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-temporal.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-temporal.test.ts index 12e93dd912..8a2f52df4b 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-temporal.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/cypher-filtering-temporal.test.ts @@ -53,10 +53,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN datetime(\\"2024-09-03T15:30:00Z\\") AS t } @@ -65,10 +63,8 @@ describe("cypher directive filtering - Auth", () => { } WITH * WHERE var1 > datetime($param0) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN datetime(\\"2024-09-03T15:30:00Z\\") AS t } @@ -115,10 +111,8 @@ describe("cypher directive filtering - Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN duration('P14DT16H12M') AS d } diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-auth.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-auth.test.ts index cfe15f0f29..9754900571 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-auth.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-auth.test.ts @@ -82,10 +82,8 @@ describe("cypher directive filtering - relationship auth filter", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -97,8 +95,7 @@ describe("cypher directive filtering - relationship auth filter", () => { WHERE (this0.rating < $param0 AND ($isAuthenticated = true AND any(this3 IN this2 WHERE ($jwt.custom_value IS NOT NULL AND this3.name = $jwt.custom_value)))) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -177,10 +174,8 @@ describe("cypher directive filtering - relationship auth filter", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -192,8 +187,7 @@ describe("cypher directive filtering - relationship auth filter", () => { WHERE (this0.rating < $param0 AND ($isAuthenticated = true AND any(this3 IN this2 WHERE ($jwt.custom_value IS NOT NULL AND this3.name = $jwt.custom_value)))) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -272,10 +266,8 @@ describe("cypher directive filtering - relationship auth filter", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -288,8 +280,7 @@ describe("cypher directive filtering - relationship auth filter", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND any(this3 IN this2 WHERE ($jwt.custom_value IS NOT NULL AND this3.name = $jwt.custom_value))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -368,10 +359,8 @@ describe("cypher directive filtering - relationship auth filter", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -384,8 +373,7 @@ describe("cypher directive filtering - relationship auth filter", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND any(this3 IN this2 WHERE ($jwt.custom_value IS NOT NULL AND this3.name = $jwt.custom_value))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-connection.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-connection.test.ts index dcc2eb717f..f20598429c 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-connection.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship-connection.test.ts @@ -69,10 +69,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -84,8 +82,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE NOT (any(this3 IN this2 WHERE this3.name = $param0)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -147,10 +144,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -162,8 +157,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE all(this3 IN this2 WHERE this3.name = $param0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -225,10 +219,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -240,8 +232,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE single(this3 IN this2 WHERE this3.name = $param0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -303,10 +294,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -318,8 +307,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE any(this3 IN this2 WHERE this3.name = $param0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -381,10 +369,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -396,8 +382,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE any(this3 IN this2 WHERE this3.name = $param0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * @@ -461,10 +446,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -476,8 +459,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE none(this3 IN this2 WHERE this3.name = $param0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -566,10 +548,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -577,10 +557,8 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WITH actor AS this1 RETURN collect(this1) AS this2 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:IN_GENRE]->(g:Genre) RETURN g @@ -592,8 +570,7 @@ describe("Connection API - cypher directive filtering - Relationship", () => { WHERE (any(this5 IN this2 WHERE this5.name = $param0) OR any(this6 IN this4 WHERE this6.name = $param1)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var7 diff --git a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship.test.ts b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship.test.ts index 143184bbf8..646c8ef23e 100644 --- a/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship.test.ts +++ b/packages/graphql/tests/tck/directives/cypher/filtering/relationships/cypher-filtering-relationship.test.ts @@ -65,10 +65,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -131,10 +129,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -197,10 +193,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -263,10 +257,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -328,10 +320,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -421,10 +411,8 @@ describe("cypher directive filtering - Relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN actor @@ -432,10 +420,8 @@ describe("cypher directive filtering - Relationship", () => { WITH actor AS this0 RETURN collect(this0) AS this1 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:IN_GENRE]->(g:Genre) RETURN g diff --git a/packages/graphql/tests/tck/directives/interface-relationships/create/connect.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/create/connect.test.ts index 1d525fe249..52a5788b5b 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/create/connect.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/create/connect.test.ts @@ -91,19 +91,17 @@ describe("Interface Relationships - Create connect", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect0_node:Movie) WHERE this0_actedIn_connect0_node.title STARTS WITH $this0_actedIn_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect0_node CREATE (this0)-[this0_actedIn_connect0_relationship:ACTED_IN]->(this0_actedIn_connect0_node) @@ -113,15 +111,13 @@ describe("Interface Relationships - Create connect", () => { WITH this0, this0_actedIn_connect0_node RETURN count(*) AS connect_this0_actedIn_connect_Movie0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect1_node:Series) WHERE this0_actedIn_connect1_node.title STARTS WITH $this0_actedIn_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect1_node CREATE (this0)-[this0_actedIn_connect1_relationship:ACTED_IN]->(this0_actedIn_connect1_node) @@ -133,20 +129,18 @@ describe("Interface Relationships - Create connect", () => { } RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)-[create_this0:ACTED_IN]->(create_this1:Movie) - WITH create_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)-[create_this3:ACTED_IN]->(create_this4:Series) - WITH create_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 diff --git a/packages/graphql/tests/tck/directives/interface-relationships/create/create.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/create/create.test.ts index ffcec5a758..5cc582224c 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/create/create.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/create/create.test.ts @@ -91,7 +91,7 @@ describe("Interface Relationships - Create create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * @@ -102,20 +102,18 @@ describe("Interface Relationships - Create create", () => { SET this0_actedInMovie0_relationship.screenTime = $this0_actedInMovie0_relationship_screenTime RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)-[create_this0:ACTED_IN]->(create_this1:Movie) - WITH create_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)-[create_this3:ACTED_IN]->(create_this4:Series) - WITH create_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 diff --git a/packages/graphql/tests/tck/directives/interface-relationships/delete/delete.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/delete/delete.test.ts index 3d48f22835..ad802d7c21 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/delete/delete.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/delete/delete.test.ts @@ -74,24 +74,20 @@ describe("Interface Relationships - Delete delete", () => { "CYPHER 5 MATCH (this:Actor) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title STARTS WITH $param0 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE this5.title STARTS WITH $param1 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -131,48 +127,40 @@ describe("Interface Relationships - Delete delete", () => { "CYPHER 5 MATCH (this:Actor) WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title STARTS WITH $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) WHERE this3.name = $param1 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this8:ACTED_IN]->(this9:Series) WHERE this9.title STARTS WITH $param2 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this9)<-[this10:ACTED_IN]-(this11:Actor) WHERE this11.name = $param3 WITH this10, collect(DISTINCT this11) AS var12 - CALL { - WITH var12 + CALL (var12) { UNWIND var12 AS var13 DETACH DELETE var13 } } WITH this8, collect(DISTINCT this9) AS var14 - CALL { - WITH var14 + CALL (var14) { UNWIND var14 AS var15 DETACH DELETE var15 } diff --git a/packages/graphql/tests/tck/directives/interface-relationships/read.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/read.test.ts index 763379733a..d865530636 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/read.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/read.test.ts @@ -77,18 +77,17 @@ describe("Interface Relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) - WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -121,18 +120,17 @@ describe("Interface Relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) - WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 ORDER BY var2.title DESC @@ -186,10 +184,8 @@ describe("Interface Relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) @@ -244,10 +240,8 @@ describe("Interface Relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) diff --git a/packages/graphql/tests/tck/directives/interface-relationships/update/connect.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/update/connect.test.ts index a17ee1c544..6786c1b61e 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/update/connect.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/update/connect.test.ts @@ -81,18 +81,15 @@ describe("Interface Relationships - Update connect", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actedIn0_connect0_node:Movie) WHERE this_actedIn0_connect0_node.title STARTS WITH $this_actedIn0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actedIn0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actedIn0_connect0_node CREATE (this)-[this_actedIn0_connect0_relationship:ACTED_IN]->(this_actedIn0_connect0_node) @@ -104,18 +101,15 @@ describe("Interface Relationships - Update connect", () => { } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actedIn0_connect0_node:Series) WHERE this_actedIn0_connect0_node.title STARTS WITH $this_actedIn0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actedIn0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actedIn0_connect0_node CREATE (this)-[this_actedIn0_connect0_relationship:ACTED_IN]->(this_actedIn0_connect0_node) @@ -174,18 +168,15 @@ describe("Interface Relationships - Update connect", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actedIn0_connect0_node:Movie) WHERE this_actedIn0_connect0_node.title STARTS WITH $this_actedIn0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actedIn0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actedIn0_connect0_node CREATE (this)-[this_actedIn0_connect0_relationship:ACTED_IN]->(this_actedIn0_connect0_node) @@ -193,15 +184,13 @@ describe("Interface Relationships - Update connect", () => { } } WITH this, this_actedIn0_connect0_node - CALL { + CALL(*) { WITH this, this_actedIn0_connect0_node OPTIONAL MATCH (this_actedIn0_connect0_node_actors0_node:Actor) WHERE this_actedIn0_connect0_node_actors0_node.name = $this_actedIn0_connect0_node_actors0_node_param0 - CALL { - WITH * + CALL(*) { WITH this, collect(this_actedIn0_connect0_node_actors0_node) as connectedNodes, collect(this_actedIn0_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_actedIn0_connect0_node UNWIND connectedNodes as this_actedIn0_connect0_node_actors0_node CREATE (this_actedIn0_connect0_node)<-[this_actedIn0_connect0_node_actors0_relationship:ACTED_IN]-(this_actedIn0_connect0_node_actors0_node) @@ -215,18 +204,15 @@ describe("Interface Relationships - Update connect", () => { } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actedIn0_connect0_node:Series) WHERE this_actedIn0_connect0_node.title STARTS WITH $this_actedIn0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actedIn0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actedIn0_connect0_node CREATE (this)-[this_actedIn0_connect0_relationship:ACTED_IN]->(this_actedIn0_connect0_node) @@ -234,15 +220,13 @@ describe("Interface Relationships - Update connect", () => { } } WITH this, this_actedIn0_connect0_node - CALL { + CALL(*) { WITH this, this_actedIn0_connect0_node OPTIONAL MATCH (this_actedIn0_connect0_node_actors0_node:Actor) WHERE this_actedIn0_connect0_node_actors0_node.name = $this_actedIn0_connect0_node_actors0_node_param0 - CALL { - WITH * + CALL(*) { WITH this, collect(this_actedIn0_connect0_node_actors0_node) as connectedNodes, collect(this_actedIn0_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_actedIn0_connect0_node UNWIND connectedNodes as this_actedIn0_connect0_node_actors0_node CREATE (this_actedIn0_connect0_node)<-[this_actedIn0_connect0_node_actors0_relationship:ACTED_IN]-(this_actedIn0_connect0_node_actors0_node) diff --git a/packages/graphql/tests/tck/directives/interface-relationships/update/create.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/update/create.test.ts index 7650b36864..2fd7c34d93 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/update/create.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/update/create.test.ts @@ -90,8 +90,7 @@ describe("Interface Relationships - Update create", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this CREATE (this_actedIn0_create0_node:Movie) SET this_actedIn0_create0_node.title = $this_actedIn0_create0_node_title @@ -100,24 +99,22 @@ describe("Interface Relationships - Update create", () => { SET this_actedIn0_create0_relationship.screenTime = $updateActors.args.update.actedIn[0].create[0].edge.screenTime RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH this RETURN count(*) AS update_this_Series } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) - WITH update_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var2 + WITH update_this1 { .title, .runtime, __resolveType: \\"Movie\\", __id: id(update_this1) } AS update_var2 + RETURN update_var2 UNION WITH * MATCH (this)-[update_this3:ACTED_IN]->(update_this4:Series) - WITH update_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(update_this4) } AS update_this4 - RETURN update_this4 AS update_var2 + WITH update_this4 { .title, .episodes, __resolveType: \\"Series\\", __id: id(update_this4) } AS update_var2 + RETURN update_var2 } WITH update_var2 RETURN collect(update_var2) AS update_var2 diff --git a/packages/graphql/tests/tck/directives/interface-relationships/update/delete.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/update/delete.test.ts index f59d8b0ae9..925868fd35 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/update/delete.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/update/delete.test.ts @@ -75,56 +75,46 @@ describe("Interface Relationships - Update delete", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this - WITH * - CALL { + CALL (this) { WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Movie) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Series) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Movie) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Series) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } @@ -189,104 +179,86 @@ describe("Interface Relationships - Update delete", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this - WITH * - CALL { + CALL (this) { WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Movie) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_actedIn0_delete0)<-[this_actedIn0_delete0_actors0_relationship:ACTED_IN]-(this_actedIn0_delete0_actors0:Actor) WHERE this_actedIn0_delete0_actors0.name = $updateActors_args_update_actedIn0_delete0_delete_actors0_where_this_actedIn0_delete0_actors0param0 WITH this_actedIn0_delete0_actors0_relationship, collect(DISTINCT this_actedIn0_delete0_actors0) AS this_actedIn0_delete0_actors0_to_delete - CALL { - WITH this_actedIn0_delete0_actors0_to_delete + CALL(this_actedIn0_delete0_actors0_to_delete) { UNWIND this_actedIn0_delete0_actors0_to_delete AS x DETACH DELETE x } } WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Series) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_actedIn0_delete0)<-[this_actedIn0_delete0_actors0_relationship:ACTED_IN]-(this_actedIn0_delete0_actors0:Actor) WHERE this_actedIn0_delete0_actors0.name = $updateActors_args_update_actedIn0_delete0_delete_actors0_where_this_actedIn0_delete0_actors0param0 WITH this_actedIn0_delete0_actors0_relationship, collect(DISTINCT this_actedIn0_delete0_actors0) AS this_actedIn0_delete0_actors0_to_delete - CALL { - WITH this_actedIn0_delete0_actors0_to_delete + CALL(this_actedIn0_delete0_actors0_to_delete) { UNWIND this_actedIn0_delete0_actors0_to_delete AS x DETACH DELETE x } } WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Movie) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_actedIn0_delete0)<-[this_actedIn0_delete0_actors0_relationship:ACTED_IN]-(this_actedIn0_delete0_actors0:Actor) WHERE this_actedIn0_delete0_actors0.name = $updateActors_args_update_actedIn0_delete0_delete_actors0_where_this_actedIn0_delete0_actors0param0 WITH this_actedIn0_delete0_actors0_relationship, collect(DISTINCT this_actedIn0_delete0_actors0) AS this_actedIn0_delete0_actors0_to_delete - CALL { - WITH this_actedIn0_delete0_actors0_to_delete + CALL(this_actedIn0_delete0_actors0_to_delete) { UNWIND this_actedIn0_delete0_actors0_to_delete AS x DETACH DELETE x } } WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_actedIn0_delete0_relationship:ACTED_IN]->(this_actedIn0_delete0:Series) WHERE this_actedIn0_delete0.title STARTS WITH $updateActors_args_update_actedIn0_delete0_where_this_actedIn0_delete0param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_actedIn0_delete0)<-[this_actedIn0_delete0_actors0_relationship:ACTED_IN]-(this_actedIn0_delete0_actors0:Actor) WHERE this_actedIn0_delete0_actors0.name = $updateActors_args_update_actedIn0_delete0_delete_actors0_where_this_actedIn0_delete0_actors0param0 WITH this_actedIn0_delete0_actors0_relationship, collect(DISTINCT this_actedIn0_delete0_actors0) AS this_actedIn0_delete0_actors0_to_delete - CALL { - WITH this_actedIn0_delete0_actors0_to_delete + CALL(this_actedIn0_delete0_actors0_to_delete) { UNWIND this_actedIn0_delete0_actors0_to_delete AS x DETACH DELETE x } } WITH this_actedIn0_delete0_relationship, collect(DISTINCT this_actedIn0_delete0) AS this_actedIn0_delete0_to_delete - CALL { - WITH this_actedIn0_delete0_to_delete + CALL(this_actedIn0_delete0_to_delete) { UNWIND this_actedIn0_delete0_to_delete AS x DETACH DELETE x } diff --git a/packages/graphql/tests/tck/directives/interface-relationships/update/disconnect.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/update/disconnect.test.ts index 9020475dba..53c98df23c 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/update/disconnect.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/update/disconnect.test.ts @@ -77,34 +77,30 @@ describe("Interface Relationships - Update disconnect", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_actedIn0_disconnect0_rel:ACTED_IN]->(this_actedIn0_disconnect0:Movie) WHERE this_actedIn0_disconnect0.title STARTS WITH $updateActors_args_update_actedIn0_disconnect0_where_Movie_this_actedIn0_disconnect0param0 - CALL { - WITH this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - UNWIND this_actedIn0_disconnect0 as x + CALL (this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this) { + WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0_x, this_actedIn0_disconnect0_rel, this + UNWIND this_actedIn0_disconnect0_x as x DELETE this_actedIn0_disconnect0_rel } RETURN count(*) AS disconnect_this_actedIn0_disconnect_Movie } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_actedIn0_disconnect0_rel:ACTED_IN]->(this_actedIn0_disconnect0:Series) WHERE this_actedIn0_disconnect0.title STARTS WITH $updateActors_args_update_actedIn0_disconnect0_where_Series_this_actedIn0_disconnect0param0 - CALL { - WITH this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - UNWIND this_actedIn0_disconnect0 as x + CALL (this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this) { + WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0_x, this_actedIn0_disconnect0_rel, this + UNWIND this_actedIn0_disconnect0_x as x DELETE this_actedIn0_disconnect0_rel } RETURN count(*) AS disconnect_this_actedIn0_disconnect_Series @@ -170,27 +166,24 @@ describe("Interface Relationships - Update disconnect", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_actedIn0_disconnect0_rel:ACTED_IN]->(this_actedIn0_disconnect0:Movie) WHERE this_actedIn0_disconnect0.title STARTS WITH $updateActors_args_update_actedIn0_disconnect0_where_Movie_this_actedIn0_disconnect0param0 - CALL { - WITH this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - UNWIND this_actedIn0_disconnect0 as x + CALL (this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this) { + WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0_x, this_actedIn0_disconnect0_rel, this + UNWIND this_actedIn0_disconnect0_x as x DELETE this_actedIn0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_actedIn0_disconnect0 OPTIONAL MATCH (this_actedIn0_disconnect0)<-[this_actedIn0_disconnect0_actors0_rel:ACTED_IN]-(this_actedIn0_disconnect0_actors0:Actor) WHERE this_actedIn0_disconnect0_actors0.name = $updateActors_args_update_actedIn0_disconnect0_disconnect_actors0_where_Actor_this_actedIn0_disconnect0_actors0param0 - CALL { - WITH this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 - WITH collect(this_actedIn0_disconnect0_actors0) as this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 - UNWIND this_actedIn0_disconnect0_actors0 as x + CALL (this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0) { + WITH collect(this_actedIn0_disconnect0_actors0) as this_actedIn0_disconnect0_actors0_x, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 + UNWIND this_actedIn0_disconnect0_actors0_x as x DELETE this_actedIn0_disconnect0_actors0_rel } RETURN count(*) AS disconnect_this_actedIn0_disconnect0_actors_Actor @@ -199,27 +192,24 @@ describe("Interface Relationships - Update disconnect", () => { } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_actedIn0_disconnect0_rel:ACTED_IN]->(this_actedIn0_disconnect0:Series) WHERE this_actedIn0_disconnect0.title STARTS WITH $updateActors_args_update_actedIn0_disconnect0_where_Series_this_actedIn0_disconnect0param0 - CALL { - WITH this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this - UNWIND this_actedIn0_disconnect0 as x + CALL (this_actedIn0_disconnect0, this_actedIn0_disconnect0_rel, this) { + WITH collect(this_actedIn0_disconnect0) as this_actedIn0_disconnect0_x, this_actedIn0_disconnect0_rel, this + UNWIND this_actedIn0_disconnect0_x as x DELETE this_actedIn0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_actedIn0_disconnect0 OPTIONAL MATCH (this_actedIn0_disconnect0)<-[this_actedIn0_disconnect0_actors0_rel:ACTED_IN]-(this_actedIn0_disconnect0_actors0:Actor) WHERE this_actedIn0_disconnect0_actors0.name = $updateActors_args_update_actedIn0_disconnect0_disconnect_actors0_where_Actor_this_actedIn0_disconnect0_actors0param0 - CALL { - WITH this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 - WITH collect(this_actedIn0_disconnect0_actors0) as this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 - UNWIND this_actedIn0_disconnect0_actors0 as x + CALL (this_actedIn0_disconnect0_actors0, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0) { + WITH collect(this_actedIn0_disconnect0_actors0) as this_actedIn0_disconnect0_actors0_x, this_actedIn0_disconnect0_actors0_rel, this_actedIn0_disconnect0 + UNWIND this_actedIn0_disconnect0_actors0_x as x DELETE this_actedIn0_disconnect0_actors0_rel } RETURN count(*) AS disconnect_this_actedIn0_disconnect0_actors_Actor diff --git a/packages/graphql/tests/tck/directives/interface-relationships/update/update.test.ts b/packages/graphql/tests/tck/directives/interface-relationships/update/update.test.ts index 97dde03702..46ad6c4030 100644 --- a/packages/graphql/tests/tck/directives/interface-relationships/update/update.test.ts +++ b/packages/graphql/tests/tck/directives/interface-relationships/update/update.test.ts @@ -84,10 +84,9 @@ describe("Interface Relationships - Update update", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) WHERE this_actedIn0.title = $updateActors_args_update_actedIn0_where_this_actedIn0param0 @@ -96,10 +95,9 @@ describe("Interface Relationships - Update update", () => { } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Series) WHERE this_actedIn0.title = $updateActors_args_update_actedIn0_where_this_actedIn0param0 @@ -168,15 +166,14 @@ describe("Interface Relationships - Update update", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) WHERE this_actedIn0.title = $updateActors_args_update_actedIn0_where_this_actedIn0param0 WITH this, this_actedIn0 - CALL { + CALL(*) { WITH this, this_actedIn0 MATCH (this_actedIn0)<-[this_actedIn0_acted_in0_relationship:ACTED_IN]-(this_actedIn0_actors0:Actor) SET this_actedIn0_actors0.name = $this_update_actedIn0_actors0_name_SET @@ -186,15 +183,14 @@ describe("Interface Relationships - Update update", () => { } RETURN count(*) AS update_this_Movie } - CALL { - WITH this + CALL (this){ WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Series) WHERE this_actedIn0.title = $updateActors_args_update_actedIn0_where_this_actedIn0param0 WITH this, this_actedIn0 - CALL { + CALL(*) { WITH this, this_actedIn0 MATCH (this_actedIn0)<-[this_actedIn0_acted_in0_relationship:ACTED_IN]-(this_actedIn0_actors0:Actor) SET this_actedIn0_actors0.name = $this_update_actedIn0_actors0_name_SET diff --git a/packages/graphql/tests/tck/directives/node/node-additional-labels.test.ts b/packages/graphql/tests/tck/directives/node/node-additional-labels.test.ts index 0074d93355..9377454489 100644 --- a/packages/graphql/tests/tck/directives/node/node-additional-labels.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-additional-labels.test.ts @@ -80,8 +80,7 @@ describe("Node directive with additionalLabels", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Film:Multimedia) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor:Person) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -114,14 +113,12 @@ describe("Node directive with additionalLabels", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Film:Multimedia) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor:Person) SET diff --git a/packages/graphql/tests/tck/directives/node/node-label-interface.test.ts b/packages/graphql/tests/tck/directives/node/node-label-interface.test.ts index 6a117c2da3..dc3d938bc5 100644 --- a/packages/graphql/tests/tck/directives/node/node-label-interface.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-label-interface.test.ts @@ -68,20 +68,19 @@ describe("Node directive with interface", () => { "CYPHER 5 MATCH (this:Film) WHERE this.title = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Category:ExtraLabel1:ExtraLabel2) WHERE this1.name = $param1 - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Film) WHERE this4.name = $param2 - WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 SKIP $param3 diff --git a/packages/graphql/tests/tck/directives/node/node-label-jwt.test.ts b/packages/graphql/tests/tck/directives/node/node-label-jwt.test.ts index ad17cc8f21..4acd578fdf 100644 --- a/packages/graphql/tests/tck/directives/node/node-label-jwt.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-label-jwt.test.ts @@ -87,8 +87,7 @@ describe("Label in Node directive", () => { "CYPHER 5 MATCH (this:Actor:Person) WHERE this.age > $param0 - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Film) WHERE this1.title = $param1 WITH DISTINCT this1 @@ -126,8 +125,7 @@ describe("Label in Node directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Film) SET create_this1.title = create_var0.title diff --git a/packages/graphql/tests/tck/directives/node/node-label-union.test.ts b/packages/graphql/tests/tck/directives/node/node-label-union.test.ts index 3812cb3203..5f58d58eb8 100644 --- a/packages/graphql/tests/tck/directives/node/node-label-union.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-label-union.test.ts @@ -69,20 +69,19 @@ describe("Node directive with unions", () => { "CYPHER 5 MATCH (this:Film) WHERE this.title = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Category:ExtraLabel1:ExtraLabel2) WHERE this1.name = $param1 - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Film) WHERE this4.title = $param2 - WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 SKIP $param3 diff --git a/packages/graphql/tests/tck/directives/node/node-label.test.ts b/packages/graphql/tests/tck/directives/node/node-label.test.ts index c59db40037..ea2b018dd6 100644 --- a/packages/graphql/tests/tck/directives/node/node-label.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-label.test.ts @@ -80,8 +80,7 @@ describe("Label in Node directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Film) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -114,13 +113,11 @@ describe("Label in Node directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Film) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 @@ -149,8 +146,7 @@ describe("Label in Node directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Film) SET create_this1.id = create_var0.id @@ -191,14 +187,12 @@ describe("Label in Node directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Film) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Person) SET @@ -303,7 +297,7 @@ describe("Label in Node directive", () => { MATCH (this:Film) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Person) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 @@ -366,15 +360,13 @@ describe("Label in Node directive", () => { MATCH (this:Film) WHERE this.id = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect0_node:Person) WHERE this_actors0_connect0_node.name = $this_actors0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect0_node CREATE (this)<-[:ACTED_IN]-(this_actors0_connect0_node) @@ -416,14 +408,13 @@ describe("Label in Node directive", () => { MATCH (this:Film) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_actors0_disconnect0_rel:ACTED_IN]-(this_actors0_disconnect0:Person) WHERE this_actors0_disconnect0.name = $updateMovies_args_update_actors0_disconnect0_where_Actor_this_actors0_disconnect0param0 - CALL { - WITH this_actors0_disconnect0, this_actors0_disconnect0_rel, this - WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0, this_actors0_disconnect0_rel, this - UNWIND this_actors0_disconnect0 as x + CALL (this_actors0_disconnect0, this_actors0_disconnect0_rel, this) { + WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0_x, this_actors0_disconnect0_rel, this + UNWIND this_actors0_disconnect0_x as x DELETE this_actors0_disconnect0_rel } RETURN count(*) AS disconnect_this_actors0_disconnect_Actor @@ -505,13 +496,11 @@ describe("Label in Node directive", () => { MATCH (this:Film) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } diff --git a/packages/graphql/tests/tck/directives/node/node-with-auth-projection.test.ts b/packages/graphql/tests/tck/directives/node/node-with-auth-projection.test.ts index 3f1de32bff..51632e8024 100644 --- a/packages/graphql/tests/tck/directives/node/node-with-auth-projection.test.ts +++ b/packages/graphql/tests/tck/directives/node/node-with-auth-projection.test.ts @@ -78,8 +78,7 @@ describe("Cypher Auth Projection On Connections", () => { MATCH (this:Person) WITH * CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_POST]->(this1:Comment) CALL apoc.util.validate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:HAS_POST]-(this2:Person) @@ -87,8 +86,7 @@ describe("Cypher Auth Projection On Connections", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { content: this1.content, __resolveType: \\"Post\\" } }) AS var3 diff --git a/packages/graphql/tests/tck/directives/plural.test.ts b/packages/graphql/tests/tck/directives/plural.test.ts index 0e62101dda..cf5d1da62e 100644 --- a/packages/graphql/tests/tck/directives/plural.test.ts +++ b/packages/graphql/tests/tck/directives/plural.test.ts @@ -99,8 +99,7 @@ describe("Plural directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Tech) SET create_this1.name = create_var0.name diff --git a/packages/graphql/tests/tck/directives/relationship.test.ts b/packages/graphql/tests/tck/directives/relationship.test.ts index acae1abca6..a74b4761de 100644 --- a/packages/graphql/tests/tck/directives/relationship.test.ts +++ b/packages/graphql/tests/tck/directives/relationship.test.ts @@ -66,8 +66,7 @@ describe("Cypher relationship", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 WITH this1 { .name } AS this1 diff --git a/packages/graphql/tests/tck/directives/vector/auth.test.ts b/packages/graphql/tests/tck/directives/vector/auth.test.ts index 516108de8a..773a7424d6 100644 --- a/packages/graphql/tests/tck/directives/vector/auth.test.ts +++ b/packages/graphql/tests/tck/directives/vector/auth.test.ts @@ -93,8 +93,7 @@ describe("Cypher -> vector -> Auth", () => { })) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -294,8 +293,7 @@ describe("Cypher -> vector -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -500,8 +498,7 @@ describe("Cypher -> vector -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -705,8 +702,7 @@ describe("Cypher -> vector -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -916,8 +912,7 @@ describe("Cypher -> vector -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -1125,8 +1120,7 @@ describe("Cypher -> vector -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -1334,8 +1328,7 @@ describe("Cypher -> vector -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/directives/vector/match.test.ts b/packages/graphql/tests/tck/directives/vector/match.test.ts index 92efe42df9..a4e0933da7 100644 --- a/packages/graphql/tests/tck/directives/vector/match.test.ts +++ b/packages/graphql/tests/tck/directives/vector/match.test.ts @@ -80,8 +80,7 @@ describe("Vector index match", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -254,8 +253,7 @@ describe("Vector index match", () => { WHERE ($param1 IN labels(this0) AND this0.released > $param2) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, released: this0.released, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -430,8 +428,7 @@ describe("Vector index match", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * diff --git a/packages/graphql/tests/tck/directives/vector/phrase.test.ts b/packages/graphql/tests/tck/directives/vector/phrase.test.ts index 7695c0de1c..17ad35d6e1 100644 --- a/packages/graphql/tests/tck/directives/vector/phrase.test.ts +++ b/packages/graphql/tests/tck/directives/vector/phrase.test.ts @@ -91,8 +91,7 @@ describe("phrase input - genAI plugin", () => { WHERE $param1 IN labels(this1) WITH collect({ node: this1, score: var2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.score AS var2 RETURN collect({ node: { title: this1.title, __resolveType: \\"Movie\\" }, score: var2 }) AS var3 diff --git a/packages/graphql/tests/tck/directives/vector/score.test.ts b/packages/graphql/tests/tck/directives/vector/score.test.ts index bb5972a865..7b4500d8ec 100644 --- a/packages/graphql/tests/tck/directives/vector/score.test.ts +++ b/packages/graphql/tests/tck/directives/vector/score.test.ts @@ -78,8 +78,7 @@ describe("Cypher -> vector -> Score", () => { WHERE ($param1 IN labels(this0) AND var1 >= $param2) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -251,8 +250,7 @@ describe("Cypher -> vector -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * @@ -425,8 +423,7 @@ describe("Cypher -> vector -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * diff --git a/packages/graphql/tests/tck/disable-escaping.test.ts b/packages/graphql/tests/tck/disable-escaping.test.ts index 58f210237d..7a546a2786 100644 --- a/packages/graphql/tests/tck/disable-escaping.test.ts +++ b/packages/graphql/tests/tck/disable-escaping.test.ts @@ -61,8 +61,7 @@ describe("Disable escaping", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:\`Movie:Film\`) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN|PATICIPATED]-(this1:Actor) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -98,8 +97,7 @@ describe("Disable escaping", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie:Film) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:\`ACTED_IN|PATICIPATED\`]-(this1:Actor) WITH DISTINCT this1 WITH this1 { .name } AS this1 diff --git a/packages/graphql/tests/tck/federation/authorization.test.ts b/packages/graphql/tests/tck/federation/authorization.test.ts index b64e228180..149452d345 100644 --- a/packages/graphql/tests/tck/federation/authorization.test.ts +++ b/packages/graphql/tests/tck/federation/authorization.test.ts @@ -203,8 +203,7 @@ describe("Federation and authorization", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:AUTHORED]-(this1:User) RETURN count(this1) > $param0 AS var2 } diff --git a/packages/graphql/tests/tck/fragments.test.ts b/packages/graphql/tests/tck/fragments.test.ts index 6ea05bb074..9b30702f68 100644 --- a/packages/graphql/tests/tck/fragments.test.ts +++ b/packages/graphql/tests/tck/fragments.test.ts @@ -104,18 +104,17 @@ describe("Cypher Fragment", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:OWNS]->(this1:Tile) - WITH this1 { .id, __resolveType: \\"Tile\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .id, __resolveType: \\"Tile\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:OWNS]->(this4:Character) - WITH this4 { .id, __resolveType: \\"Character\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .id, __resolveType: \\"Character\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -215,18 +214,17 @@ describe("Cypher Fragment", () => { "CYPHER 5 MATCH (this:Actor) WHERE this.name = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - WITH this1 { .runtime, .title, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .runtime, .title, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) - WITH this4 { .runtime, .title, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .runtime, .title, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/fulltext/auth.test.ts b/packages/graphql/tests/tck/fulltext/auth.test.ts index 25ac9e6764..8b1e59819f 100644 --- a/packages/graphql/tests/tck/fulltext/auth.test.ts +++ b/packages/graphql/tests/tck/fulltext/auth.test.ts @@ -86,8 +86,7 @@ describe("Cypher -> fulltext -> Auth", () => { })) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -160,8 +159,7 @@ describe("Cypher -> fulltext -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -237,8 +235,7 @@ describe("Cypher -> fulltext -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var3 @@ -316,8 +313,7 @@ describe("Cypher -> fulltext -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -398,8 +394,7 @@ describe("Cypher -> fulltext -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -481,8 +476,7 @@ describe("Cypher -> fulltext -> Auth", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -564,8 +558,7 @@ describe("Cypher -> fulltext -> Auth", () => { }))), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/fulltext/match.test.ts b/packages/graphql/tests/tck/fulltext/match.test.ts index 4469616ed1..0425be3ad3 100644 --- a/packages/graphql/tests/tck/fulltext/match.test.ts +++ b/packages/graphql/tests/tck/fulltext/match.test.ts @@ -59,8 +59,7 @@ describe("Cypher -> fulltext -> Match", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var2 @@ -97,8 +96,7 @@ describe("Cypher -> fulltext -> Match", () => { WHERE ($param1 IN labels(this0) AND this0.title = $param2) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/fulltext/node-labels.test.ts b/packages/graphql/tests/tck/fulltext/node-labels.test.ts index 5571af2750..c7e20c8025 100644 --- a/packages/graphql/tests/tck/fulltext/node-labels.test.ts +++ b/packages/graphql/tests/tck/fulltext/node-labels.test.ts @@ -55,8 +55,7 @@ describe("Cypher -> fulltext -> Additional Labels", () => { WHERE ($param1 IN labels(this0) AND $param2 IN labels(this0)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var2 @@ -114,8 +113,7 @@ describe("Cypher -> fulltext -> Additional Labels", () => { WHERE ($param1 IN labels(this0) AND $param2 IN labels(this0)) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/fulltext/score.test.ts b/packages/graphql/tests/tck/fulltext/score.test.ts index 1f7e3b704b..80c53cdee7 100644 --- a/packages/graphql/tests/tck/fulltext/score.test.ts +++ b/packages/graphql/tests/tck/fulltext/score.test.ts @@ -62,8 +62,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, released: this0.released, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -102,8 +101,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE ($param1 IN labels(this0) AND this0.released > $param2) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, released: this0.released, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -145,8 +143,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE ($param1 IN labels(this0) AND var1 >= $param2) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" }, score: var1 }) AS var2 @@ -185,8 +182,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * @@ -226,8 +222,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * @@ -267,8 +262,7 @@ describe("Cypher -> fulltext -> Score", () => { WHERE $param1 IN labels(this0) WITH collect({ node: this0, score: var1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0, edge.score AS var1 WITH * diff --git a/packages/graphql/tests/tck/info.test.ts b/packages/graphql/tests/tck/info.test.ts index f3706c3ae3..0634cb21f5 100644 --- a/packages/graphql/tests/tck/info.test.ts +++ b/packages/graphql/tests/tck/info.test.ts @@ -59,14 +59,12 @@ describe("info", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET diff --git a/packages/graphql/tests/tck/issues/1132.test.ts b/packages/graphql/tests/tck/issues/1132.test.ts index 0194429794..594ec3d767 100644 --- a/packages/graphql/tests/tck/issues/1132.test.ts +++ b/packages/graphql/tests/tck/issues/1132.test.ts @@ -68,15 +68,13 @@ describe("https://github.com/neo4j/graphql/issues/1132", () => { "CYPHER 5 MATCH (this:Source) WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_targets0_connect0_node:Target) WHERE this_targets0_connect0_node.id = $this_targets0_connect0_node_param0 AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH * + CALL(*) { WITH collect(this_targets0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_targets0_connect0_node CREATE (this)-[:HAS_TARGET]->(this_targets0_connect0_node) @@ -147,14 +145,13 @@ describe("https://github.com/neo4j/graphql/issues/1132", () => { "CYPHER 5 MATCH (this:Source) WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_targets0_disconnect0_rel:HAS_TARGET]->(this_targets0_disconnect0:Target) WHERE this_targets0_disconnect0.id = $updateSources_args_update_targets0_disconnect0_where_Target_this_targets0_disconnect0param0 AND apoc.util.validatePredicate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND this.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this_targets0_disconnect0, this_targets0_disconnect0_rel, this - WITH collect(this_targets0_disconnect0) as this_targets0_disconnect0, this_targets0_disconnect0_rel, this - UNWIND this_targets0_disconnect0 as x + CALL (this_targets0_disconnect0, this_targets0_disconnect0_rel, this) { + WITH collect(this_targets0_disconnect0) as this_targets0_disconnect0_x, this_targets0_disconnect0_rel, this + UNWIND this_targets0_disconnect0_x as x DELETE this_targets0_disconnect0_rel } RETURN count(*) AS disconnect_this_targets0_disconnect_Target diff --git a/packages/graphql/tests/tck/issues/1150.test.ts b/packages/graphql/tests/tck/issues/1150.test.ts index 079d860270..ca5842bd66 100644 --- a/packages/graphql/tests/tck/issues/1150.test.ts +++ b/packages/graphql/tests/tck/issues/1150.test.ts @@ -111,20 +111,16 @@ describe("https://github.com/neo4j/graphql/issues/1150", () => { "CYPHER 5 MATCH (this:Drive) WHERE this.current = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:CONSISTS_OF]->(this1:DriveComposition) WHERE this0.current = $param1 WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { CALL { WITH this1 MATCH (this1)-[this2:HAS]->(this3:Battery) diff --git a/packages/graphql/tests/tck/issues/1249.test.ts b/packages/graphql/tests/tck/issues/1249.test.ts index c46554fbd4..b1bd5d52c0 100644 --- a/packages/graphql/tests/tck/issues/1249.test.ts +++ b/packages/graphql/tests/tck/issues/1249.test.ts @@ -83,17 +83,14 @@ describe("https://github.com/neo4j/graphql/issues/1249", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Bulk:BULK) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:MATERIAL_BULK]->(this1:Material) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:MATERIAL_SUPPLIER]->(this3:Supplier) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 RETURN collect({ properties: { supplierMaterialNumber: this2.supplierMaterialNumber, __resolveType: \\"RelationMaterialSupplier\\" }, node: { supplierId: this3.supplierId, __resolveType: \\"Supplier\\" } }) AS var4 diff --git a/packages/graphql/tests/tck/issues/1320.test.ts b/packages/graphql/tests/tck/issues/1320.test.ts index 283508f56e..15f00e504f 100644 --- a/packages/graphql/tests/tck/issues/1320.test.ts +++ b/packages/graphql/tests/tck/issues/1320.test.ts @@ -76,20 +76,16 @@ describe("https://github.com/neo4j/graphql/issues/1320", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Team) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this0:OWNS_RISK]->(this1:Risk) WHERE $param0 IN this1.mitigationState RETURN { nodes: count(DISTINCT this1) } AS var2 } RETURN { aggregate: { count: var2 } } AS var3 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this4:OWNS_RISK]->(this5:Risk) WHERE $param1 IN this5.mitigationState RETURN { nodes: count(DISTINCT this5) } AS var6 diff --git a/packages/graphql/tests/tck/issues/1348.test.ts b/packages/graphql/tests/tck/issues/1348.test.ts index 5356554b2e..b2a6961242 100644 --- a/packages/graphql/tests/tck/issues/1348.test.ts +++ b/packages/graphql/tests/tck/issues/1348.test.ts @@ -78,23 +78,22 @@ describe("https://github.com/neo4j/graphql/issues/1348", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:ProgrammeItem) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:RELATES_TO]-(this1:Series) - WITH this1 { .productTitle, __resolveType: \\"Series\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .productTitle, __resolveType: \\"Series\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:RELATES_TO]-(this4:Season) - WITH this4 { .productTitle, __resolveType: \\"Season\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .productTitle, __resolveType: \\"Season\\", __id: id(this4) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this5:RELATES_TO]-(this6:ProgrammeItem) - WITH this6 { .productTitle, __resolveType: \\"ProgrammeItem\\", __id: id(this6) } AS this6 - RETURN this6 AS var2 + WITH this6 { .productTitle, __resolveType: \\"ProgrammeItem\\", __id: id(this6) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -135,10 +134,8 @@ describe("https://github.com/neo4j/graphql/issues/1348", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:ProgrammeItem) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:RELATES_TO]-(this1:Series) diff --git a/packages/graphql/tests/tck/issues/1364.test.ts b/packages/graphql/tests/tck/issues/1364.test.ts index 86568c4803..f5d867938a 100644 --- a/packages/graphql/tests/tck/issues/1364.test.ts +++ b/packages/graphql/tests/tck/issues/1364.test.ts @@ -95,16 +95,13 @@ describe("https://github.com/neo4j/graphql/issues/1364", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * ORDER BY this0.title ASC - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -139,14 +136,11 @@ describe("https://github.com/neo4j/graphql/issues/1364", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -184,14 +178,11 @@ describe("https://github.com/neo4j/graphql/issues/1364", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -201,10 +192,8 @@ describe("https://github.com/neo4j/graphql/issues/1364", () => { } WITH * ORDER BY var2 ASC - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:ACTED_IN]-(actor:Actor) RETURN count(DISTINCT actor) as result diff --git a/packages/graphql/tests/tck/issues/1528.test.ts b/packages/graphql/tests/tck/issues/1528.test.ts index 28d847f95a..9cb56d229d 100644 --- a/packages/graphql/tests/tck/issues/1528.test.ts +++ b/packages/graphql/tests/tck/issues/1528.test.ts @@ -71,19 +71,15 @@ describe("https://github.com/neo4j/graphql/issues/1528", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Genre) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:IS_GENRE]-(this1:Movie) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (this)<-[:ACTED_IN]-(ac:Person) RETURN count(ac) as res diff --git a/packages/graphql/tests/tck/issues/1535.test.ts b/packages/graphql/tests/tck/issues/1535.test.ts index c6263f8496..fb7398b11e 100644 --- a/packages/graphql/tests/tck/issues/1535.test.ts +++ b/packages/graphql/tests/tck/issues/1535.test.ts @@ -80,18 +80,17 @@ describe("https://github.com/neo4j/graphql/issues/1535", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Tenant) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[this0:HOSTED_BY]-(this1:Screening) - WITH this1 { .id, __resolveType: \\"Screening\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .id, __resolveType: \\"Screening\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)<-[this3:HOSTED_BY]-(this4:Booking) - WITH this4 { .id, __resolveType: \\"Booking\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .id, __resolveType: \\"Booking\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/issues/1566.test.ts b/packages/graphql/tests/tck/issues/1566.test.ts index 6ddf24ed21..ea4157c2a4 100644 --- a/packages/graphql/tests/tck/issues/1566.test.ts +++ b/packages/graphql/tests/tck/issues/1566.test.ts @@ -82,29 +82,26 @@ describe("https://github.com/neo4j/graphql/issues/1566", () => { "CYPHER 5 MATCH (this:Community) WHERE this.id = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this Match(this)-[:COMMUNITY_CONTENTPIECE_HASCONTENTPIECES|:COMMUNITY_PROJECT_HASASSOCIATEDPROJECTS]-(pag) return pag SKIP ($param1 * $pageIndex) LIMIT $param1 } WITH pag AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Content - WITH this0 { .name, __resolveType: \\"Content\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .name, __resolveType: \\"Content\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Project - WITH this0 { .name, __resolveType: \\"Project\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .name, __resolveType: \\"Project\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } diff --git a/packages/graphql/tests/tck/issues/1628.test.ts b/packages/graphql/tests/tck/issues/1628.test.ts index 8944f31aed..9678742505 100644 --- a/packages/graphql/tests/tck/issues/1628.test.ts +++ b/packages/graphql/tests/tck/issues/1628.test.ts @@ -67,8 +67,7 @@ describe("https://github.com/neo4j/graphql/issues/1628", () => { } WITH * LIMIT $param1 - CALL { - WITH this + CALL (this) { MATCH (this)-[this1:dcterms__title]->(this2:dcterms_title:property) WHERE this2.value CONTAINS $param2 WITH DISTINCT this2 diff --git a/packages/graphql/tests/tck/issues/1751.test.ts b/packages/graphql/tests/tck/issues/1751.test.ts index 4c188b3609..578a06bb01 100644 --- a/packages/graphql/tests/tck/issues/1751.test.ts +++ b/packages/graphql/tests/tck/issues/1751.test.ts @@ -82,19 +82,16 @@ describe("https://github.com/neo4j/graphql/issues/1751", () => { MATCH (this:Organization) WHERE this.title = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:HAS_ADMINISTRATOR]->(this1:Admin) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:HAS_ADMINISTRATOR]-(this3:Organization) RETURN count(this3) = $param1 AS var4 } WITH * WHERE var4 = true WITH this0, collect(DISTINCT this1) AS var5 - CALL { - WITH var5 + CALL (var5) { UNWIND var5 AS var6 DETACH DELETE var6 } diff --git a/packages/graphql/tests/tck/issues/1779.test.ts b/packages/graphql/tests/tck/issues/1779.test.ts index 7d4906e581..6e4fddae3f 100644 --- a/packages/graphql/tests/tck/issues/1779.test.ts +++ b/packages/graphql/tests/tck/issues/1779.test.ts @@ -60,8 +60,7 @@ describe("https://github.com/neo4j/graphql/issues/1779", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Person) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:attends]->(this1:School) WHERE (EXISTS { MATCH (this1)<-[:attends]-(this2:Person) diff --git a/packages/graphql/tests/tck/issues/1783.test.ts b/packages/graphql/tests/tck/issues/1783.test.ts index fa9132f8c6..c4b174bca8 100644 --- a/packages/graphql/tests/tck/issues/1783.test.ts +++ b/packages/graphql/tests/tck/issues/1783.test.ts @@ -135,38 +135,32 @@ describe("https://github.com/neo4j/graphql/issues/1783", () => { MATCH (this)-[this4:HAS_NAME]->(this5:NameDetails) WHERE (this5.fullName CONTAINS $param4 AND this4.current = $param5) }) - CALL { - WITH this + CALL (this) { MATCH (this)-[this6:HAS_NAME]->(this7:NameDetails) WHERE this6.current = $param6 WITH collect({ node: this7, relationship: this6 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this7, edge.relationship AS this6 RETURN collect({ node: { fullName: this7.fullName, __resolveType: \\"NameDetails\\" } }) AS var8 } RETURN { edges: var8, totalCount: totalCount } AS var9 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this10:ARCHITECTURE]->(this11:MasterData) WHERE this10.current = $param7 WITH collect({ node: this11, relationship: this10 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this11, edge.relationship AS this10 - CALL { - WITH this11 + CALL (this11) { MATCH (this11)-[this12:HAS_NAME]->(this13:NameDetails) WHERE this12.current = $param8 WITH collect({ node: this13, relationship: this12 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this13, edge.relationship AS this12 RETURN collect({ node: { fullName: this13.fullName, __resolveType: \\"NameDetails\\" } }) AS var14 diff --git a/packages/graphql/tests/tck/issues/1848.test.ts b/packages/graphql/tests/tck/issues/1848.test.ts index 4056dcf308..eded3c6a39 100644 --- a/packages/graphql/tests/tck/issues/1848.test.ts +++ b/packages/graphql/tests/tck/issues/1848.test.ts @@ -88,28 +88,25 @@ describe("https://github.com/neo4j/graphql/issues/1848", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Community:UNIVERSAL) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this Match(this)-[:COMMUNITY_CONTENTPIECE_HASCONTENTPIECES|:COMMUNITY_PROJECT_HASASSOCIATEDPROJECTS]-(pag) return pag SKIP ($param0 * $param1) LIMIT $param0 } WITH pag AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:ContentPiece - WITH this0 { .id, __resolveType: \\"ContentPiece\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .id, __resolveType: \\"ContentPiece\\", __id: id(this0) } AS var1 + RETURN var1 UNION WITH * MATCH (this0) WHERE this0:Project - WITH this0 { .id, __resolveType: \\"Project\\", __id: id(this0) } AS this0 - RETURN this0 AS var1 + WITH this0 { .id, __resolveType: \\"Project\\", __id: id(this0) } AS var1 + RETURN var1 } RETURN var1 } diff --git a/packages/graphql/tests/tck/issues/190.test.ts b/packages/graphql/tests/tck/issues/190.test.ts index 0d45fd3479..a3597ba309 100644 --- a/packages/graphql/tests/tck/issues/190.test.ts +++ b/packages/graphql/tests/tck/issues/190.test.ts @@ -67,8 +67,7 @@ describe("#190", () => { MATCH (this)-[:HAS_DEMOGRAPHIC]->(this0:UserDemographics) WHERE (this0.type = $param0 AND this0.value = $param1) } - CALL { - WITH this + CALL (this) { MATCH (this)-[this1:HAS_DEMOGRAPHIC]->(this2:UserDemographics) WITH DISTINCT this2 WITH this2 { .type, .value } AS this2 @@ -119,8 +118,7 @@ describe("#190", () => { MATCH (this)-[:HAS_DEMOGRAPHIC]->(this0:UserDemographics) WHERE ((this0.type = $param0 AND this0.value = $param1) OR this0.type = $param2 OR this0.type = $param3) } - CALL { - WITH this + CALL (this) { MATCH (this)-[this1:HAS_DEMOGRAPHIC]->(this2:UserDemographics) WITH DISTINCT this2 WITH this2 { .type, .value } AS this2 diff --git a/packages/graphql/tests/tck/issues/1933.test.ts b/packages/graphql/tests/tck/issues/1933.test.ts index 88970148c8..ce964efb1f 100644 --- a/packages/graphql/tests/tck/issues/1933.test.ts +++ b/packages/graphql/tests/tck/issues/1933.test.ts @@ -83,22 +83,18 @@ describe("https://github.com/neo4j/graphql/issues/1933", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Employee) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:PARTICIPATES]->(this1:Project) RETURN sum(this0.allocation) <= $param0 AS var2 } WITH * WHERE var2 = true - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this3:PARTICIPATES]->(this4:Project) RETURN { nodes: count(DISTINCT this4) } AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this6:PARTICIPATES]->(this7:Project) WITH DISTINCT this6 RETURN { min: min(this6.allocation), max: max(this6.allocation), average: avg(this6.allocation), sum: sum(this6.allocation) } AS var8 diff --git a/packages/graphql/tests/tck/issues/2022.test.ts b/packages/graphql/tests/tck/issues/2022.test.ts index 9053935e59..537c93657f 100644 --- a/packages/graphql/tests/tck/issues/2022.test.ts +++ b/packages/graphql/tests/tck/issues/2022.test.ts @@ -92,16 +92,13 @@ describe("https://github.com/neo4j/graphql/issues/2022", () => { MATCH (this0:ArtPiece) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:SOLD_AT_AUCTION_AS]->(this2:AuctionItem) WITH DISTINCT this2 - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this3:BOUGHT_ITEM_AT_AUCTION]-(this4:Organization) WITH DISTINCT this4 WITH this4 { .name, dbId: this4.id } AS this4 @@ -110,8 +107,7 @@ describe("https://github.com/neo4j/graphql/issues/2022", () => { WITH this2 { .auctionName, .lotNumber, dbId: this2.id, buyer: var5 } AS this2 RETURN collect(this2) AS var6 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this7:OWNED_BY]->(this8:Organization) WITH DISTINCT this8 WITH this8 { .name, dbId: this8.id } AS this8 diff --git a/packages/graphql/tests/tck/issues/2100.test.ts b/packages/graphql/tests/tck/issues/2100.test.ts index f9632b7f08..eac2c7dd57 100644 --- a/packages/graphql/tests/tck/issues/2100.test.ts +++ b/packages/graphql/tests/tck/issues/2100.test.ts @@ -108,27 +108,22 @@ describe("https://github.com/neo4j/graphql/issues/2100", () => { "CYPHER 5 MATCH (this:Bacenta) WHERE this.id = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_HISTORY]->(:ServiceLog)-[:HAS_BUSSING]->(records:BussingRecord)-[:BUSSED_ON]->(date:TimeGraph) WITH DISTINCT records, date LIMIT $param1 RETURN records ORDER BY date.date DESC } WITH records AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:BUSSED_ON]->(this2:TimeGraph) WITH DISTINCT this2 WITH this2 { .date } AS this2 RETURN collect(this2) AS var3 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)<-[:PRESENT_AT_SERVICE|ABSENT_FROM_SERVICE]-(member:Member) RETURN COUNT(member) > 0 AS markedAttendance diff --git a/packages/graphql/tests/tck/issues/2189.test.ts b/packages/graphql/tests/tck/issues/2189.test.ts index e4d3d1a59f..192603c9d3 100644 --- a/packages/graphql/tests/tck/issues/2189.test.ts +++ b/packages/graphql/tests/tck/issues/2189.test.ts @@ -78,8 +78,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Test_Item) SET create_this1.uuid = randomUUID(), @@ -87,8 +86,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { create_this1.str = create_var0.str, create_this1.bool = create_var0.bool WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.feedback.create AS create_var2 CREATE (create_this3:Test_Feedback) SET @@ -155,8 +153,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Test_Item) SET create_this1.uuid = randomUUID(), @@ -164,8 +161,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { create_this1.str = create_var0.str, create_this1.bool = create_var0.bool WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.feedback.create AS create_var2 CREATE (create_this3:Test_Feedback) SET @@ -250,8 +246,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Test_Item) SET create_this1.uuid = randomUUID(), @@ -259,8 +254,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { create_this1.str = create_var0.str, create_this1.bool = create_var0.bool WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.feedback.create AS create_var2 CREATE (create_this3:Test_Feedback) SET @@ -271,10 +265,8 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { } RETURN create_this1 } - CALL { - WITH create_this1 - CALL { - WITH create_this1 + CALL (create_this1) { + CALL (create_this1) { WITH create_this1 AS this OPTIONAL MATCH (this)<-[:TEST_RELATIONSHIP]-(t:Test_Feedback) RETURN t @@ -284,8 +276,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { WITH create_this6 { .bool, .str, .int, .uuid } AS create_this6 RETURN head(collect(create_this6)) AS create_var7 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this8:TEST_RELATIONSHIP]-(create_this9:Test_Feedback) WITH DISTINCT create_this9 WITH create_this9 { .uuid, .int, .str, .bool } AS create_this9 @@ -359,8 +350,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Test_Item) SET create_this1.uuid = randomUUID(), @@ -368,8 +358,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { create_this1.str = create_var0.str, create_this1.bool = create_var0.bool WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.feedback.create AS create_var2 CREATE (create_this3:Test_Feedback) SET @@ -380,8 +369,7 @@ describe("https://github.com/neo4j/graphql/issues/2189", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:TEST_RELATIONSHIP]-(create_this7:Test_Feedback) WITH DISTINCT create_this7 WITH create_this7 { .uuid, .int, .str, .bool } AS create_this7 diff --git a/packages/graphql/tests/tck/issues/2249.test.ts b/packages/graphql/tests/tck/issues/2249.test.ts index fa29327dd9..9378272081 100644 --- a/packages/graphql/tests/tck/issues/2249.test.ts +++ b/packages/graphql/tests/tck/issues/2249.test.ts @@ -89,8 +89,7 @@ describe("https://github.com/neo4j/graphql/issues/2249", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { - WITH this + CALL (this) { WITH this CREATE (this_reviewers0_create0_node:Person) SET this_reviewers0_create0_node.name = $this_reviewers0_create0_node_name @@ -99,24 +98,22 @@ describe("https://github.com/neo4j/graphql/issues/2249", () => { SET this_reviewers0_create0_relationship.score = $updateMovies.args.update.reviewers[0].create[0].edge.score RETURN count(*) AS update_this_Person } - CALL { - WITH this + CALL (this){ WITH this RETURN count(*) AS update_this_Influencer } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[update_this0:REVIEWED]-(update_this1:Person) - WITH update_this1 { .name, .reputation, __resolveType: \\"Person\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var2 + WITH update_this1 { .name, .reputation, __resolveType: \\"Person\\", __id: id(update_this1) } AS update_var2 + RETURN update_var2 UNION WITH * MATCH (this)<-[update_this3:REVIEWED]-(update_this4:Influencer) - WITH update_this4 { __resolveType: \\"Influencer\\", __id: id(update_this4) } AS update_this4 - RETURN update_this4 AS update_var2 + WITH update_this4 { __resolveType: \\"Influencer\\", __id: id(update_this4) } AS update_var2 + RETURN update_var2 } WITH update_var2 RETURN collect(update_var2) AS update_var2 diff --git a/packages/graphql/tests/tck/issues/2262.test.ts b/packages/graphql/tests/tck/issues/2262.test.ts index ecf9ef29b3..497ec475d0 100644 --- a/packages/graphql/tests/tck/issues/2262.test.ts +++ b/packages/graphql/tests/tck/issues/2262.test.ts @@ -72,22 +72,18 @@ describe("https://github.com/neo4j/graphql/issues/2262", () => { "CYPHER 5 MATCH (this:Component) WHERE this.uuid = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:OUTPUT]-(this1:Process) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:INPUT]-(this3:Component) WITH collect({ node: this3, relationship: this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this3, edge.relationship AS this2 WITH * diff --git a/packages/graphql/tests/tck/issues/2267.test.ts b/packages/graphql/tests/tck/issues/2267.test.ts index 65956f8640..83cc4b59ce 100644 --- a/packages/graphql/tests/tck/issues/2267.test.ts +++ b/packages/graphql/tests/tck/issues/2267.test.ts @@ -71,18 +71,17 @@ describe("https://github.com/neo4j/graphql/issues/2267", () => { MATCH (this:Place) WITH * ORDER BY this.displayName ASC - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[this0:ACTIVITY]-(this1:Post) - WITH this1 { .name, __resolveType: \\"Post\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Post\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)<-[this3:ACTIVITY]-(this4:Story) - WITH this4 { .name, __resolveType: \\"Story\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .name, __resolveType: \\"Story\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/issues/2396.test.ts b/packages/graphql/tests/tck/issues/2396.test.ts index 65e02022f2..f7fc130c22 100644 --- a/packages/graphql/tests/tck/issues/2396.test.ts +++ b/packages/graphql/tests/tck/issues/2396.test.ts @@ -166,14 +166,12 @@ describe("https://github.com/neo4j/graphql/issues/2396", () => { WHERE this1.floor >= $param0 } } AND ($isAuthenticated = true AND this.archivedAt IS NULL)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this2:HAS_VALUATION]->(this3:Valuation) WITH DISTINCT this3 WITH * WHERE ($isAuthenticated = true AND this3.archivedAt IS NULL) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:VALUATION_FOR]->(this5:Estate) WITH DISTINCT this5 WITH * @@ -245,14 +243,12 @@ describe("https://github.com/neo4j/graphql/issues/2396", () => { WHERE this1.floor >= $param1 } }) AND ($isAuthenticated = true AND this.archivedAt IS NULL)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this2:HAS_VALUATION]->(this3:Valuation) WITH DISTINCT this3 WITH * WHERE ($isAuthenticated = true AND this3.archivedAt IS NULL) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:VALUATION_FOR]->(this5:Estate) WITH DISTINCT this5 WITH * @@ -342,14 +338,12 @@ describe("https://github.com/neo4j/graphql/issues/2396", () => { }) } }) AND ($isAuthenticated = true AND this.archivedAt IS NULL)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this4:HAS_VALUATION]->(this5:Valuation) WITH DISTINCT this5 WITH * WHERE ($isAuthenticated = true AND this5.archivedAt IS NULL) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this6:VALUATION_FOR]->(this7:Estate) WITH DISTINCT this7 WITH * @@ -449,14 +443,12 @@ describe("https://github.com/neo4j/graphql/issues/2396", () => { WITH * SKIP $param6 LIMIT $param7 - CALL { - WITH this + CALL (this) { MATCH (this)-[this4:HAS_VALUATION]->(this5:Valuation) WITH DISTINCT this5 WITH * WHERE ($isAuthenticated = true AND this5.archivedAt IS NULL) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this6:VALUATION_FOR]->(this7:Estate) WITH DISTINCT this7 WITH * @@ -564,14 +556,12 @@ describe("https://github.com/neo4j/graphql/issues/2396", () => { WITH * SKIP $param6 LIMIT $param7 - CALL { - WITH this + CALL (this) { MATCH (this)-[this4:HAS_VALUATION]->(this5:Valuation) WITH DISTINCT this5 WITH * WHERE ($isAuthenticated = true AND this5.archivedAt IS NULL) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this6:VALUATION_FOR]->(this7:Estate) WITH DISTINCT this7 WITH * diff --git a/packages/graphql/tests/tck/issues/2437.test.ts b/packages/graphql/tests/tck/issues/2437.test.ts index ed9dafe4d6..d50f97535a 100644 --- a/packages/graphql/tests/tck/issues/2437.test.ts +++ b/packages/graphql/tests/tck/issues/2437.test.ts @@ -85,14 +85,12 @@ describe("https://github.com/neo4j/graphql/issues/2437", () => { MATCH (this:Agent) WITH * WHERE (this.uuid = $param0 AND ($isAuthenticated = true AND this.archivedAt IS NULL)) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IS_VALUATION_AGENT]->(this1:Valuation) WHERE ($isAuthenticated = true AND this1.archivedAt IS NULL) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * diff --git a/packages/graphql/tests/tck/issues/2581.test.ts b/packages/graphql/tests/tck/issues/2581.test.ts index 0ca9150a9b..242af09720 100644 --- a/packages/graphql/tests/tck/issues/2581.test.ts +++ b/packages/graphql/tests/tck/issues/2581.test.ts @@ -92,18 +92,14 @@ describe("https://github.com/neo4j/graphql/issues/2581", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:AUTHORED_BOOK]->(b:Book) RETURN b AS result ORDER BY b.year DESC LIMIT 1 } WITH result AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this OPTIONAL MATCH(sales:Sales) WHERE this.refID = sales.refID WITH count(sales) as result RETURN result as result } @@ -137,18 +133,14 @@ describe("https://github.com/neo4j/graphql/issues/2581", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Author) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:AUTHORED_BOOK]->(b:Book) RETURN b AS result ORDER BY b.year DESC LIMIT 1 } WITH result AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this OPTIONAL MATCH(sales:Sales) WHERE this.refID = sales.refID WITH count(sales) as result RETURN result as result } diff --git a/packages/graphql/tests/tck/issues/2614.test.ts b/packages/graphql/tests/tck/issues/2614.test.ts index b1a4d36aa4..04fb54f12f 100644 --- a/packages/graphql/tests/tck/issues/2614.test.ts +++ b/packages/graphql/tests/tck/issues/2614.test.ts @@ -73,20 +73,19 @@ describe("https://github.com/neo4j/graphql/issues/2614", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Film) WHERE this1.title = $param0 - WITH this1 { .title, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) WHERE this4.title = $param1 - WITH this4 { .title, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/issues/2670.test.ts b/packages/graphql/tests/tck/issues/2670.test.ts index ae11391787..de3210fc3f 100644 --- a/packages/graphql/tests/tck/issues/2670.test.ts +++ b/packages/graphql/tests/tck/issues/2670.test.ts @@ -65,11 +65,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -106,11 +104,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) < $param0 AS var4 } @@ -147,11 +143,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -194,11 +188,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN min(size(this3.title)) = $param0 AS var4 } @@ -241,11 +233,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN avg(size(this3.title)) = $param0 AS var4 } @@ -285,11 +275,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN max(this2.intValue) < $param0 AS var4 } @@ -332,11 +320,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN min(this2.intValue) = $param0 AS var4 } @@ -373,11 +359,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -414,11 +398,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -455,11 +437,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -467,11 +447,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this6:IN_GENRE]-(this7:Movie) RETURN count(this7) = $param1 AS var8 } @@ -512,11 +490,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -564,16 +540,13 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this5:IN_GENRE]-(this6:Series) RETURN min(size(this6.name)) = $param1 AS var7 } @@ -625,16 +598,13 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this5:IN_GENRE]-(this6:Series) RETURN min(size(this6.name)) = $param1 AS var7 } @@ -686,16 +656,13 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this5:IN_GENRE]-(this6:Series) RETURN min(size(this6.name)) = $param1 AS var7 } @@ -741,11 +708,9 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -753,8 +718,7 @@ describe("https://github.com/neo4j/graphql/issues/2670", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this6:IN_GENRE]->(this7:Genre) RETURN count(this7) = $param1 AS var8 } diff --git a/packages/graphql/tests/tck/issues/2708.test.ts b/packages/graphql/tests/tck/issues/2708.test.ts index ed774133b8..e91d4f3d15 100644 --- a/packages/graphql/tests/tck/issues/2708.test.ts +++ b/packages/graphql/tests/tck/issues/2708.test.ts @@ -65,11 +65,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -106,11 +104,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) < $param0 AS var3 } @@ -147,11 +143,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) > $param0 AS var3 } @@ -190,11 +184,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN min(size(this2.title)) = $param0 AS var3 } @@ -233,11 +225,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN avg(size(this2.title)) = $param0 AS var3 } @@ -271,11 +261,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN max(this1.intValue) < $param0 AS var3 } @@ -312,11 +300,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN min(this1.intValue) = $param0 AS var3 } @@ -353,11 +339,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -394,11 +378,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -435,11 +417,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -447,11 +427,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { WHERE var3 = true RETURN count(this0) > 0 AS var4 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this5:IN_GENRE]-(this6:Movie) RETURN count(this6) = $param1 AS var7 } @@ -492,11 +470,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -533,11 +509,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -545,11 +519,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { WHERE var3 = true RETURN count(this0) > 0 AS var4 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this5:IN_GENRE]-(this6:Movie) RETURN count(this6) = $param1 AS var7 } @@ -601,16 +573,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this4:IN_GENRE]-(this5:Series) RETURN min(size(this5.name)) = $param1 AS var6 } @@ -662,16 +631,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this4:IN_GENRE]-(this5:Series) RETURN min(size(this5.name)) = $param1 AS var6 } @@ -721,16 +687,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this4:IN_GENRE]-(this5:Series) RETURN min(size(this5.name)) = $param1 AS var6 } @@ -776,11 +739,9 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } @@ -788,8 +749,7 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { WHERE var3 = true RETURN count(this0) > 0 AS var4 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this5:IN_GENRE]->(this6:Genre) RETURN count(this6) = $param1 AS var7 } @@ -837,16 +797,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this4:IN_GENRE]-(this5:Series) RETURN count(this5) = $param1 AS var6 } @@ -854,16 +811,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { WHERE (var3 = true OR var6 = true) RETURN count(this0) > 0 AS var7 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this8:IN_GENRE]-(this9:Movie) RETURN count(this9) = $param2 AS var10 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this11:IN_GENRE]-(this12:Series) RETURN count(this12) = $param3 AS var13 } @@ -921,16 +875,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:IN_GENRE]-(this2:Movie) RETURN count(this2) = $param0 AS var3 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this4:IN_GENRE]-(this5:Series) RETURN count(this5) = $param1 AS var6 } @@ -938,16 +889,13 @@ describe("https://github.com/neo4j/graphql/issues/2708", () => { WHERE ((var3 = true OR this0.name = $param2) AND var6 = true) RETURN count(this0) > 0 AS var7 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:IN_GENRE]->(this0:Genre) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this8:IN_GENRE]-(this9:Movie) RETURN count(this9) = $param3 AS var10 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this11:IN_GENRE]-(this12:Series) RETURN count(this12) = $param4 AS var13 } diff --git a/packages/graphql/tests/tck/issues/2713.test.ts b/packages/graphql/tests/tck/issues/2713.test.ts index 99ceaf128f..0b9c1c050d 100644 --- a/packages/graphql/tests/tck/issues/2713.test.ts +++ b/packages/graphql/tests/tck/issues/2713.test.ts @@ -65,11 +65,9 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -77,11 +75,9 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this6:IN_GENRE]-(this7:Movie) RETURN count(this7) = $param1 AS var8 } @@ -128,11 +124,9 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:IN_GENRE]-(this3:Movie) RETURN count(this3) = $param0 AS var4 } @@ -140,11 +134,9 @@ describe("https://github.com/neo4j/graphql/issues/2713", () => { WHERE (this1.name = $param1 AND var4 = true) RETURN count(this1) > 0 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:IN_GENRE]->(this1:Genre) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this6:IN_GENRE]-(this7:Movie) RETURN count(this7) = $param2 AS var8 } diff --git a/packages/graphql/tests/tck/issues/2766.test.ts b/packages/graphql/tests/tck/issues/2766.test.ts index 26331bdaa0..4f665a0488 100644 --- a/packages/graphql/tests/tck/issues/2766.test.ts +++ b/packages/graphql/tests/tck/issues/2766.test.ts @@ -71,23 +71,18 @@ describe("https://github.com/neo4j/graphql/issues/2766", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[]-(m:Movie {title: $param0}) RETURN m } WITH m AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH DISTINCT this2 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)-[]-(m:Movie {title: $param1}) RETURN m diff --git a/packages/graphql/tests/tck/issues/2782.test.ts b/packages/graphql/tests/tck/issues/2782.test.ts index e66165aa26..b7933c0822 100644 --- a/packages/graphql/tests/tck/issues/2782.test.ts +++ b/packages/graphql/tests/tck/issues/2782.test.ts @@ -100,34 +100,31 @@ describe("https://github.com/neo4j/graphql/issues/2782", () => { SET this.id = $this_update_id_SET SET this.name = $this_update_name_SET WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_colors0_disconnect0_rel:HAS_COLOR]->(this_colors0_disconnect0:Color) WHERE this_colors0_disconnect0.name = $updateProducts_args_update_colors0_disconnect0_where_Color_this_colors0_disconnect0param0 - CALL { - WITH this_colors0_disconnect0, this_colors0_disconnect0_rel, this - WITH collect(this_colors0_disconnect0) as this_colors0_disconnect0, this_colors0_disconnect0_rel, this - UNWIND this_colors0_disconnect0 as x + CALL (this_colors0_disconnect0, this_colors0_disconnect0_rel, this) { + WITH collect(this_colors0_disconnect0) as this_colors0_disconnect0_x, this_colors0_disconnect0_rel, this + UNWIND this_colors0_disconnect0_x as x DELETE this_colors0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_colors0_disconnect0 OPTIONAL MATCH (this_colors0_disconnect0)<-[this_colors0_disconnect0_photos0_rel:OF_COLOR]-(this_colors0_disconnect0_photos0:Photo) WHERE this_colors0_disconnect0_photos0.id = $updateProducts_args_update_colors0_disconnect0_disconnect_photos0_where_Photo_this_colors0_disconnect0_photos0param0 - CALL { - WITH this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 - WITH collect(this_colors0_disconnect0_photos0) as this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 - UNWIND this_colors0_disconnect0_photos0 as x + CALL (this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0) { + WITH collect(this_colors0_disconnect0_photos0) as this_colors0_disconnect0_photos0_x, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 + UNWIND this_colors0_disconnect0_photos0_x as x DELETE this_colors0_disconnect0_photos0_rel } - CALL { + CALL(*) { WITH this, this_colors0_disconnect0, this_colors0_disconnect0_photos0 OPTIONAL MATCH (this_colors0_disconnect0_photos0)-[this_colors0_disconnect0_photos0_color0_rel:OF_COLOR]->(this_colors0_disconnect0_photos0_color0:Color) WHERE this_colors0_disconnect0_photos0_color0.id = $updateProducts_args_update_colors0_disconnect0_disconnect_photos0_disconnect_color0_where_Color_this_colors0_disconnect0_photos0_color0param0 - CALL { - WITH this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 - WITH collect(this_colors0_disconnect0_photos0_color0) as this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 - UNWIND this_colors0_disconnect0_photos0_color0 as x + CALL (this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0) { + WITH collect(this_colors0_disconnect0_photos0_color0) as this_colors0_disconnect0_photos0_color0_x, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 + UNWIND this_colors0_disconnect0_photos0_color0_x as x DELETE this_colors0_disconnect0_photos0_color0_rel } RETURN count(*) AS disconnect_this_colors0_disconnect0_photos0_color_Color @@ -137,24 +134,22 @@ describe("https://github.com/neo4j/graphql/issues/2782", () => { RETURN count(*) AS disconnect_this_colors0_disconnect_Color } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_photos0_disconnect0_rel:HAS_PHOTO]->(this_photos0_disconnect0:Photo) WHERE this_photos0_disconnect0.id = $updateProducts_args_update_photos0_disconnect0_where_Photo_this_photos0_disconnect0param0 - CALL { - WITH this_photos0_disconnect0, this_photos0_disconnect0_rel, this - WITH collect(this_photos0_disconnect0) as this_photos0_disconnect0, this_photos0_disconnect0_rel, this - UNWIND this_photos0_disconnect0 as x + CALL (this_photos0_disconnect0, this_photos0_disconnect0_rel, this) { + WITH collect(this_photos0_disconnect0) as this_photos0_disconnect0_x, this_photos0_disconnect0_rel, this + UNWIND this_photos0_disconnect0_x as x DELETE this_photos0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_photos0_disconnect0 OPTIONAL MATCH (this_photos0_disconnect0)-[this_photos0_disconnect0_color0_rel:OF_COLOR]->(this_photos0_disconnect0_color0:Color) WHERE this_photos0_disconnect0_color0.name = $updateProducts_args_update_photos0_disconnect0_disconnect_color0_where_Color_this_photos0_disconnect0_color0param0 - CALL { - WITH this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 - WITH collect(this_photos0_disconnect0_color0) as this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 - UNWIND this_photos0_disconnect0_color0 as x + CALL (this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0) { + WITH collect(this_photos0_disconnect0_color0) as this_photos0_disconnect0_color0_x, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 + UNWIND this_photos0_disconnect0_color0_x as x DELETE this_photos0_disconnect0_color0_rel } RETURN count(*) AS disconnect_this_photos0_disconnect0_color_Color @@ -162,24 +157,22 @@ describe("https://github.com/neo4j/graphql/issues/2782", () => { RETURN count(*) AS disconnect_this_photos0_disconnect_Photo } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_photos0_disconnect1_rel:HAS_PHOTO]->(this_photos0_disconnect1:Photo) WHERE this_photos0_disconnect1.id = $updateProducts_args_update_photos0_disconnect1_where_Photo_this_photos0_disconnect1param0 - CALL { - WITH this_photos0_disconnect1, this_photos0_disconnect1_rel, this - WITH collect(this_photos0_disconnect1) as this_photos0_disconnect1, this_photos0_disconnect1_rel, this - UNWIND this_photos0_disconnect1 as x + CALL (this_photos0_disconnect1, this_photos0_disconnect1_rel, this) { + WITH collect(this_photos0_disconnect1) as this_photos0_disconnect1_x, this_photos0_disconnect1_rel, this + UNWIND this_photos0_disconnect1_x as x DELETE this_photos0_disconnect1_rel } - CALL { + CALL(*) { WITH this, this_photos0_disconnect1 OPTIONAL MATCH (this_photos0_disconnect1)-[this_photos0_disconnect1_color0_rel:OF_COLOR]->(this_photos0_disconnect1_color0:Color) WHERE this_photos0_disconnect1_color0.name = $updateProducts_args_update_photos0_disconnect0_disconnect_color0_where_Color_this_photos0_disconnect1_color0param0 - CALL { - WITH this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 - WITH collect(this_photos0_disconnect1_color0) as this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 - UNWIND this_photos0_disconnect1_color0 as x + CALL (this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1) { + WITH collect(this_photos0_disconnect1_color0) as this_photos0_disconnect1_color0_x, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 + UNWIND this_photos0_disconnect1_color0_x as x DELETE this_photos0_disconnect1_color0_rel } RETURN count(*) AS disconnect_this_photos0_disconnect1_color_Color diff --git a/packages/graphql/tests/tck/issues/2803.test.ts b/packages/graphql/tests/tck/issues/2803.test.ts index ef0cd61e17..c76a778fab 100644 --- a/packages/graphql/tests/tck/issues/2803.test.ts +++ b/packages/graphql/tests/tck/issues/2803.test.ts @@ -60,14 +60,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -75,11 +72,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this6:ACTED_IN]->(this7:Movie) RETURN count(this7) > $param1 AS var8 } @@ -133,14 +128,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -148,11 +140,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this6:ACTED_IN]->(this7:Movie) RETURN count(this7) > $param1 AS var8 } @@ -160,8 +150,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE NOT (var8 = true) RETURN count(this1) > 0 AS var9 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this10:ACTED_IN]-(this11:Actor) RETURN count(this11) = $param2 AS var12 } @@ -212,17 +201,13 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[:ACTED_IN]-(this0:Actor) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this3:ACTED_IN]->(this4:Movie) RETURN count(this4) > $param0 AS var5 } @@ -230,11 +215,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this2) > 0 AS var6 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this7:ACTED_IN]->(this8:Movie) RETURN count(this8) > $param1 AS var9 } @@ -298,17 +281,13 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[:ACTED_IN]-(this0:Actor) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this3:ACTED_IN]->(this4:Movie) RETURN count(this4) > $param0 AS var5 } @@ -316,11 +295,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this2) > 0 AS var6 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this7:ACTED_IN]->(this8:Movie) RETURN count(this8) > $param1 AS var9 } @@ -328,8 +305,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE NOT (var9 = true) RETURN count(this2) > 0 AS var10 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this11:ACTED_IN]-(this12:Actor) RETURN avg(size(this12.name)) < $param2 AS var13 } @@ -337,8 +313,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE ((var10 = false AND var6 = true) AND var13 = true) RETURN count(this1) > 0 AS var14 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this15:ACTED_IN]->(this16:Movie) RETURN avg(this16.released) = $param3 AS var17 } @@ -346,8 +321,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE (var14 = true AND var17 = true) RETURN count(this0) = 1 AS var18 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this19:ACTED_IN]-(this20:Actor) RETURN avg(size(this20.name)) >= $param4 AS var21 } @@ -395,14 +369,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:ACTED_IN]->(this5:Movie) RETURN count(this5) > $param0 AS var6 } @@ -410,11 +381,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var6 = true RETURN count(this3) > 0 AS var7 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this8:ACTED_IN]->(this9:Movie) RETURN count(this9) > $param1 AS var10 } @@ -468,14 +437,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this3:ACTED_IN]->(this4:Movie) RETURN count(this4) > $param0 AS var5 } @@ -483,11 +449,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this2) > 0 AS var6 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this7:ACTED_IN]->(this8:Movie) RETURN count(this8) > $param1 AS var9 } @@ -495,8 +459,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE NOT (var9 = true) RETURN count(this2) > 0 AS var10 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this11:ACTED_IN]-(this12:Actor) RETURN count(this12) = $param2 AS var13 } @@ -559,17 +522,13 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this6:ACTED_IN]->(this7:Movie) RETURN count(this7) > $param0 AS var8 } @@ -577,11 +536,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var8 = true RETURN count(this5) > 0 AS var9 } - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this10:ACTED_IN]->(this11:Movie) RETURN count(this11) > $param1 AS var12 } @@ -651,17 +608,13 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this6:ACTED_IN]->(this7:Movie) RETURN count(this7) > $param0 AS var8 } @@ -669,11 +622,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var8 = true RETURN count(this5) > 0 AS var9 } - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) - CALL { - WITH this5 + CALL (this5) { MATCH (this5)-[this10:ACTED_IN]->(this11:Movie) RETURN count(this11) > $param1 AS var12 } @@ -681,8 +632,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE NOT (var12 = true) RETURN count(this5) > 0 AS var13 } - CALL { - WITH this3 + CALL (this3) { MATCH (this3)<-[this14:ACTED_IN]-(this15:Actor) RETURN avg(size(this15.name)) < $param2 AS var16 } @@ -690,8 +640,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE ((var13 = false AND var9 = true) AND var16 = true) RETURN count(this3) > 0 AS var17 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this18:ACTED_IN]->(this19:Movie) RETURN avg(this19.released) = $param3 AS var20 } @@ -699,8 +648,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE (var17 = true AND var20 = true) RETURN count(this1) > 0 AS var21 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this22:ACTED_IN]-(this23:Actor) RETURN avg(size(this23.name)) >= $param4 AS var24 } @@ -746,14 +694,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this3:ACTED_IN]->(this4:Movie) RETURN count(this4) > $param0 AS var5 } @@ -761,11 +706,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this2) > 0 AS var6 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this7:ACTED_IN]->(this8:Movie) RETURN count(this8) > $param1 AS var9 } @@ -816,14 +759,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this3:ACTED_IN]->(this4:Movie) RETURN count(this4) > $param0 AS var5 } @@ -831,11 +771,9 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this2) > 0 AS var6 } - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[:ACTED_IN]-(this2:Actor) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)-[this7:ACTED_IN]->(this8:Movie) RETURN count(this8) > $param1 AS var9 } @@ -896,17 +834,13 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[:ACTED_IN]->(this2:Movie) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this3:ACTED_IN]-(this4:Actor) - CALL { - WITH this4 + CALL (this4) { MATCH (this4)-[this5:ACTED_IN]->(this6:Movie) RETURN count(this6) > $param0 AS var7 } @@ -962,14 +896,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN avg(this2.screenTime) <= $param0 AS var4 } @@ -977,8 +908,7 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var4 = true RETURN count(this1) > 0 AS var5 } - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this6:ACTED_IN]-(this7:Actor) RETURN avg(this6.screenTime) <= $param1 AS var8 } @@ -1029,14 +959,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:ACTED_IN]->(this5:Movie) RETURN count(this5) > $param0 AS var6 } @@ -1094,14 +1021,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:ACTED_IN]->(this5:Movie) RETURN count(this5) > $param0 AS var6 } @@ -1150,14 +1074,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -1169,14 +1090,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this0) > 0 AS var6 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this7:Actor) - CALL { - WITH this7 + CALL (this7) { MATCH (this7)-[this8:ACTED_IN]->(this9:Movie) RETURN count(this9) > $param2 AS var10 } @@ -1235,14 +1153,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -1254,14 +1169,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this0) > 0 AS var6 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this7:Actor) - CALL { - WITH this7 + CALL (this7) { MATCH (this7)-[this8:ACTED_IN]->(this9:Movie) RETURN count(this9) > $param2 AS var10 } @@ -1320,14 +1232,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this1:Actor) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) RETURN count(this3) > $param0 AS var4 } @@ -1339,14 +1248,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { WHERE var5 = true RETURN count(this0) > 0 AS var6 } - CALL { - WITH this + CALL (this) { MATCH (this)-[:ACTED_IN]->(this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[:ACTED_IN]-(this7:Actor) - CALL { - WITH this7 + CALL (this7) { MATCH (this7)-[this8:ACTED_IN]->(this9:Movie) RETURN count(this9) > $param2 AS var10 } @@ -1412,14 +1318,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:ACTED_IN]->(this5:Movie) RETURN count(this5) > $param0 AS var6 } @@ -1480,14 +1383,11 @@ describe("https://github.com/neo4j/graphql/issues/2803", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) - CALL { - WITH this3 + CALL (this3) { MATCH (this3)-[this4:ACTED_IN]->(this5:Movie) RETURN count(this5) > $param0 AS var6 } diff --git a/packages/graphql/tests/tck/issues/2812.test.ts b/packages/graphql/tests/tck/issues/2812.test.ts index 7f372ebf81..582eae743b 100644 --- a/packages/graphql/tests/tck/issues/2812.test.ts +++ b/packages/graphql/tests/tck/issues/2812.test.ts @@ -86,14 +86,12 @@ describe("https://github.com/neo4j/graphql/issues/2812", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -112,8 +110,7 @@ describe("https://github.com/neo4j/graphql/issues/2812", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $create_param5 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH DISTINCT create_this7 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND create_this7.nodeCreatedBy = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) diff --git a/packages/graphql/tests/tck/issues/288.test.ts b/packages/graphql/tests/tck/issues/288.test.ts index ec982d39c5..85a7c9cc77 100644 --- a/packages/graphql/tests/tck/issues/288.test.ts +++ b/packages/graphql/tests/tck/issues/288.test.ts @@ -59,8 +59,7 @@ describe("#288", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:USER) SET create_this1.USERID = create_var0.USERID, diff --git a/packages/graphql/tests/tck/issues/3394.test.ts b/packages/graphql/tests/tck/issues/3394.test.ts index a4aa2c061e..ab07c0ee7a 100644 --- a/packages/graphql/tests/tck/issues/3394.test.ts +++ b/packages/graphql/tests/tck/issues/3394.test.ts @@ -83,8 +83,7 @@ describe("https://github.com/neo4j/graphql/issues/3394", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Employee) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:CAN_ACCESS]->(this1:Product) WITH DISTINCT this1 WITH this1 { .description, id: this1.fg_item_id, partNumber: this1.fg_item } AS this1 @@ -119,8 +118,7 @@ describe("https://github.com/neo4j/graphql/issues/3394", () => { MATCH (this0:Product) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * @@ -155,13 +153,11 @@ describe("https://github.com/neo4j/graphql/issues/3394", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Employee) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:CAN_ACCESS]->(this1:Product) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * diff --git a/packages/graphql/tests/tck/issues/3765.test.ts b/packages/graphql/tests/tck/issues/3765.test.ts index a35f83aee9..c952d08e95 100644 --- a/packages/graphql/tests/tck/issues/3765.test.ts +++ b/packages/graphql/tests/tck/issues/3765.test.ts @@ -68,18 +68,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN count(this4) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN count(this7) < $param2 AS var8 } @@ -120,18 +117,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN count(this4) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN count(this7) < $param2 AS var8 } @@ -179,18 +173,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN count(this4) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN count(this7) < $param2 AS var8 } @@ -238,23 +229,19 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN count(this4) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN count(this7) <= $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) RETURN count(this10) < $param3 AS var11 } @@ -309,23 +296,19 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN count(this4) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN count(this7) <= $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) RETURN count(this10) < $param3 AS var11 } @@ -384,18 +367,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN min(size(this4.name)) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN min(size(this7.name)) < $param2 AS var8 } @@ -443,18 +423,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN min(size(this4.name)) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN min(size(this7.name)) < $param2 AS var8 } @@ -507,18 +484,15 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN min(size(this4.name)) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN min(size(this7.name)) < $param2 AS var8 } @@ -571,23 +545,19 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN min(size(this4.name)) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN min(size(this7.name)) < $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) RETURN min(size(this10.name)) >= $param3 AS var11 } @@ -646,38 +616,31 @@ describe("https://github.com/neo4j/graphql/issues/3765", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Post) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:LIKES]-(this1:User) RETURN count(this1) > $param0 AS var2 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this3:LIKES]-(this4:User) RETURN avg(size(this4.name)) > $param1 AS var5 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this6:LIKES]-(this7:User) RETURN min(size(this6.someProp)) < $param2 AS var8 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this9:LIKES]-(this10:User) RETURN max(size(this9.someProp)) > $param3 AS var11 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this12:LIKES]-(this13:User) RETURN min(size(this13.name)) > $param4 AS var14 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this15:LIKES]-(this16:User) RETURN min(size(this15.someProp)) > $param5 AS var17 } - CALL { - WITH this + CALL (this) { MATCH (this)<-[this18:LIKES]-(this19:User) RETURN max(size(this18.someProp)) < $param6 AS var20 } diff --git a/packages/graphql/tests/tck/issues/387.test.ts b/packages/graphql/tests/tck/issues/387.test.ts index d713d0dabf..831f331953 100644 --- a/packages/graphql/tests/tck/issues/387.test.ts +++ b/packages/graphql/tests/tck/issues/387.test.ts @@ -83,30 +83,24 @@ describe("https://github.com/neo4j/graphql/issues/387", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Place) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this return '' + '' as result } WITH result AS this0 RETURN this0 AS var1 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this return '' + '' as result } WITH result AS this2 RETURN this2 AS var3 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this return ['' + ''] as result } @@ -114,10 +108,8 @@ describe("https://github.com/neo4j/graphql/issues/387", () => { WITH var4 AS this5 RETURN collect(this5) AS var6 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this return ['' + ''] as result } diff --git a/packages/graphql/tests/tck/issues/4001.test.ts b/packages/graphql/tests/tck/issues/4001.test.ts index 0334f5c241..ef47b6d91d 100644 --- a/packages/graphql/tests/tck/issues/4001.test.ts +++ b/packages/graphql/tests/tck/issues/4001.test.ts @@ -70,10 +70,8 @@ describe("https://github.com/neo4j/graphql/issues/4001", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Serie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (n:Video) RETURN n SKIP toInteger($param0.offset) LIMIT toInteger($param0.limit) @@ -124,10 +122,8 @@ describe("https://github.com/neo4j/graphql/issues/4001", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Serie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (n:Video) RETURN n SKIP toInteger($param0.offset) LIMIT toInteger($param0.limit) @@ -171,10 +167,8 @@ describe("https://github.com/neo4j/graphql/issues/4001", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Serie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (n:Video) RETURN n SKIP toInteger($param0.offset) LIMIT toInteger($param0.limit) diff --git a/packages/graphql/tests/tck/issues/4004.test.ts b/packages/graphql/tests/tck/issues/4004.test.ts index 5b89c56b8b..d80b2e38ba 100644 --- a/packages/graphql/tests/tck/issues/4004.test.ts +++ b/packages/graphql/tests/tck/issues/4004.test.ts @@ -64,10 +64,8 @@ describe("https://github.com/neo4j/graphql/issues/4004", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Series) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH(this)<-[:IN_SERIES]-(episode:Episode) RETURN episode as n LIMIT $param0[0] diff --git a/packages/graphql/tests/tck/issues/4007.test.ts b/packages/graphql/tests/tck/issues/4007.test.ts index c1152bda12..4485e5ac41 100644 --- a/packages/graphql/tests/tck/issues/4007.test.ts +++ b/packages/graphql/tests/tck/issues/4007.test.ts @@ -62,13 +62,11 @@ describe("https://github.com/neo4j/graphql/issues/4007", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { na: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/issues/4015.test.ts b/packages/graphql/tests/tck/issues/4015.test.ts index f730bed1f4..7c187a14e4 100644 --- a/packages/graphql/tests/tck/issues/4015.test.ts +++ b/packages/graphql/tests/tck/issues/4015.test.ts @@ -66,13 +66,11 @@ describe("https://github.com/neo4j/graphql/issues/4015", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { surname: this1.surname, name: this1.name, __resolveType: \\"Actor\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/issues/4095.test.ts b/packages/graphql/tests/tck/issues/4095.test.ts index 59436fc199..7856afde40 100644 --- a/packages/graphql/tests/tck/issues/4095.test.ts +++ b/packages/graphql/tests/tck/issues/4095.test.ts @@ -79,10 +79,8 @@ describe("https://github.com/neo4j/graphql/issues/4095", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Family) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:MEMBER_OF]-(this1:Person) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this1)<-[:CREATOR_OF]-(this2:User) diff --git a/packages/graphql/tests/tck/issues/4115.test.ts b/packages/graphql/tests/tck/issues/4115.test.ts index 62dc4aec5e..66f53ec9bf 100644 --- a/packages/graphql/tests/tck/issues/4115.test.ts +++ b/packages/graphql/tests/tck/issues/4115.test.ts @@ -102,10 +102,8 @@ describe("https://github.com/neo4j/graphql/issues/4115", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Family) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:MEMBER_OF]-(this1:Person) WHERE ($isAuthenticated = true AND (EXISTS { MATCH (this1)<-[:CREATOR_OF]-(this2:User) diff --git a/packages/graphql/tests/tck/issues/4116.test.ts b/packages/graphql/tests/tck/issues/4116.test.ts index 9467853e66..36b2543487 100644 --- a/packages/graphql/tests/tck/issues/4116.test.ts +++ b/packages/graphql/tests/tck/issues/4116.test.ts @@ -93,10 +93,8 @@ describe("https://github.com/neo4j/graphql/issues/4116", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Family) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)<-[this0:MEMBER_OF]-(this1:Person) WHERE ($isAuthenticated = true AND EXISTS { MATCH (this1)-[:MEMBER_OF]->(this2:Family) diff --git a/packages/graphql/tests/tck/issues/4170.test.ts b/packages/graphql/tests/tck/issues/4170.test.ts index dfc426eb90..757d8f1320 100644 --- a/packages/graphql/tests/tck/issues/4170.test.ts +++ b/packages/graphql/tests/tck/issues/4170.test.ts @@ -163,7 +163,7 @@ describe("https://github.com/neo4j/graphql/issues/4170", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Tenant) SET this0.id = randomUUID() WITH * @@ -217,10 +217,8 @@ describe("https://github.com/neo4j/graphql/issues/4170", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ADMIN_IN]-(create_this1:User) WITH DISTINCT create_this1 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.id IS NOT NULL AND create_this1.userId = $jwt.id)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) diff --git a/packages/graphql/tests/tck/issues/4214.test.ts b/packages/graphql/tests/tck/issues/4214.test.ts index 68de3a006e..7960c631e1 100644 --- a/packages/graphql/tests/tck/issues/4214.test.ts +++ b/packages/graphql/tests/tck/issues/4214.test.ts @@ -171,13 +171,13 @@ describe("https://github.com/neo4j/graphql/issues/4214", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:TransactionItem) SET this0.name = $this0_name SET this0.price = $this0_price SET this0.quantity = $this0_quantity WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_transaction_connect0_node:Transaction) WHERE this0_transaction_connect0_node.id = $this0_transaction_connect0_node_param0 AND ((($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $authorization_0_before_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND (($jwt.roles IS NOT NULL AND $authorization_0_before_param3 IN $jwt.roles) OR ($jwt.roles IS NOT NULL AND $authorization_0_before_param4 IN $jwt.roles)) AND EXISTS { @@ -187,11 +187,9 @@ describe("https://github.com/neo4j/graphql/issues/4214", () => { MATCH (this0_transaction_connect0_node)-[:TRANSACTION]->(authorization_0_before_this1:Store) WHERE ($jwt.store IS NOT NULL AND authorization_0_before_this1.id = $jwt.store) }), \\"@neo4j/graphql/FORBIDDEN\\", [0])) - CALL { - WITH * + CALL(*) { WITH collect(this0_transaction_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_transaction_connect0_node CREATE (this0)-[:ITEM_TRANSACTED]->(this0_transaction_connect0_node) @@ -221,18 +219,15 @@ describe("https://github.com/neo4j/graphql/issues/4214", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)-[create_this0:ITEM_TRANSACTED]->(create_this1:Transaction) WHERE (($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $create_param2 IN $jwt.roles)) OR ($isAuthenticated = true AND (($jwt.roles IS NOT NULL AND $create_param3 IN $jwt.roles) OR ($jwt.roles IS NOT NULL AND $create_param4 IN $jwt.roles)) AND EXISTS { MATCH (create_this1)-[:TRANSACTION]->(create_this2:Store) WHERE ($jwt.store IS NOT NULL AND create_this2.id = $jwt.store) })) WITH DISTINCT create_this1 - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this3:TRANSACTION]->(create_this4:Store) WITH DISTINCT create_this4 WITH create_this4 { .name } AS create_this4 diff --git a/packages/graphql/tests/tck/issues/4223.test.ts b/packages/graphql/tests/tck/issues/4223.test.ts index a660753f35..6c27d8a373 100644 --- a/packages/graphql/tests/tck/issues/4223.test.ts +++ b/packages/graphql/tests/tck/issues/4223.test.ts @@ -191,7 +191,7 @@ describe("https://github.com/neo4j/graphql/issues/4223", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Tenant) SET this0.id = randomUUID() WITH * @@ -259,10 +259,8 @@ describe("https://github.com/neo4j/graphql/issues/4223", () => { }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ADMIN_IN]-(create_this1:User) WITH DISTINCT create_this1 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.id IS NOT NULL AND create_this1.userId = $jwt.id)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) diff --git a/packages/graphql/tests/tck/issues/4287.test.ts b/packages/graphql/tests/tck/issues/4287.test.ts index 6ee82d2c01..1c04385fd0 100644 --- a/packages/graphql/tests/tck/issues/4287.test.ts +++ b/packages/graphql/tests/tck/issues/4287.test.ts @@ -69,10 +69,8 @@ describe("https://github.com/neo4j/graphql/issues/4287", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:ACTED_IN]->(this1:Movie) diff --git a/packages/graphql/tests/tck/issues/4292.test.ts b/packages/graphql/tests/tck/issues/4292.test.ts index d8d8f921e9..3f7a8eeb35 100644 --- a/packages/graphql/tests/tck/issues/4292.test.ts +++ b/packages/graphql/tests/tck/issues/4292.test.ts @@ -213,8 +213,7 @@ describe("https://github.com/neo4j/graphql/issues/4292", () => { "CYPHER 5 MATCH (this:Group) WHERE this.id = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:MEMBER_OF]-(this1:Person) WITH DISTINCT this1 WITH * @@ -246,8 +245,7 @@ describe("https://github.com/neo4j/graphql/issues/4292", () => { WHERE ($jwt.uid IS NOT NULL AND this10.id = $jwt.uid) } })), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this11:PARTNER_OF]-(this12:Person) CALL apoc.util.validate(NOT ($isAuthenticated = true AND (EXISTS { MATCH (this12)<-[:CREATOR_OF]-(this13:User) @@ -279,8 +277,7 @@ describe("https://github.com/neo4j/graphql/issues/4292", () => { })), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH collect({ node: this12, relationship: this11 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this12, edge.relationship AS this11 RETURN collect({ properties: { active: this11.active, firstDay: this11.firstDay, lastDay: this11.lastDay, __resolveType: \\"PartnerOf\\" }, node: { __id: id(this12), __resolveType: \\"Person\\" } }) AS var22 diff --git a/packages/graphql/tests/tck/issues/433.test.ts b/packages/graphql/tests/tck/issues/433.test.ts index f1702cc175..7b763b58aa 100644 --- a/packages/graphql/tests/tck/issues/433.test.ts +++ b/packages/graphql/tests/tck/issues/433.test.ts @@ -63,13 +63,11 @@ describe("#413", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Person) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { name: this1.name, __resolveType: \\"Person\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/issues/4432.test.ts b/packages/graphql/tests/tck/issues/4432.test.ts index bbe967a84b..74525572fb 100644 --- a/packages/graphql/tests/tck/issues/4432.test.ts +++ b/packages/graphql/tests/tck/issues/4432.test.ts @@ -71,10 +71,8 @@ describe("https://github.com/neo4j/graphql/issues/4532", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Inventory) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { CALL { WITH this MATCH (this)-[this0:HasChildren]->(this1:Image) @@ -90,8 +88,7 @@ describe("https://github.com/neo4j/graphql/issues/4532", () => { } WITH edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge ORDER BY edge.properties.order ASC diff --git a/packages/graphql/tests/tck/issues/4583.test.ts b/packages/graphql/tests/tck/issues/4583.test.ts index c00d3b517c..6aefe9ecd3 100644 --- a/packages/graphql/tests/tck/issues/4583.test.ts +++ b/packages/graphql/tests/tck/issues/4583.test.ts @@ -89,19 +89,17 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect0_node:Movie) WHERE (this0_actedIn_connect0_node.title = $this0_actedIn_connect0_node_param0 AND this0_actedIn_connect0_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect0_node CREATE (this0)-[this0_actedIn_connect0_relationship:ACTED_IN]->(this0_actedIn_connect0_node) @@ -111,15 +109,13 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { WITH this0, this0_actedIn_connect0_node RETURN count(*) AS connect_this0_actedIn_connect_Movie0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect1_node:Series) WHERE (this0_actedIn_connect1_node.title = $this0_actedIn_connect1_node_param0 AND this0_actedIn_connect1_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect1_node CREATE (this0)-[this0_actedIn_connect1_relationship:ACTED_IN]->(this0_actedIn_connect1_node) @@ -131,8 +127,7 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .name } AS create_var0 } RETURN [create_var0] AS data" @@ -183,19 +178,17 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect0_node:Movie) WHERE (this0_actedIn_connect0_node.title = $this0_actedIn_connect0_node_param0 OR this0_actedIn_connect0_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect0_node CREATE (this0)-[this0_actedIn_connect0_relationship:ACTED_IN]->(this0_actedIn_connect0_node) @@ -205,15 +198,13 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { WITH this0, this0_actedIn_connect0_node RETURN count(*) AS connect_this0_actedIn_connect_Movie0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect1_node:Series) WHERE (this0_actedIn_connect1_node.title = $this0_actedIn_connect1_node_param0 OR this0_actedIn_connect1_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect1_node CREATE (this0)-[this0_actedIn_connect1_relationship:ACTED_IN]->(this0_actedIn_connect1_node) @@ -225,8 +216,7 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .name } AS create_var0 } RETURN [create_var0] AS data" @@ -283,19 +273,17 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect0_node:Movie) WHERE (this0_actedIn_connect0_node.title = $this0_actedIn_connect0_node_param0 AND this0_actedIn_connect0_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect0_node CREATE (this0)-[this0_actedIn_connect0_relationship:ACTED_IN]->(this0_actedIn_connect0_node) @@ -303,15 +291,13 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } } WITH this0, this0_actedIn_connect0_node - CALL { + CALL(*) { WITH this0, this0_actedIn_connect0_node OPTIONAL MATCH (this0_actedIn_connect0_node_actors0_node:Actor) WHERE this0_actedIn_connect0_node_actors0_node.name = $this0_actedIn_connect0_node_actors0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_actedIn_connect0_node_actors0_node) as connectedNodes, collect(this0_actedIn_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_actedIn_connect0_node UNWIND connectedNodes as this0_actedIn_connect0_node_actors0_node CREATE (this0_actedIn_connect0_node)<-[this0_actedIn_connect0_node_actors0_relationship:ACTED_IN]-(this0_actedIn_connect0_node_actors0_node) @@ -323,15 +309,13 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } RETURN count(*) AS connect_this0_actedIn_connect_Movie0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actedIn_connect1_node:Series) WHERE (this0_actedIn_connect1_node.title = $this0_actedIn_connect1_node_param0 AND this0_actedIn_connect1_node:Movie) - CALL { - WITH * + CALL(*) { WITH collect(this0_actedIn_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actedIn_connect1_node CREATE (this0)-[this0_actedIn_connect1_relationship:ACTED_IN]->(this0_actedIn_connect1_node) @@ -339,15 +323,13 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } } WITH this0, this0_actedIn_connect1_node - CALL { + CALL(*) { WITH this0, this0_actedIn_connect1_node OPTIONAL MATCH (this0_actedIn_connect1_node_actors0_node:Actor) WHERE this0_actedIn_connect1_node_actors0_node.name = $this0_actedIn_connect1_node_actors0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_actedIn_connect1_node_actors0_node) as connectedNodes, collect(this0_actedIn_connect1_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_actedIn_connect1_node UNWIND connectedNodes as this0_actedIn_connect1_node_actors0_node CREATE (this0_actedIn_connect1_node)<-[this0_actedIn_connect1_node_actors0_relationship:ACTED_IN]-(this0_actedIn_connect1_node_actors0_node) @@ -361,8 +343,7 @@ describe("https://github.com/neo4j/graphql/issues/4583", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .name } AS create_var0 } RETURN [create_var0] AS data" diff --git a/packages/graphql/tests/tck/issues/4704.test.ts b/packages/graphql/tests/tck/issues/4704.test.ts index 250f16da8d..1bbec73c3e 100644 --- a/packages/graphql/tests/tck/issues/4704.test.ts +++ b/packages/graphql/tests/tck/issues/4704.test.ts @@ -123,18 +123,17 @@ describe("https://github.com/neo4j/graphql/issues/4704", () => { WHERE NOT (this7.name = $param1) })) }))) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this8:ACTED_IN]->(this9:Movie) - WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS this9 - RETURN this9 AS var10 + WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS var10 + RETURN var10 UNION WITH * MATCH (this)-[this11:ACTED_IN]->(this12:Series) - WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS this12 - RETURN this12 AS var10 + WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS var10 + RETURN var10 } WITH var10 RETURN collect(var10) AS var10 @@ -175,18 +174,17 @@ describe("https://github.com/neo4j/graphql/issues/4704", () => { "CYPHER 5 MATCH (this:Actor) WHERE (single(this1 IN [(this)-[this3:ACTED_IN]->(this1:Movie) WHERE single(this0 IN [(this1)<-[this2:ACTED_IN]-(this0:Actor) WHERE this0.name = $param0 | 1] WHERE true) | 1] WHERE true) XOR single(this5 IN [(this)-[this7:ACTED_IN]->(this5:Series) WHERE single(this4 IN [(this5)<-[this6:STARRED_IN]-(this4:Actor) WHERE this4.name = $param1 | 1] WHERE true) | 1] WHERE true)) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this8:ACTED_IN]->(this9:Movie) - WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS this9 - RETURN this9 AS var10 + WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS var10 + RETURN var10 UNION WITH * MATCH (this)-[this11:ACTED_IN]->(this12:Series) - WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS this12 - RETURN this12 AS var10 + WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS var10 + RETURN var10 } WITH var10 RETURN collect(var10) AS var10 @@ -237,18 +235,17 @@ describe("https://github.com/neo4j/graphql/issues/4704", () => { WHERE this7.name = $param1 }) })) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this8:ACTED_IN]->(this9:Movie) - WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS this9 - RETURN this9 AS var10 + WITH this9 { .title, __resolveType: \\"Movie\\", __id: id(this9) } AS var10 + RETURN var10 UNION WITH * MATCH (this)-[this11:ACTED_IN]->(this12:Series) - WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS this12 - RETURN this12 AS var10 + WITH this12 { .title, __resolveType: \\"Series\\", __id: id(this12) } AS var10 + RETURN var10 } WITH var10 RETURN collect(var10) AS var10 diff --git a/packages/graphql/tests/tck/issues/4741.test.ts b/packages/graphql/tests/tck/issues/4741.test.ts index c1cdf6637a..120a799f9b 100644 --- a/packages/graphql/tests/tck/issues/4741.test.ts +++ b/packages/graphql/tests/tck/issues/4741.test.ts @@ -63,8 +63,7 @@ describe("https://github.com/neo4j/graphql/issues/4741", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Opportunity) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_LIST]->(this2:ListOli) RETURN count(this2) > $param0 AS var3 } @@ -72,19 +71,16 @@ describe("https://github.com/neo4j/graphql/issues/4741", () => { WHERE var3 = true WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * LIMIT $param1 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this4:HAS_LIST]->(this5:ListOli) WITH collect({ node: this5, relationship: this4 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this5, edge.relationship AS this4 RETURN collect({ node: { __id: id(this5), __resolveType: \\"ListOli\\" } }) AS var6 diff --git a/packages/graphql/tests/tck/issues/4814.test.ts b/packages/graphql/tests/tck/issues/4814.test.ts index 703f94bd8f..7ea96d4e56 100644 --- a/packages/graphql/tests/tck/issues/4814.test.ts +++ b/packages/graphql/tests/tck/issues/4814.test.ts @@ -72,13 +72,11 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:AStep) WHERE this0.id = $param0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { CALL { WITH this0 MATCH (this0)-[this1:FOLLOWED_BY]->(this2:AStep) @@ -96,15 +94,13 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { WITH edges, size(edges) AS totalCount RETURN { edges: edges, totalCount: totalCount } AS var5 } - WITH this0 { nextsConnection: var5, __resolveType: \\"AStep\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { nextsConnection: var5, __resolveType: \\"AStep\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this6:BStep) WHERE this6.id = $param1 - CALL { - WITH this6 - CALL { - WITH this6 + CALL (this6) { + CALL (this6) { CALL { WITH this6 MATCH (this6)-[this7:FOLLOWED_BY]->(this8:AStep) @@ -122,8 +118,8 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { WITH edges, size(edges) AS totalCount RETURN { edges: edges, totalCount: totalCount } AS var11 } - WITH this6 { nextsConnection: var11, __resolveType: \\"BStep\\", __id: id(this6) } AS this6 - RETURN this6 AS this + WITH this6 { nextsConnection: var11, __resolveType: \\"BStep\\", __id: id(this6) } AS this + RETURN this } WITH this RETURN this AS this" @@ -158,13 +154,11 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:AStep) WHERE this0.id = $param0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { CALL { WITH this0 MATCH (this0)<-[this1:FOLLOWED_BY]-(this2:AStep) @@ -182,15 +176,13 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { WITH edges, size(edges) AS totalCount RETURN { edges: edges, totalCount: totalCount } AS var5 } - WITH this0 { prevsConnection: var5, __resolveType: \\"AStep\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { prevsConnection: var5, __resolveType: \\"AStep\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this6:BStep) WHERE this6.id = $param1 - CALL { - WITH this6 - CALL { - WITH this6 + CALL (this6) { + CALL (this6) { CALL { WITH this6 MATCH (this6)<-[this7:FOLLOWED_BY]-(this8:AStep) @@ -208,8 +200,8 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { WITH edges, size(edges) AS totalCount RETURN { edges: edges, totalCount: totalCount } AS var11 } - WITH this6 { prevsConnection: var11, __resolveType: \\"BStep\\", __id: id(this6) } AS this6 - RETURN this6 AS this + WITH this6 { prevsConnection: var11, __resolveType: \\"BStep\\", __id: id(this6) } AS this + RETURN this } WITH this RETURN this AS this" @@ -240,48 +232,46 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:AStep) WHERE this0.id = $param0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)-[this1:FOLLOWED_BY]->(this2:AStep) - WITH this2 { .id, __resolveType: \\"AStep\\", __id: id(this2) } AS this2 - RETURN this2 AS var3 + WITH this2 { .id, __resolveType: \\"AStep\\", __id: id(this2) } AS var3 + RETURN var3 UNION WITH * MATCH (this0)-[this4:FOLLOWED_BY]->(this5:BStep) - WITH this5 { .id, __resolveType: \\"BStep\\", __id: id(this5) } AS this5 - RETURN this5 AS var3 + WITH this5 { .id, __resolveType: \\"BStep\\", __id: id(this5) } AS var3 + RETURN var3 } WITH var3 RETURN collect(var3) AS var3 } - WITH this0 { nexts: var3, __resolveType: \\"AStep\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { nexts: var3, __resolveType: \\"AStep\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this6:BStep) WHERE this6.id = $param1 - CALL { - WITH this6 - CALL { + CALL (this6) { + CALL (*) { WITH * MATCH (this6)-[this7:FOLLOWED_BY]->(this8:AStep) - WITH this8 { .id, __resolveType: \\"AStep\\", __id: id(this8) } AS this8 - RETURN this8 AS var9 + WITH this8 { .id, __resolveType: \\"AStep\\", __id: id(this8) } AS var9 + RETURN var9 UNION WITH * MATCH (this6)-[this10:FOLLOWED_BY]->(this11:BStep) - WITH this11 { .id, __resolveType: \\"BStep\\", __id: id(this11) } AS this11 - RETURN this11 AS var9 + WITH this11 { .id, __resolveType: \\"BStep\\", __id: id(this11) } AS var9 + RETURN var9 } WITH var9 RETURN collect(var9) AS var9 } - WITH this6 { nexts: var9, __resolveType: \\"BStep\\", __id: id(this6) } AS this6 - RETURN this6 AS this + WITH this6 { nexts: var9, __resolveType: \\"BStep\\", __id: id(this6) } AS this + RETURN this } WITH this RETURN this AS this" @@ -312,48 +302,46 @@ describe("https://github.com/neo4j/graphql/issues/4814", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL (*) { MATCH (this0:AStep) WHERE this0.id = $param0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[this1:FOLLOWED_BY]-(this2:AStep) - WITH this2 { .id, __resolveType: \\"AStep\\", __id: id(this2) } AS this2 - RETURN this2 AS var3 + WITH this2 { .id, __resolveType: \\"AStep\\", __id: id(this2) } AS var3 + RETURN var3 UNION WITH * MATCH (this0)<-[this4:FOLLOWED_BY]-(this5:BStep) - WITH this5 { .id, __resolveType: \\"BStep\\", __id: id(this5) } AS this5 - RETURN this5 AS var3 + WITH this5 { .id, __resolveType: \\"BStep\\", __id: id(this5) } AS var3 + RETURN var3 } WITH var3 RETURN collect(var3) AS var3 } - WITH this0 { prevs: var3, __resolveType: \\"AStep\\", __id: id(this0) } AS this0 - RETURN this0 AS this + WITH this0 { prevs: var3, __resolveType: \\"AStep\\", __id: id(this0) } AS this + RETURN this UNION MATCH (this6:BStep) WHERE this6.id = $param1 - CALL { - WITH this6 - CALL { + CALL (this6) { + CALL (*) { WITH * MATCH (this6)<-[this7:FOLLOWED_BY]-(this8:AStep) - WITH this8 { .id, __resolveType: \\"AStep\\", __id: id(this8) } AS this8 - RETURN this8 AS var9 + WITH this8 { .id, __resolveType: \\"AStep\\", __id: id(this8) } AS var9 + RETURN var9 UNION WITH * MATCH (this6)<-[this10:FOLLOWED_BY]-(this11:BStep) - WITH this11 { .id, __resolveType: \\"BStep\\", __id: id(this11) } AS this11 - RETURN this11 AS var9 + WITH this11 { .id, __resolveType: \\"BStep\\", __id: id(this11) } AS var9 + RETURN var9 } WITH var9 RETURN collect(var9) AS var9 } - WITH this6 { prevs: var9, __resolveType: \\"BStep\\", __id: id(this6) } AS this6 - RETURN this6 AS this + WITH this6 { prevs: var9, __resolveType: \\"BStep\\", __id: id(this6) } AS this + RETURN this } WITH this RETURN this AS this" diff --git a/packages/graphql/tests/tck/issues/4831.test.ts b/packages/graphql/tests/tck/issues/4831.test.ts index 507a2283c9..f4ba7d0aae 100644 --- a/packages/graphql/tests/tck/issues/4831.test.ts +++ b/packages/graphql/tests/tck/issues/4831.test.ts @@ -53,10 +53,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN $param0 as value } @@ -87,10 +85,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN $param0 as value } @@ -121,10 +117,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN NULL as value } @@ -151,10 +145,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN NULL as value } @@ -183,10 +175,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN $param0 as value } @@ -217,10 +207,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN $param0 as value } @@ -251,10 +239,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN NULL as value } @@ -281,10 +267,8 @@ describe("https://github.com/neo4j/graphql/issues/4831", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Test) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this RETURN NULL as value } diff --git a/packages/graphql/tests/tck/issues/4838.test.ts b/packages/graphql/tests/tck/issues/4838.test.ts index cd69e77e44..b50a7a8835 100644 --- a/packages/graphql/tests/tck/issues/4838.test.ts +++ b/packages/graphql/tests/tck/issues/4838.test.ts @@ -57,15 +57,12 @@ describe("https://github.com/neo4j/graphql/issues/4838", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Test) RETURN create_this1 } - CALL { - WITH create_this1 - CALL { - WITH create_this1 + CALL (create_this1) { + CALL (create_this1) { WITH create_this1 AS this RETURN true AS value } @@ -102,12 +99,10 @@ describe("https://github.com/neo4j/graphql/issues/4838", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:ParentTest) WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.tests.create AS create_var2 CREATE (create_this3:Test) MERGE (create_this1)-[create_this4:REL]->(create_this3) @@ -115,14 +110,11 @@ describe("https://github.com/neo4j/graphql/issues/4838", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this6:REL]->(create_this7:Test) WITH DISTINCT create_this7 - CALL { - WITH create_this7 - CALL { - WITH create_this7 + CALL (create_this7) { + CALL (create_this7) { WITH create_this7 AS this RETURN true AS value } diff --git a/packages/graphql/tests/tck/issues/487.test.ts b/packages/graphql/tests/tck/issues/487.test.ts index 5fc3033ef9..96552475df 100644 --- a/packages/graphql/tests/tck/issues/487.test.ts +++ b/packages/graphql/tests/tck/issues/487.test.ts @@ -95,34 +95,31 @@ describe("https://github.com/neo4j/graphql/issues/487", () => { RETURN node } WITH node AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Book - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:WROTE]-(this2:Author) WITH DISTINCT this2 WITH this2 { .id } AS this2 RETURN collect(this2) AS var3 } - WITH this0 { .id, author: var3, __resolveType: \\"Book\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .id, author: var3, __resolveType: \\"Book\\", __id: id(this0) } AS var4 + RETURN var4 UNION WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this5:DIRECTED]-(this6:Director) WITH DISTINCT this6 WITH this6 { .id } AS this6 RETURN collect(this6) AS var7 } - WITH this0 { .id, director: var7, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .id, director: var7, __resolveType: \\"Movie\\", __id: id(this0) } AS var4 + RETURN var4 } RETURN var4 } @@ -207,34 +204,31 @@ describe("https://github.com/neo4j/graphql/issues/487", () => { RETURN node } WITH node AS this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0) WHERE this0:Book - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:WROTE]-(this2:Author) WITH DISTINCT this2 WITH this2 { .id } AS this2 RETURN collect(this2) AS var3 } - WITH this0 { .id, author: var3, __resolveType: \\"Book\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .id, author: var3, __resolveType: \\"Book\\", __id: id(this0) } AS var4 + RETURN var4 UNION WITH * MATCH (this0) WHERE this0:Movie - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this5:DIRECTED]-(this6:Director) WITH DISTINCT this6 WITH this6 { .id } AS this6 RETURN collect(this6) AS var7 } - WITH this0 { .id, director: var7, __resolveType: \\"Movie\\", __id: id(this0) } AS this0 - RETURN this0 AS var4 + WITH this0 { .id, director: var7, __resolveType: \\"Movie\\", __id: id(this0) } AS var4 + RETURN var4 } RETURN var4 } diff --git a/packages/graphql/tests/tck/issues/488.test.ts b/packages/graphql/tests/tck/issues/488.test.ts index 411e51e203..ae8ef8e096 100644 --- a/packages/graphql/tests/tck/issues/488.test.ts +++ b/packages/graphql/tests/tck/issues/488.test.ts @@ -78,23 +78,22 @@ describe("https://github.com/neo4j/graphql/issues/488", () => { MATCH (this)-[this0:HAS_KEYWORD]->(this1:Emoji) WHERE this1.type = $param0 } - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:HAS_KEYWORD]->(this3:Emoji) - WITH this3 { .id, .type, __resolveType: \\"Emoji\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { .id, .type, __resolveType: \\"Emoji\\", __id: id(this3) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this5:HAS_KEYWORD]->(this6:Hashtag) - WITH this6 { __resolveType: \\"Hashtag\\", __id: id(this6) } AS this6 - RETURN this6 AS var4 + WITH this6 { __resolveType: \\"Hashtag\\", __id: id(this6) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this7:HAS_KEYWORD]->(this8:Text) - WITH this8 { __resolveType: \\"Text\\", __id: id(this8) } AS this8 - RETURN this8 AS var4 + WITH this8 { __resolveType: \\"Text\\", __id: id(this8) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 @@ -133,23 +132,22 @@ describe("https://github.com/neo4j/graphql/issues/488", () => { MATCH (this)-[this0:HAS_KEYWORD]->(this1:Emoji) WHERE this1.type = $param0 }) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:HAS_KEYWORD]->(this3:Emoji) - WITH this3 { .id, .type, __resolveType: \\"Emoji\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { .id, .type, __resolveType: \\"Emoji\\", __id: id(this3) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this5:HAS_KEYWORD]->(this6:Hashtag) - WITH this6 { __resolveType: \\"Hashtag\\", __id: id(this6) } AS this6 - RETURN this6 AS var4 + WITH this6 { __resolveType: \\"Hashtag\\", __id: id(this6) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this7:HAS_KEYWORD]->(this8:Text) - WITH this8 { __resolveType: \\"Text\\", __id: id(this8) } AS this8 - RETURN this8 AS var4 + WITH this8 { __resolveType: \\"Text\\", __id: id(this8) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 diff --git a/packages/graphql/tests/tck/issues/5023.test.ts b/packages/graphql/tests/tck/issues/5023.test.ts index 909510777e..13859bccd7 100644 --- a/packages/graphql/tests/tck/issues/5023.test.ts +++ b/packages/graphql/tests/tck/issues/5023.test.ts @@ -147,7 +147,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { WHERE ($jwt.id IS NOT NULL AND this0.userId = $jwt.id) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_settings0_relationship:HAS_SETTINGS]->(this_settings0:Settings) WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { @@ -158,8 +158,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { } }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_settings0)-[this_settings0_extendedOpeningHours0_delete0_relationship:HAS_OPENING_HOURS]->(this_settings0_extendedOpeningHours0_delete0:OpeningDay) WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND EXISTS { MATCH (this_settings0_extendedOpeningHours0_delete0)<-[:HAS_OPENING_HOURS]-(authorization_deletebefore_this0:Settings) @@ -172,8 +171,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { } }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) WITH this_settings0_extendedOpeningHours0_delete0_relationship, collect(DISTINCT this_settings0_extendedOpeningHours0_delete0) AS this_settings0_extendedOpeningHours0_delete0_to_delete - CALL { - WITH this_settings0_extendedOpeningHours0_delete0_to_delete + CALL(this_settings0_extendedOpeningHours0_delete0_to_delete) { UNWIND this_settings0_extendedOpeningHours0_delete0_to_delete AS x DETACH DELETE x } @@ -198,8 +196,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { MATCH (this)<-[:ADMIN_IN]-(update_this0:User) WHERE ($jwt.id IS NOT NULL AND update_this0.userId = $jwt.id) }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this1:HAS_SETTINGS]->(update_this2:Settings) WITH DISTINCT update_this2 WITH * @@ -210,8 +207,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { WHERE ($jwt.id IS NOT NULL AND update_this4.userId = $jwt.id) } }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH update_this2 + CALL (update_this2) { MATCH (update_this2)-[update_this5:HAS_OPENING_HOURS]->(update_this6:OpeningDay) WITH DISTINCT update_this6 WITH * @@ -225,8 +221,7 @@ describe("https://github.com/neo4j/graphql/issues/5023", () => { } } }), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL { - WITH update_this6 + CALL (update_this6) { MATCH (update_this6)-[update_this10:HAS_OPEN_INTERVALS]->(update_this11:OpeningHoursInterval) WITH DISTINCT update_this11 WITH * diff --git a/packages/graphql/tests/tck/issues/505.test.ts b/packages/graphql/tests/tck/issues/505.test.ts index 60bdebb22e..78e0680f9e 100644 --- a/packages/graphql/tests/tck/issues/505.test.ts +++ b/packages/graphql/tests/tck/issues/505.test.ts @@ -123,8 +123,7 @@ describe("https://github.com/neo4j/graphql/issues/505", () => { "CYPHER 5 MATCH (this:User) WHERE this.id = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:CREATED_PAGE]->(this1:Page) WITH DISTINCT this1 WITH * @@ -191,8 +190,7 @@ describe("https://github.com/neo4j/graphql/issues/505", () => { MATCH (this)-[:HAS_ADMIN]->(this1:User) WHERE ($jwt.sub IS NOT NULL AND this1.authId = $jwt.sub) }))) - CALL { - WITH this + CALL (this) { MATCH (this)-[this2:HAS_PAGE]->(this3:Page) WITH DISTINCT this3 WITH * diff --git a/packages/graphql/tests/tck/issues/5599.test.ts b/packages/graphql/tests/tck/issues/5599.test.ts index e1635c602e..467163dd1f 100644 --- a/packages/graphql/tests/tck/issues/5599.test.ts +++ b/packages/graphql/tests/tck/issues/5599.test.ts @@ -68,13 +68,11 @@ describe("https://github.com/neo4j/graphql/issues/5599", () => { "CYPHER 5 MATCH (this:Movie) WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors_LeadActor0_delete0_relationship:ACTED_IN]-(this_actors_LeadActor0_delete0:LeadActor) WHERE this_actors_LeadActor0_delete0.name = $updateMovies_args_update_actors0_delete_LeadActor0_where_this_actors_LeadActor0_delete0param0 WITH this_actors_LeadActor0_delete0_relationship, collect(DISTINCT this_actors_LeadActor0_delete0) AS this_actors_LeadActor0_delete0_to_delete - CALL { - WITH this_actors_LeadActor0_delete0_to_delete + CALL(this_actors_LeadActor0_delete0_to_delete) { UNWIND this_actors_LeadActor0_delete0_to_delete AS x DETACH DELETE x } @@ -137,25 +135,21 @@ describe("https://github.com/neo4j/graphql/issues/5599", () => { "CYPHER 5 MATCH (this:Movie) WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors_LeadActor0_delete0_relationship:ACTED_IN]-(this_actors_LeadActor0_delete0:LeadActor) WHERE this_actors_LeadActor0_delete0.name = $updateMovies_args_update_actors0_delete_LeadActor0_where_this_actors_LeadActor0_delete0param0 WITH this_actors_LeadActor0_delete0_relationship, collect(DISTINCT this_actors_LeadActor0_delete0) AS this_actors_LeadActor0_delete0_to_delete - CALL { - WITH this_actors_LeadActor0_delete0_to_delete + CALL(this_actors_LeadActor0_delete0_to_delete) { UNWIND this_actors_LeadActor0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors_Extra0_delete0_relationship:ACTED_IN]-(this_actors_Extra0_delete0:Extra) WHERE this_actors_Extra0_delete0.name = $updateMovies_args_update_actors0_delete_Extra0_where_this_actors_Extra0_delete0param0 WITH this_actors_Extra0_delete0_relationship, collect(DISTINCT this_actors_Extra0_delete0) AS this_actors_Extra0_delete0_to_delete - CALL { - WITH this_actors_Extra0_delete0_to_delete + CALL(this_actors_Extra0_delete0_to_delete) { UNWIND this_actors_Extra0_delete0_to_delete AS x DETACH DELETE x } diff --git a/packages/graphql/tests/tck/issues/583.test.ts b/packages/graphql/tests/tck/issues/583.test.ts index bdf767b710..2647758812 100644 --- a/packages/graphql/tests/tck/issues/583.test.ts +++ b/packages/graphql/tests/tck/issues/583.test.ts @@ -81,23 +81,22 @@ describe("https://github.com/neo4j/graphql/issues/583", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:ACTED_IN]->(this1:Movie) - WITH this1 { .title, .awardsGiven, __resolveType: \\"Movie\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .title, .awardsGiven, __resolveType: \\"Movie\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:ACTED_IN]->(this4:Series) - WITH this4 { .title, .awardsGiven, __resolveType: \\"Series\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, .awardsGiven, __resolveType: \\"Series\\", __id: id(this4) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this5:ACTED_IN]->(this6:ShortFilm) - WITH this6 { .title, __resolveType: \\"ShortFilm\\", __id: id(this6) } AS this6 - RETURN this6 AS var2 + WITH this6 { .title, __resolveType: \\"ShortFilm\\", __id: id(this6) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 diff --git a/packages/graphql/tests/tck/issues/6005.test.ts b/packages/graphql/tests/tck/issues/6005.test.ts index 5e52f8de9a..53ea2e2efe 100644 --- a/packages/graphql/tests/tck/issues/6005.test.ts +++ b/packages/graphql/tests/tck/issues/6005.test.ts @@ -61,8 +61,7 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WITH DISTINCT this1 RETURN count(this1) = $param0 AS var2 @@ -97,12 +96,10 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) WITH DISTINCT this3 RETURN count(this3) = $param0 AS var4 @@ -142,8 +139,7 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this0:Movie) - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH DISTINCT this2 RETURN count(this2) = $param0 AS var3 @@ -152,8 +148,7 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { WHERE var3 = true WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var4 @@ -198,15 +193,12 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { MATCH (this0:Actor) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:ACTED_IN]->(this2:Movie) - CALL { - WITH this2 + CALL (this2) { MATCH (this2)<-[this3:ACTED_IN]-(this4:Actor) WITH DISTINCT this4 RETURN count(this4) = $param0 AS var5 @@ -215,8 +207,7 @@ describe("https://github.com/neo4j/graphql/issues/6005", () => { WHERE var5 = true WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { title: this2.title, __resolveType: \\"Movie\\" } }) AS var6 diff --git a/packages/graphql/tests/tck/issues/6031.test.ts b/packages/graphql/tests/tck/issues/6031.test.ts index ebccf83231..96493990e0 100644 --- a/packages/graphql/tests/tck/issues/6031.test.ts +++ b/packages/graphql/tests/tck/issues/6031.test.ts @@ -73,7 +73,7 @@ describe("https://github.com/neo4j/graphql/issues/6031", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL () { CALL { MATCH (this0:Series) WHERE this0:Movie @@ -122,14 +122,11 @@ describe("https://github.com/neo4j/graphql/issues/6031", () => { MATCH (this0:Actor) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { CALL { WITH this0 MATCH (this0)-[this1:ACTED_IN]->(this2:Series) diff --git a/packages/graphql/tests/tck/issues/630.test.ts b/packages/graphql/tests/tck/issues/630.test.ts index 3c76c85df6..b908aabac0 100644 --- a/packages/graphql/tests/tck/issues/630.test.ts +++ b/packages/graphql/tests/tck/issues/630.test.ts @@ -68,22 +68,18 @@ describe("Cypher directive", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Actor) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (m:Movie {title: NULL}) RETURN m } WITH m AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { __id: id(this2), __resolveType: \\"Actor\\" } }) AS var3 diff --git a/packages/graphql/tests/tck/issues/832.test.ts b/packages/graphql/tests/tck/issues/832.test.ts index 352c9df1e7..812160a829 100644 --- a/packages/graphql/tests/tck/issues/832.test.ts +++ b/packages/graphql/tests/tck/issues/832.test.ts @@ -84,20 +84,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Interaction) SET this0.id = randomUUID() SET this0.kind = $this0_kind WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect0_node:Person) WHERE this0_subjects_connect0_node.id IN $this0_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect0_node) @@ -106,15 +104,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_subjects_connect0_node RETURN count(*) AS connect_this0_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect1_node:Place) WHERE this0_subjects_connect1_node.id IN $this0_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect1_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect1_node) @@ -124,15 +120,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this0_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect0_node:Person) WHERE this0_objects_connect0_node.id IN $this0_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect0_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect0_node) @@ -141,15 +135,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_objects_connect0_node RETURN count(*) AS connect_this0_objects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect1_node:Place) WHERE this0_objects_connect1_node.id IN $this0_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect1_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect1_node) @@ -160,20 +152,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Interaction) SET this1.id = randomUUID() SET this1.kind = $this1_kind WITH * - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_subjects_connect0_node:Person) WHERE this1_subjects_connect0_node.id IN $this1_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_subjects_connect0_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_subjects_connect0_node CREATE (this1)<-[:ACTED_IN]-(this1_subjects_connect0_node) @@ -182,15 +172,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this1, this1_subjects_connect0_node RETURN count(*) AS connect_this1_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_subjects_connect1_node:Place) WHERE this1_subjects_connect1_node.id IN $this1_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_subjects_connect1_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_subjects_connect1_node CREATE (this1)<-[:ACTED_IN]-(this1_subjects_connect1_node) @@ -200,15 +188,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this1_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_objects_connect0_node:Person) WHERE this1_objects_connect0_node.id IN $this1_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_objects_connect0_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_objects_connect0_node CREATE (this1)-[:ACTED_IN]->(this1_objects_connect0_node) @@ -217,15 +203,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this1, this1_objects_connect0_node RETURN count(*) AS connect_this1_objects_connect_Person0 } - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_objects_connect1_node:Place) WHERE this1_objects_connect1_node.id IN $this1_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_objects_connect1_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_objects_connect1_node CREATE (this1)-[:ACTED_IN]->(this1_objects_connect1_node) @@ -236,12 +220,10 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this1 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } - CALL { - WITH this1 + CALL (this1) { RETURN this1 { .id } AS create_var1 } RETURN [create_var0, create_var1] AS data" @@ -310,20 +292,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Interaction) SET this0.id = randomUUID() SET this0.kind = $this0_kind WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect0_node:Person) WHERE this0_subjects_connect0_node.id IN $this0_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect0_node) @@ -332,15 +312,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_subjects_connect0_node RETURN count(*) AS connect_this0_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect1_node:Place) WHERE this0_subjects_connect1_node.id IN $this0_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect1_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect1_node) @@ -350,15 +328,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this0_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect0_node:Person) WHERE this0_objects_connect0_node.id IN $this0_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect0_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect0_node) @@ -367,15 +343,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_objects_connect0_node RETURN count(*) AS connect_this0_objects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect1_node:Place) WHERE this0_objects_connect1_node.id IN $this0_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect1_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect1_node) @@ -386,8 +360,7 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -441,20 +414,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Interaction) SET this0.id = randomUUID() SET this0.kind = $this0_kind WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect0_node:Person) WHERE this0_subjects_connect0_node.id IN $this0_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect0_node) @@ -463,15 +434,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_subjects_connect0_node RETURN count(*) AS connect_this0_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect1_node:Place) WHERE this0_subjects_connect1_node.id IN $this0_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect1_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect1_node) @@ -481,15 +450,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this0_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect0_node:Person) WHERE this0_objects_connect0_node.id IN $this0_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect0_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect0_node) @@ -498,15 +465,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_objects_connect0_node RETURN count(*) AS connect_this0_objects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect1_node:Place) WHERE this0_objects_connect1_node.id IN $this0_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect1_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect1_node) @@ -517,8 +482,7 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -583,20 +547,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Interaction) SET this0.id = randomUUID() SET this0.kind = $this0_kind WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect0_node:Person) WHERE this0_subjects_connect0_node.id IN $this0_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect0_node) @@ -605,15 +567,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_subjects_connect0_node RETURN count(*) AS connect_this0_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect1_node:Place) WHERE this0_subjects_connect1_node.id IN $this0_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect1_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect1_node) @@ -623,15 +583,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this0_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect0_node:Person) WHERE this0_objects_connect0_node.id IN $this0_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect0_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect0_node) @@ -640,15 +598,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_objects_connect0_node RETURN count(*) AS connect_this0_objects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_objects_connect1_node:Place) WHERE this0_objects_connect1_node.id IN $this0_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_objects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_objects_connect1_node CREATE (this0)-[:ACTED_IN]->(this0_objects_connect1_node) @@ -659,20 +615,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Interaction) SET this1.id = randomUUID() SET this1.kind = $this1_kind WITH * - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_subjects_connect0_node:Person) WHERE this1_subjects_connect0_node.id IN $this1_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_subjects_connect0_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_subjects_connect0_node CREATE (this1)<-[:ACTED_IN]-(this1_subjects_connect0_node) @@ -681,15 +635,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this1, this1_subjects_connect0_node RETURN count(*) AS connect_this1_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_subjects_connect1_node:Place) WHERE this1_subjects_connect1_node.id IN $this1_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_subjects_connect1_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_subjects_connect1_node CREATE (this1)<-[:ACTED_IN]-(this1_subjects_connect1_node) @@ -699,15 +651,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { RETURN count(*) AS connect_this1_subjects_connect_Place1 } WITH * - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_objects_connect0_node:Person) WHERE this1_objects_connect0_node.id IN $this1_objects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_objects_connect0_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_objects_connect0_node CREATE (this1)-[:ACTED_IN]->(this1_objects_connect0_node) @@ -716,15 +666,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this1, this1_objects_connect0_node RETURN count(*) AS connect_this1_objects_connect_Person0 } - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_objects_connect1_node:Place) WHERE this1_objects_connect1_node.id IN $this1_objects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_objects_connect1_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_objects_connect1_node CREATE (this1)-[:ACTED_IN]->(this1_objects_connect1_node) @@ -735,72 +683,66 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this1 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[create_this0:ACTED_IN]-(create_this1:Person) - WITH create_this1 { .id, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .id, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)<-[create_this3:ACTED_IN]-(create_this4:Place) - WITH create_this4 { .id, __resolveType: \\"Place\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .id, __resolveType: \\"Place\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 } - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)-[create_this5:ACTED_IN]->(create_this6:Person) - WITH create_this6 { .id, __resolveType: \\"Person\\", __id: id(create_this6) } AS create_this6 - RETURN create_this6 AS create_var7 + WITH create_this6 { .id, __resolveType: \\"Person\\", __id: id(create_this6) } AS create_var7 + RETURN create_var7 UNION WITH * MATCH (this0)-[create_this8:ACTED_IN]->(create_this9:Place) - WITH create_this9 { .id, __resolveType: \\"Place\\", __id: id(create_this9) } AS create_this9 - RETURN create_this9 AS create_var7 + WITH create_this9 { .id, __resolveType: \\"Place\\", __id: id(create_this9) } AS create_var7 + RETURN create_var7 } WITH create_var7 RETURN collect(create_var7) AS create_var7 } RETURN this0 { .id, subjects: create_var2, objects: create_var7 } AS create_var10 } - CALL { - WITH this1 - CALL { - WITH this1 - CALL { + CALL (this1) { + CALL (this1) { + CALL (*) { WITH * MATCH (this1)<-[create_this11:ACTED_IN]-(create_this12:Person) - WITH create_this12 { .id, __resolveType: \\"Person\\", __id: id(create_this12) } AS create_this12 - RETURN create_this12 AS create_var13 + WITH create_this12 { .id, __resolveType: \\"Person\\", __id: id(create_this12) } AS create_var13 + RETURN create_var13 UNION WITH * MATCH (this1)<-[create_this14:ACTED_IN]-(create_this15:Place) - WITH create_this15 { .id, __resolveType: \\"Place\\", __id: id(create_this15) } AS create_this15 - RETURN create_this15 AS create_var13 + WITH create_this15 { .id, __resolveType: \\"Place\\", __id: id(create_this15) } AS create_var13 + RETURN create_var13 } WITH create_var13 RETURN collect(create_var13) AS create_var13 } - CALL { - WITH this1 - CALL { + CALL (this1) { + CALL (*) { WITH * MATCH (this1)-[create_this16:ACTED_IN]->(create_this17:Person) - WITH create_this17 { .id, __resolveType: \\"Person\\", __id: id(create_this17) } AS create_this17 - RETURN create_this17 AS create_var18 + WITH create_this17 { .id, __resolveType: \\"Person\\", __id: id(create_this17) } AS create_var18 + RETURN create_var18 UNION WITH * MATCH (this1)-[create_this19:ACTED_IN]->(create_this20:Place) - WITH create_this20 { .id, __resolveType: \\"Place\\", __id: id(create_this20) } AS create_this20 - RETURN create_this20 AS create_var18 + WITH create_this20 { .id, __resolveType: \\"Place\\", __id: id(create_this20) } AS create_var18 + RETURN create_var18 } WITH create_var18 RETURN collect(create_var18) AS create_var18 @@ -873,20 +815,18 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Interaction) SET this0.id = randomUUID() SET this0.kind = $this0_kind WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect0_node:Person) WHERE this0_subjects_connect0_node.id IN $this0_subjects_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect0_node) @@ -895,15 +835,13 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { WITH this0, this0_subjects_connect0_node RETURN count(*) AS connect_this0_subjects_connect_Person0 } - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_subjects_connect1_node:Place) WHERE this0_subjects_connect1_node.id IN $this0_subjects_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_subjects_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_subjects_connect1_node CREATE (this0)<-[:ACTED_IN]-(this0_subjects_connect1_node) @@ -914,18 +852,16 @@ describe("https://github.com/neo4j/graphql/issues/832", () => { } RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Interaction) SET this1.id = randomUUID() SET this1.kind = $this1_kind RETURN this1 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } - CALL { - WITH this1 + CALL (this1) { RETURN this1 { .id } AS create_var1 } RETURN [create_var0, create_var1] AS data" diff --git a/packages/graphql/tests/tck/issues/847.test.ts b/packages/graphql/tests/tck/issues/847.test.ts index a74b242021..a5fa93268a 100644 --- a/packages/graphql/tests/tck/issues/847.test.ts +++ b/packages/graphql/tests/tck/issues/847.test.ts @@ -68,34 +68,32 @@ describe("https://github.com/neo4j/graphql/issues/847", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Interaction) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[this0:ACTED_IN]-(this1:Person) - WITH this1 { .id, __resolveType: \\"Person\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .id, __resolveType: \\"Person\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)<-[this3:ACTED_IN]-(this4:Place) - WITH this4 { .id, __resolveType: \\"Place\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .id, __resolveType: \\"Place\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 } - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this5:ACTED_IN]->(this6:Person) - WITH this6 { .id, __resolveType: \\"Person\\", __id: id(this6) } AS this6 - RETURN this6 AS var7 + WITH this6 { .id, __resolveType: \\"Person\\", __id: id(this6) } AS var7 + RETURN var7 UNION WITH * MATCH (this)-[this8:ACTED_IN]->(this9:Place) - WITH this9 { .id, __resolveType: \\"Place\\", __id: id(this9) } AS this9 - RETURN this9 AS var7 + WITH this9 { .id, __resolveType: \\"Place\\", __id: id(this9) } AS var7 + RETURN var7 } WITH var7 RETURN collect(var7) AS var7 diff --git a/packages/graphql/tests/tck/issues/894.test.ts b/packages/graphql/tests/tck/issues/894.test.ts index 63b52bf079..85179a6afb 100644 --- a/packages/graphql/tests/tck/issues/894.test.ts +++ b/packages/graphql/tests/tck/issues/894.test.ts @@ -69,28 +69,25 @@ describe("https://github.com/neo4j/graphql/issues/894", () => { MATCH (this:User) WHERE this.name = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_activeOrganization0_disconnect0_rel:ACTIVELY_MANAGING]->(this_activeOrganization0_disconnect0:Organization) WHERE NOT (this_activeOrganization0_disconnect0._id = $updateUsers_args_update_activeOrganization0_disconnect0_where_Organization_this_activeOrganization0_disconnect0param0) - CALL { - WITH this_activeOrganization0_disconnect0, this_activeOrganization0_disconnect0_rel, this - WITH collect(this_activeOrganization0_disconnect0) as this_activeOrganization0_disconnect0, this_activeOrganization0_disconnect0_rel, this - UNWIND this_activeOrganization0_disconnect0 as x + CALL (this_activeOrganization0_disconnect0, this_activeOrganization0_disconnect0_rel, this) { + WITH collect(this_activeOrganization0_disconnect0) as this_activeOrganization0_disconnect0_x, this_activeOrganization0_disconnect0_rel, this + UNWIND this_activeOrganization0_disconnect0_x as x DELETE this_activeOrganization0_disconnect0_rel } RETURN count(*) AS disconnect_this_activeOrganization0_disconnect_Organization } WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_activeOrganization0_connect0_node:Organization) WHERE this_activeOrganization0_connect0_node._id = $this_activeOrganization0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_activeOrganization0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_activeOrganization0_connect0_node CREATE (this)-[:ACTIVELY_MANAGING]->(this_activeOrganization0_connect0_node) diff --git a/packages/graphql/tests/tck/issues/901.test.ts b/packages/graphql/tests/tck/issues/901.test.ts index 15850c86b4..d38eff8916 100644 --- a/packages/graphql/tests/tck/issues/901.test.ts +++ b/packages/graphql/tests/tck/issues/901.test.ts @@ -102,15 +102,13 @@ describe("https://github.com/neo4j/graphql/issues/901", () => { MATCH (this)-[this2:HAS_BRAND]->(this3:Series) WHERE (this3.name = $param2 AND this2.current = $param3) }) - CALL { - WITH this + CALL (this) { MATCH (this)-[this4:HAS_BRAND]->(this5:Series) WITH DISTINCT this5 WITH this5 { .name } AS this5 RETURN collect(this5) AS var6 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this7:HAS_MANUFACTURER]->(this8:Series) WITH DISTINCT this8 WITH this8 { .name } AS this8 diff --git a/packages/graphql/tests/tck/issues/988.test.ts b/packages/graphql/tests/tck/issues/988.test.ts index 536cebc783..5dcaee2e66 100644 --- a/packages/graphql/tests/tck/issues/988.test.ts +++ b/packages/graphql/tests/tck/issues/988.test.ts @@ -151,26 +151,22 @@ describe("https://github.com/neo4j/graphql/issues/988", () => { MATCH (this)-[this4:BRAND]->(this5:Brand) WHERE (this5.name = $param5 AND this4.current = $param6) })) - CALL { - WITH this + CALL (this) { MATCH (this)-[this6:MANUFACTURER]->(this7:Manufacturer) WITH collect({ node: this7, relationship: this6 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this7, edge.relationship AS this6 RETURN collect({ properties: { current: this6.current, __resolveType: \\"RelationProps\\" }, node: { name: this7.name, __resolveType: \\"Manufacturer\\" } }) AS var8 } RETURN { edges: var8, totalCount: totalCount } AS var9 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this10:BRAND]->(this11:Brand) WITH collect({ node: this11, relationship: this10 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this11, edge.relationship AS this10 RETURN collect({ properties: { current: this10.current, __resolveType: \\"RelationProps\\" }, node: { name: this11.name, __resolveType: \\"Brand\\" } }) AS var12 diff --git a/packages/graphql/tests/tck/issues/context-variable-not-always-resolved-on-cypher-queries.test.ts b/packages/graphql/tests/tck/issues/context-variable-not-always-resolved-on-cypher-queries.test.ts index 09ed603f34..f9607c340b 100644 --- a/packages/graphql/tests/tck/issues/context-variable-not-always-resolved-on-cypher-queries.test.ts +++ b/packages/graphql/tests/tck/issues/context-variable-not-always-resolved-on-cypher-queries.test.ts @@ -163,18 +163,17 @@ describe("context-variable-not-always-resolved-on-cypher-queries", () => { } WITH * LIMIT $param1 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:relToUnion]->(this3:coreRoot:Resource) - WITH this3 { __resolveType: \\"coreRoot\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { __resolveType: \\"coreRoot\\", __id: id(this3) } AS var4 + RETURN var4 UNION WITH * MATCH (this)-[this5:relToUnion]->(this6:coreFrag:test:Resource) - WITH this6 { iri: this6.uri, __resolveType: \\"coreFrag\\", __id: id(this6) } AS this6 - RETURN this6 AS var4 + WITH this6 { iri: this6.uri, __resolveType: \\"coreFrag\\", __id: id(this6) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 @@ -237,13 +236,12 @@ describe("context-variable-not-always-resolved-on-cypher-queries", () => { } WITH * LIMIT $param1 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this2:relToInterface]->(this3:coreFrag:test:Resource) - WITH this3 { iri: this3.uri, __resolveType: \\"coreFrag\\", __id: id(this3) } AS this3 - RETURN this3 AS var4 + WITH this3 { iri: this3.uri, __resolveType: \\"coreFrag\\", __id: id(this3) } AS var4 + RETURN var4 } WITH var4 RETURN collect(var4) AS var4 diff --git a/packages/graphql/tests/tck/issues/missing-custom-cypher-on-unions.test.ts b/packages/graphql/tests/tck/issues/missing-custom-cypher-on-unions.test.ts index 6c7542cf13..19d38213ed 100644 --- a/packages/graphql/tests/tck/issues/missing-custom-cypher-on-unions.test.ts +++ b/packages/graphql/tests/tck/issues/missing-custom-cypher-on-unions.test.ts @@ -160,20 +160,17 @@ describe("Missing custom Cypher on unions", () => { }) WITH * LIMIT $param2 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this1:relatesToChild]->(this2:HierarchicalRoot:Resource) - WITH this2 { __resolveType: \\"HierarchicalRoot\\", __id: id(this2) } AS this2 - RETURN this2 AS var3 + WITH this2 { __resolveType: \\"HierarchicalRoot\\", __id: id(this2) } AS var3 + RETURN var3 UNION WITH * MATCH (this)-[this4:relatesToChild]->(this5:HierarchicalComponent:Resource) - CALL { - WITH this5 - CALL { - WITH this5 + CALL (this5) { + CALL (this5) { WITH this5 AS this MATCH p=(this)<-[:relatesToChild*..10]-(parent:HierarchicalRoot) WITH p, parent @@ -200,23 +197,23 @@ describe("Missing custom Cypher on unions", () => { WITH this6 { .hasSortKey, iri: this6.uri } AS this6 RETURN collect(this6) AS var7 } - WITH this5 { hierarchicalPathNodes: var7, __resolveType: \\"HierarchicalComponent\\", __id: id(this5) } AS this5 - RETURN this5 AS var3 + WITH this5 { hierarchicalPathNodes: var7, __resolveType: \\"HierarchicalComponent\\", __id: id(this5) } AS var3 + RETURN var3 UNION WITH * MATCH (this)-[this8:relatesToChild]->(this9:Expression:MyTenant:Resource) - WITH this9 { __resolveType: \\"Expression\\", __id: id(this9) } AS this9 - RETURN this9 AS var3 + WITH this9 { __resolveType: \\"Expression\\", __id: id(this9) } AS var3 + RETURN var3 UNION WITH * MATCH (this)-[this10:relatesToChild]->(this11:Work:MyTenant:Resource) - WITH this11 { __resolveType: \\"Work\\", __id: id(this11) } AS this11 - RETURN this11 AS var3 + WITH this11 { __resolveType: \\"Work\\", __id: id(this11) } AS var3 + RETURN var3 UNION WITH * MATCH (this)-[this12:relatesToChild]->(this13:Fragment:MyTenant:Resource) - WITH this13 { __resolveType: \\"Fragment\\", __id: id(this13) } AS this13 - RETURN this13 AS var3 + WITH this13 { __resolveType: \\"Fragment\\", __id: id(this13) } AS var3 + RETURN var3 } WITH var3 RETURN collect(var3) AS var3 diff --git a/packages/graphql/tests/tck/math.test.ts b/packages/graphql/tests/tck/math.test.ts index 286a3d5c36..985bfccef9 100644 --- a/packages/graphql/tests/tck/math.test.ts +++ b/packages/graphql/tests/tck/math.test.ts @@ -77,8 +77,7 @@ describe("Math operators", () => { "CYPHER 5 MATCH (this:Movie) WITH this - CALL { - WITH this + CALL(this) { WITH this WHERE apoc.util.validatePredicate(this.viewers IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_viewers_INCREMENT]) AND apoc.util.validatePredicate(this.viewers IS NOT NULL AND this.viewers + $this_update_viewers_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) SET this.viewers = this.viewers + $this_update_viewers_INCREMENT @@ -115,8 +114,7 @@ describe("Math operators", () => { "CYPHER 5 MATCH (this:Movie) WITH this - CALL { - WITH this + CALL(this) { WITH this WHERE apoc.util.validatePredicate(this.revenue IS NULL, 'Cannot %s %s to Nan', [\\"_MULTIPLY\\", $this_update_revenue_MULTIPLY]) AND apoc.util.validatePredicate(this.revenue IS NOT NULL AND this.revenue * $this_update_revenue_MULTIPLY > 2^63-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_MULTIPLY\\", \\"64\\"]) SET this.revenue = this.revenue * $this_update_revenue_MULTIPLY @@ -152,12 +150,11 @@ describe("Math operators", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) WITH this_actedIn0, this - CALL { - WITH this_actedIn0 + CALL(this_actedIn0) { WITH this_actedIn0 WHERE apoc.util.validatePredicate(this_actedIn0.viewers IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_actedIn0_viewers_INCREMENT]) AND apoc.util.validatePredicate(this_actedIn0.viewers IS NOT NULL AND this_actedIn0.viewers + $this_update_actedIn0_viewers_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) SET this_actedIn0.viewers = this_actedIn0.viewers + $this_update_actedIn0_viewers_INCREMENT @@ -166,8 +163,7 @@ describe("Math operators", () => { RETURN count(*) AS update_this_actedIn0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .viewers } AS update_this1 @@ -213,12 +209,11 @@ describe("Math operators", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_acted_in0_relationship:ACTED_IN]->(this_actedIn0:Movie) WITH this_acted_in0_relationship, this - CALL { - WITH this_acted_in0_relationship + CALL(this_acted_in0_relationship) { WITH this_acted_in0_relationship WHERE apoc.util.validatePredicate(this_acted_in0_relationship.pay IS NULL, 'Cannot %s %s to Nan', [\\"_ADD\\", $updateActors.args.update.actedIn[0].update.edge.pay_ADD]) AND apoc.util.validatePredicate(this_acted_in0_relationship.pay IS NOT NULL AND this_acted_in0_relationship.pay + $updateActors.args.update.actedIn[0].update.edge.pay_ADD > 2^63-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_ADD\\", \\"64\\"]) SET this_acted_in0_relationship.pay = this_acted_in0_relationship.pay + $updateActors.args.update.actedIn[0].update.edge.pay_ADD @@ -227,20 +222,17 @@ describe("Math operators", () => { RETURN count(*) AS update_this_actedIn0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .title } AS update_this1 RETURN collect(update_this1) AS update_var2 } - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this3:ACTED_IN]->(update_this4:Movie) WITH collect({ node: update_this4, relationship: update_this3 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS update_this4, edge.relationship AS update_this3 RETURN collect({ properties: { pay: update_this3.pay, __resolveType: \\"ActedIn\\" }, node: { __id: id(update_this4), __resolveType: \\"Movie\\" } }) AS update_var5 @@ -291,15 +283,13 @@ describe("Math operators", () => { "CYPHER 5 MATCH (this:Actor) WITH this - CALL { - WITH this + CALL (this) { WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_married_with0_relationship:MARRIED_WITH]->(this_marriedWith0:Star) WITH this_marriedWith0, this - CALL { - WITH this_marriedWith0 + CALL(this_marriedWith0) { WITH this_marriedWith0 WHERE apoc.util.validatePredicate(this_marriedWith0.marriageLength IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_marriedWith0_marriageLength_INCREMENT]) AND apoc.util.validatePredicate(this_marriedWith0.marriageLength IS NOT NULL AND this_marriedWith0.marriageLength + $this_update_marriedWith0_marriageLength_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) SET this_marriedWith0.marriageLength = this_marriedWith0.marriageLength + $this_update_marriedWith0_marriageLength_INCREMENT @@ -310,13 +300,12 @@ describe("Math operators", () => { RETURN count(*) AS update_this_Star } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[update_this0:MARRIED_WITH]->(update_this1:Star) - WITH update_this1 { .marriageLength, __resolveType: \\"Star\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var2 + WITH update_this1 { .marriageLength, __resolveType: \\"Star\\", __id: id(update_this1) } AS update_var2 + RETURN update_var2 } WITH update_var2 RETURN collect(update_var2) AS update_var2 diff --git a/packages/graphql/tests/tck/nested-unions.test.ts b/packages/graphql/tests/tck/nested-unions.test.ts index 173bb9f3d1..8d12295972 100644 --- a/packages/graphql/tests/tck/nested-unions.test.ts +++ b/packages/graphql/tests/tck/nested-unions.test.ts @@ -96,30 +96,26 @@ describe("Nested Unions", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors_LeadActor0_connect0_node:LeadActor) WHERE this_actors_LeadActor0_connect0_node.name = $this_actors_LeadActor0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors_LeadActor0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors_LeadActor0_connect0_node CREATE (this)<-[:ACTED_IN]-(this_actors_LeadActor0_connect0_node) } } WITH this, this_actors_LeadActor0_connect0_node - CALL { + CALL(*) { WITH this, this_actors_LeadActor0_connect0_node OPTIONAL MATCH (this_actors_LeadActor0_connect0_node_actedIn_Series0_node:Series) WHERE this_actors_LeadActor0_connect0_node_actedIn_Series0_node.name = $this_actors_LeadActor0_connect0_node_actedIn_Series0_node_param0 - CALL { - WITH * + CALL(*) { WITH this, collect(this_actors_LeadActor0_connect0_node_actedIn_Series0_node) as connectedNodes, collect(this_actors_LeadActor0_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_actors_LeadActor0_connect0_node UNWIND connectedNodes as this_actors_LeadActor0_connect0_node_actedIn_Series0_node CREATE (this_actors_LeadActor0_connect0_node)-[:ACTED_IN]->(this_actors_LeadActor0_connect0_node_actedIn_Series0_node) @@ -131,34 +127,32 @@ describe("Nested Unions", () => { RETURN count(*) AS connect_this_actors_LeadActor0_connect_LeadActor0 } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[update_this0:ACTED_IN]-(update_this1:LeadActor) - CALL { - WITH update_this1 - CALL { + CALL (update_this1) { + CALL (*) { WITH * MATCH (update_this1)-[update_this2:ACTED_IN]->(update_this3:Movie) - WITH update_this3 { __resolveType: \\"Movie\\", __id: id(update_this3) } AS update_this3 - RETURN update_this3 AS update_var4 + WITH update_this3 { __resolveType: \\"Movie\\", __id: id(update_this3) } AS update_var4 + RETURN update_var4 UNION WITH * MATCH (update_this1)-[update_this5:ACTED_IN]->(update_this6:Series) - WITH update_this6 { .name, __resolveType: \\"Series\\", __id: id(update_this6) } AS update_this6 - RETURN update_this6 AS update_var4 + WITH update_this6 { .name, __resolveType: \\"Series\\", __id: id(update_this6) } AS update_var4 + RETURN update_var4 } WITH update_var4 RETURN collect(update_var4) AS update_var4 } - WITH update_this1 { .name, actedIn: update_var4, __resolveType: \\"LeadActor\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var7 + WITH update_this1 { .name, actedIn: update_var4, __resolveType: \\"LeadActor\\", __id: id(update_this1) } AS update_var7 + RETURN update_var7 UNION WITH * MATCH (this)<-[update_this8:ACTED_IN]-(update_this9:Extra) - WITH update_this9 { __resolveType: \\"Extra\\", __id: id(update_this9) } AS update_this9 - RETURN update_this9 AS update_var7 + WITH update_this9 { __resolveType: \\"Extra\\", __id: id(update_this9) } AS update_var7 + RETURN update_var7 } WITH update_var7 RETURN collect(update_var7) AS update_var7 @@ -216,24 +210,22 @@ describe("Nested Unions", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_actors_LeadActor0_disconnect0_rel:ACTED_IN]-(this_actors_LeadActor0_disconnect0:LeadActor) WHERE this_actors_LeadActor0_disconnect0.name = $updateMovies_args_update_actors_LeadActor0_disconnect0_where_LeadActor_this_actors_LeadActor0_disconnect0param0 - CALL { - WITH this_actors_LeadActor0_disconnect0, this_actors_LeadActor0_disconnect0_rel, this - WITH collect(this_actors_LeadActor0_disconnect0) as this_actors_LeadActor0_disconnect0, this_actors_LeadActor0_disconnect0_rel, this - UNWIND this_actors_LeadActor0_disconnect0 as x + CALL (this_actors_LeadActor0_disconnect0, this_actors_LeadActor0_disconnect0_rel, this) { + WITH collect(this_actors_LeadActor0_disconnect0) as this_actors_LeadActor0_disconnect0_x, this_actors_LeadActor0_disconnect0_rel, this + UNWIND this_actors_LeadActor0_disconnect0_x as x DELETE this_actors_LeadActor0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_actors_LeadActor0_disconnect0 OPTIONAL MATCH (this_actors_LeadActor0_disconnect0)-[this_actors_LeadActor0_disconnect0_actedIn_Series0_rel:ACTED_IN]->(this_actors_LeadActor0_disconnect0_actedIn_Series0:Series) WHERE this_actors_LeadActor0_disconnect0_actedIn_Series0.name = $updateMovies_args_update_actors_LeadActor0_disconnect0_disconnect_actedIn_Series0_where_Series_this_actors_LeadActor0_disconnect0_actedIn_Series0param0 - CALL { - WITH this_actors_LeadActor0_disconnect0_actedIn_Series0, this_actors_LeadActor0_disconnect0_actedIn_Series0_rel, this_actors_LeadActor0_disconnect0 - WITH collect(this_actors_LeadActor0_disconnect0_actedIn_Series0) as this_actors_LeadActor0_disconnect0_actedIn_Series0, this_actors_LeadActor0_disconnect0_actedIn_Series0_rel, this_actors_LeadActor0_disconnect0 - UNWIND this_actors_LeadActor0_disconnect0_actedIn_Series0 as x + CALL (this_actors_LeadActor0_disconnect0_actedIn_Series0, this_actors_LeadActor0_disconnect0_actedIn_Series0_rel, this_actors_LeadActor0_disconnect0) { + WITH collect(this_actors_LeadActor0_disconnect0_actedIn_Series0) as this_actors_LeadActor0_disconnect0_actedIn_Series0_x, this_actors_LeadActor0_disconnect0_actedIn_Series0_rel, this_actors_LeadActor0_disconnect0 + UNWIND this_actors_LeadActor0_disconnect0_actedIn_Series0_x as x DELETE this_actors_LeadActor0_disconnect0_actedIn_Series0_rel } RETURN count(*) AS disconnect_this_actors_LeadActor0_disconnect0_actedIn_Series_Series @@ -241,34 +233,32 @@ describe("Nested Unions", () => { RETURN count(*) AS disconnect_this_actors_LeadActor0_disconnect_LeadActor } WITH * - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)<-[update_this0:ACTED_IN]-(update_this1:LeadActor) - CALL { - WITH update_this1 - CALL { + CALL (update_this1) { + CALL (*) { WITH * MATCH (update_this1)-[update_this2:ACTED_IN]->(update_this3:Movie) - WITH update_this3 { __resolveType: \\"Movie\\", __id: id(update_this3) } AS update_this3 - RETURN update_this3 AS update_var4 + WITH update_this3 { __resolveType: \\"Movie\\", __id: id(update_this3) } AS update_var4 + RETURN update_var4 UNION WITH * MATCH (update_this1)-[update_this5:ACTED_IN]->(update_this6:Series) - WITH update_this6 { .name, __resolveType: \\"Series\\", __id: id(update_this6) } AS update_this6 - RETURN update_this6 AS update_var4 + WITH update_this6 { .name, __resolveType: \\"Series\\", __id: id(update_this6) } AS update_var4 + RETURN update_var4 } WITH update_var4 RETURN collect(update_var4) AS update_var4 } - WITH update_this1 { .name, actedIn: update_var4, __resolveType: \\"LeadActor\\", __id: id(update_this1) } AS update_this1 - RETURN update_this1 AS update_var7 + WITH update_this1 { .name, actedIn: update_var4, __resolveType: \\"LeadActor\\", __id: id(update_this1) } AS update_var7 + RETURN update_var7 UNION WITH * MATCH (this)<-[update_this8:ACTED_IN]-(update_this9:Extra) - WITH update_this9 { __resolveType: \\"Extra\\", __id: id(update_this9) } AS update_this9 - RETURN update_this9 AS update_var7 + WITH update_this9 { __resolveType: \\"Extra\\", __id: id(update_this9) } AS update_var7 + RETURN update_var7 } WITH update_var7 RETURN collect(update_var7) AS update_var7 diff --git a/packages/graphql/tests/tck/operations/batch/batch-create-auth.test.ts b/packages/graphql/tests/tck/operations/batch/batch-create-auth.test.ts index 32087a16e3..394a61d080 100644 --- a/packages/graphql/tests/tck/operations/batch/batch-create-auth.test.ts +++ b/packages/graphql/tests/tck/operations/batch/batch-create-auth.test.ts @@ -84,8 +84,7 @@ describe("Batch Create, Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -141,14 +140,12 @@ describe("Batch Create, Auth", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -163,8 +160,7 @@ describe("Batch Create, Auth", () => { CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.roles IS NOT NULL AND $create_param3 IN $jwt.roles)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH DISTINCT create_this7 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.sub IS NOT NULL AND create_this7.id = $jwt.sub)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) diff --git a/packages/graphql/tests/tck/operations/batch/batch-create-fields.test.ts b/packages/graphql/tests/tck/operations/batch/batch-create-fields.test.ts index 70d805f127..104c758d68 100644 --- a/packages/graphql/tests/tck/operations/batch/batch-create-fields.test.ts +++ b/packages/graphql/tests/tck/operations/batch/batch-create-fields.test.ts @@ -79,8 +79,7 @@ describe("Batch Create, Scalar types", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.createdAt = datetime(), @@ -156,15 +155,13 @@ describe("Batch Create, Scalar types", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.createdAt = datetime(), create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -175,8 +172,7 @@ describe("Batch Create, Scalar types", () => { SET create_this4.year = create_var2.edge.year WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.website.create AS create_var5 CREATE (create_this6:Website) SET @@ -187,8 +183,7 @@ describe("Batch Create, Scalar types", () => { RETURN collect(NULL) AS create_var9 } WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.website.create AS create_var10 CREATE (create_this11:Website) SET @@ -272,15 +267,13 @@ describe("Batch Create, Scalar types", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.createdAt = datetime(), create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -294,8 +287,7 @@ describe("Batch Create, Scalar types", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH DISTINCT create_this7 WITH create_this7 { .name } AS create_this7 diff --git a/packages/graphql/tests/tck/operations/batch/batch-create-interface.test.ts b/packages/graphql/tests/tck/operations/batch/batch-create-interface.test.ts index 6d982fc1fb..da121436ff 100644 --- a/packages/graphql/tests/tck/operations/batch/batch-create-interface.test.ts +++ b/packages/graphql/tests/tck/operations/batch/batch-create-interface.test.ts @@ -81,8 +81,7 @@ describe("Batch Create, Interface", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -138,7 +137,7 @@ describe("Batch Create, Interface", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.id = $this0_id WITH * @@ -149,7 +148,7 @@ describe("Batch Create, Interface", () => { SET this0_workersActor0_relationship.year = $this0_workersActor0_relationship_year RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Movie) SET this1.id = $this1_id WITH * @@ -160,40 +159,36 @@ describe("Batch Create, Interface", () => { SET this1_workersModeler0_relationship.year = $this1_workersModeler0_relationship_year RETURN this1 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[create_this0:EMPLOYED]-(create_this1:Actor) - WITH create_this1 { .name, __resolveType: \\"Actor\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .name, __resolveType: \\"Actor\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)<-[create_this3:EMPLOYED]-(create_this4:Modeler) - WITH create_this4 { .name, __resolveType: \\"Modeler\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .name, __resolveType: \\"Modeler\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 } RETURN this0 { .id, workers: create_var2 } AS create_var5 } - CALL { - WITH this1 - CALL { - WITH this1 - CALL { + CALL (this1) { + CALL (this1) { + CALL (*) { WITH * MATCH (this1)<-[create_this6:EMPLOYED]-(create_this7:Actor) - WITH create_this7 { .name, __resolveType: \\"Actor\\", __id: id(create_this7) } AS create_this7 - RETURN create_this7 AS create_var8 + WITH create_this7 { .name, __resolveType: \\"Actor\\", __id: id(create_this7) } AS create_var8 + RETURN create_var8 UNION WITH * MATCH (this1)<-[create_this9:EMPLOYED]-(create_this10:Modeler) - WITH create_this10 { .name, __resolveType: \\"Modeler\\", __id: id(create_this10) } AS create_this10 - RETURN create_this10 AS create_var8 + WITH create_this10 { .name, __resolveType: \\"Modeler\\", __id: id(create_this10) } AS create_var8 + RETURN create_var8 } WITH create_var8 RETURN collect(create_var8) AS create_var8 @@ -262,7 +257,7 @@ describe("Batch Create, Interface", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.id = $this0_id WITH * @@ -273,7 +268,7 @@ describe("Batch Create, Interface", () => { SET this0_workersActor0_relationship.year = $this0_workersActor0_relationship_year RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Movie) SET this1.id = $this1_id WITH * @@ -284,7 +279,7 @@ describe("Batch Create, Interface", () => { SET this1_workersActor0_relationship.year = $this1_workersActor0_relationship_year RETURN this1 } - CALL { + CALL(*) { CREATE (this2:Movie) SET this2.id = $this2_id WITH * @@ -293,19 +288,17 @@ describe("Batch Create, Interface", () => { MERGE (this2)-[:HAS_WEBSITE]->(this2_website0_node) RETURN this2 } - CALL { + CALL(*) { CREATE (this3:Movie) SET this3.id = $this3_id WITH * - CALL { + CALL(*) { WITH this3 OPTIONAL MATCH (this3_workers_connect0_node:Actor) WHERE this3_workers_connect0_node.id = $this3_workers_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this3_workers_connect0_node) as connectedNodes, collect(this3) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this3 UNWIND connectedNodes as this3_workers_connect0_node CREATE (this3)<-[this3_workers_connect0_relationship:EMPLOYED]-(this3_workers_connect0_node) @@ -314,15 +307,13 @@ describe("Batch Create, Interface", () => { WITH this3, this3_workers_connect0_node RETURN count(*) AS connect_this3_workers_connect_Actor0 } - CALL { + CALL(*) { WITH this3 OPTIONAL MATCH (this3_workers_connect1_node:Modeler) WHERE this3_workers_connect1_node.id = $this3_workers_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this3_workers_connect1_node) as connectedNodes, collect(this3) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this3 UNWIND connectedNodes as this3_workers_connect1_node CREATE (this3)<-[this3_workers_connect1_relationship:EMPLOYED]-(this3_workers_connect1_node) @@ -333,108 +324,96 @@ describe("Batch Create, Interface", () => { } RETURN this3 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)-[create_this0:HAS_WEBSITE]->(create_this1:Website) WITH DISTINCT create_this1 WITH create_this1 { .address } AS create_this1 RETURN collect(create_this1) AS create_var2 } - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[create_this3:EMPLOYED]-(create_this4:Actor) - WITH create_this4 { .name, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var5 + WITH create_this4 { .name, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_var5 + RETURN create_var5 UNION WITH * MATCH (this0)<-[create_this6:EMPLOYED]-(create_this7:Modeler) - WITH create_this7 { .name, __resolveType: \\"Modeler\\", __id: id(create_this7) } AS create_this7 - RETURN create_this7 AS create_var5 + WITH create_this7 { .name, __resolveType: \\"Modeler\\", __id: id(create_this7) } AS create_var5 + RETURN create_var5 } WITH create_var5 RETURN collect(create_var5) AS create_var5 } RETURN this0 { .id, website: create_var2, workers: create_var5 } AS create_var8 } - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { MATCH (this1)-[create_this9:HAS_WEBSITE]->(create_this10:Website) WITH DISTINCT create_this10 WITH create_this10 { .address } AS create_this10 RETURN collect(create_this10) AS create_var11 } - CALL { - WITH this1 - CALL { + CALL (this1) { + CALL (*) { WITH * MATCH (this1)<-[create_this12:EMPLOYED]-(create_this13:Actor) - WITH create_this13 { .name, __resolveType: \\"Actor\\", __id: id(create_this13) } AS create_this13 - RETURN create_this13 AS create_var14 + WITH create_this13 { .name, __resolveType: \\"Actor\\", __id: id(create_this13) } AS create_var14 + RETURN create_var14 UNION WITH * MATCH (this1)<-[create_this15:EMPLOYED]-(create_this16:Modeler) - WITH create_this16 { .name, __resolveType: \\"Modeler\\", __id: id(create_this16) } AS create_this16 - RETURN create_this16 AS create_var14 + WITH create_this16 { .name, __resolveType: \\"Modeler\\", __id: id(create_this16) } AS create_var14 + RETURN create_var14 } WITH create_var14 RETURN collect(create_var14) AS create_var14 } RETURN this1 { .id, website: create_var11, workers: create_var14 } AS create_var17 } - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { MATCH (this2)-[create_this18:HAS_WEBSITE]->(create_this19:Website) WITH DISTINCT create_this19 WITH create_this19 { .address } AS create_this19 RETURN collect(create_this19) AS create_var20 } - CALL { - WITH this2 - CALL { + CALL (this2) { + CALL (*) { WITH * MATCH (this2)<-[create_this21:EMPLOYED]-(create_this22:Actor) - WITH create_this22 { .name, __resolveType: \\"Actor\\", __id: id(create_this22) } AS create_this22 - RETURN create_this22 AS create_var23 + WITH create_this22 { .name, __resolveType: \\"Actor\\", __id: id(create_this22) } AS create_var23 + RETURN create_var23 UNION WITH * MATCH (this2)<-[create_this24:EMPLOYED]-(create_this25:Modeler) - WITH create_this25 { .name, __resolveType: \\"Modeler\\", __id: id(create_this25) } AS create_this25 - RETURN create_this25 AS create_var23 + WITH create_this25 { .name, __resolveType: \\"Modeler\\", __id: id(create_this25) } AS create_var23 + RETURN create_var23 } WITH create_var23 RETURN collect(create_var23) AS create_var23 } RETURN this2 { .id, website: create_var20, workers: create_var23 } AS create_var26 } - CALL { - WITH this3 - CALL { - WITH this3 + CALL (this3) { + CALL (this3) { MATCH (this3)-[create_this27:HAS_WEBSITE]->(create_this28:Website) WITH DISTINCT create_this28 WITH create_this28 { .address } AS create_this28 RETURN collect(create_this28) AS create_var29 } - CALL { - WITH this3 - CALL { + CALL (this3) { + CALL (*) { WITH * MATCH (this3)<-[create_this30:EMPLOYED]-(create_this31:Actor) - WITH create_this31 { .name, __resolveType: \\"Actor\\", __id: id(create_this31) } AS create_this31 - RETURN create_this31 AS create_var32 + WITH create_this31 { .name, __resolveType: \\"Actor\\", __id: id(create_this31) } AS create_var32 + RETURN create_var32 UNION WITH * MATCH (this3)<-[create_this33:EMPLOYED]-(create_this34:Modeler) - WITH create_this34 { .name, __resolveType: \\"Modeler\\", __id: id(create_this34) } AS create_this34 - RETURN create_this34 AS create_var32 + WITH create_this34 { .name, __resolveType: \\"Modeler\\", __id: id(create_this34) } AS create_var32 + RETURN create_var32 } WITH create_var32 RETURN collect(create_var32) AS create_var32 diff --git a/packages/graphql/tests/tck/operations/batch/batch-create.test.ts b/packages/graphql/tests/tck/operations/batch/batch-create.test.ts index 156649dccb..b5e31b091e 100644 --- a/packages/graphql/tests/tck/operations/batch/batch-create.test.ts +++ b/packages/graphql/tests/tck/operations/batch/batch-create.test.ts @@ -69,8 +69,7 @@ describe("Batch Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -127,14 +126,12 @@ describe("Batch Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -144,8 +141,7 @@ describe("Batch Create", () => { SET create_this4.year = create_var2.edge.year WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.website.create AS create_var5 CREATE (create_this6:Website) SET @@ -156,8 +152,7 @@ describe("Batch Create", () => { RETURN collect(NULL) AS create_var9 } WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.website.create AS create_var10 CREATE (create_this11:Website) SET @@ -241,14 +236,12 @@ describe("Batch Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -261,8 +254,7 @@ describe("Batch Create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH DISTINCT create_this7 WITH create_this7 { .name } AS create_this7 @@ -338,19 +330,17 @@ describe("Batch Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.id = $this0_id WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actors_connect0_node:Actor) WHERE this0_actors_connect0_node.id = $this0_actors_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_actors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actors_connect0_node CREATE (this0)<-[this0_actors_connect0_relationship:ACTED_IN]-(this0_actors_connect0_node) @@ -361,19 +351,17 @@ describe("Batch Create", () => { } RETURN this0 } - CALL { + CALL(*) { CREATE (this1:Movie) SET this1.id = $this1_id WITH * - CALL { + CALL(*) { WITH this1 OPTIONAL MATCH (this1_actors_connect0_node:Actor) WHERE this1_actors_connect0_node.id = $this1_actors_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this1_actors_connect0_node) as connectedNodes, collect(this1) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this1 UNWIND connectedNodes as this1_actors_connect0_node CREATE (this1)<-[this1_actors_connect0_relationship:ACTED_IN]-(this1_actors_connect0_node) @@ -384,10 +372,8 @@ describe("Batch Create", () => { } RETURN this1 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)<-[create_this0:ACTED_IN]-(create_this1:Actor) WITH DISTINCT create_this1 WITH create_this1 { .name } AS create_this1 @@ -395,10 +381,8 @@ describe("Batch Create", () => { } RETURN this0 { .id, actors: create_var2 } AS create_var3 } - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { MATCH (this1)<-[create_this4:ACTED_IN]-(create_this5:Actor) WITH DISTINCT create_this5 WITH create_this5 { .name } AS create_this5 diff --git a/packages/graphql/tests/tck/operations/connect.test.ts b/packages/graphql/tests/tck/operations/connect.test.ts index ff699330b5..a264e05840 100644 --- a/packages/graphql/tests/tck/operations/connect.test.ts +++ b/packages/graphql/tests/tck/operations/connect.test.ts @@ -107,50 +107,44 @@ describe("Cypher Connect", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Product) SET this0.id = $this0_id SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_colors_connect0_node:Color) WHERE this0_colors_connect0_node.name = $this0_colors_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_colors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_colors_connect0_node CREATE (this0)-[:HAS_COLOR]->(this0_colors_connect0_node) } } WITH this0, this0_colors_connect0_node - CALL { + CALL(*) { WITH this0, this0_colors_connect0_node OPTIONAL MATCH (this0_colors_connect0_node_photos0_node:Photo) WHERE this0_colors_connect0_node_photos0_node.id = $this0_colors_connect0_node_photos0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_colors_connect0_node_photos0_node) as connectedNodes, collect(this0_colors_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_colors_connect0_node UNWIND connectedNodes as this0_colors_connect0_node_photos0_node CREATE (this0_colors_connect0_node)<-[:OF_COLOR]-(this0_colors_connect0_node_photos0_node) } } WITH this0, this0_colors_connect0_node, this0_colors_connect0_node_photos0_node - CALL { + CALL(*) { WITH this0, this0_colors_connect0_node, this0_colors_connect0_node_photos0_node OPTIONAL MATCH (this0_colors_connect0_node_photos0_node_color0_node:Color) WHERE this0_colors_connect0_node_photos0_node_color0_node.id = $this0_colors_connect0_node_photos0_node_color0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, this0_colors_connect0_node, collect(this0_colors_connect0_node_photos0_node_color0_node) as connectedNodes, collect(this0_colors_connect0_node_photos0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_colors_connect0_node_photos0_node UNWIND connectedNodes as this0_colors_connect0_node_photos0_node_color0_node CREATE (this0_colors_connect0_node_photos0_node)-[:OF_COLOR]->(this0_colors_connect0_node_photos0_node_color0_node) @@ -164,30 +158,26 @@ describe("Cypher Connect", () => { RETURN count(*) AS connect_this0_colors_connect_Color0 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_photos_connect0_node:Photo) WHERE this0_photos_connect0_node.id = $this0_photos_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_photos_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_photos_connect0_node CREATE (this0)-[:HAS_PHOTO]->(this0_photos_connect0_node) } } WITH this0, this0_photos_connect0_node - CALL { + CALL(*) { WITH this0, this0_photos_connect0_node OPTIONAL MATCH (this0_photos_connect0_node_color0_node:Color) WHERE this0_photos_connect0_node_color0_node.name = $this0_photos_connect0_node_color0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_photos_connect0_node_color0_node) as connectedNodes, collect(this0_photos_connect0_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_photos_connect0_node UNWIND connectedNodes as this0_photos_connect0_node_color0_node CREATE (this0_photos_connect0_node)-[:OF_COLOR]->(this0_photos_connect0_node_color0_node) @@ -199,30 +189,26 @@ describe("Cypher Connect", () => { RETURN count(*) AS connect_this0_photos_connect_Photo0 } WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_photos_connect1_node:Photo) WHERE this0_photos_connect1_node.id = $this0_photos_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_photos_connect1_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_photos_connect1_node CREATE (this0)-[:HAS_PHOTO]->(this0_photos_connect1_node) } } WITH this0, this0_photos_connect1_node - CALL { + CALL(*) { WITH this0, this0_photos_connect1_node OPTIONAL MATCH (this0_photos_connect1_node_color0_node:Color) WHERE this0_photos_connect1_node_color0_node.name = $this0_photos_connect1_node_color0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_photos_connect1_node_color0_node) as connectedNodes, collect(this0_photos_connect1_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_photos_connect1_node UNWIND connectedNodes as this0_photos_connect1_node_color0_node CREATE (this0_photos_connect1_node)-[:OF_COLOR]->(this0_photos_connect1_node_color0_node) @@ -235,8 +221,7 @@ describe("Cypher Connect", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" diff --git a/packages/graphql/tests/tck/operations/create.test.ts b/packages/graphql/tests/tck/operations/create.test.ts index 75c85ab96e..e10392636f 100644 --- a/packages/graphql/tests/tck/operations/create.test.ts +++ b/packages/graphql/tests/tck/operations/create.test.ts @@ -58,8 +58,7 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -95,8 +94,7 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -140,14 +138,12 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -223,22 +219,19 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET create_this3.name = create_var2.node.name MERGE (create_this1)<-[create_this4:ACTED_IN]-(create_this3) WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.movies.create AS create_var5 CREATE (create_this6:Movie) SET @@ -318,19 +311,17 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.id = $this0_id WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_actors_connect0_node:Actor) WHERE this0_actors_connect0_node.name = $this0_actors_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_actors_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_actors_connect0_node CREATE (this0)<-[:ACTED_IN]-(this0_actors_connect0_node) @@ -341,8 +332,7 @@ describe("Cypher Create", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -382,19 +372,17 @@ describe("Cypher Create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Actor) SET this0.name = $this0_name WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_movies_connect0_node:Movie) WHERE this0_movies_connect0_node.id = $this0_movies_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_movies_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_movies_connect0_node CREATE (this0)-[:ACTED_IN]->(this0_movies_connect0_node) @@ -405,20 +393,16 @@ describe("Cypher Create", () => { } RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { MATCH (this0)-[create_this0:ACTED_IN]->(create_this1:Movie) WITH DISTINCT create_this1 - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this2:ACTED_IN]-(create_this3:Actor) WHERE create_this3.name = $create_param0 WITH collect({ node: create_this3, relationship: create_this2 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this3, edge.relationship AS create_this2 RETURN collect({ node: { name: create_this3.name, __resolveType: \\"Actor\\" } }) AS create_var4 diff --git a/packages/graphql/tests/tck/operations/delete-interface.test.ts b/packages/graphql/tests/tck/operations/delete-interface.test.ts index 94cd3be65a..c94d1f49ca 100644 --- a/packages/graphql/tests/tck/operations/delete-interface.test.ts +++ b/packages/graphql/tests/tck/operations/delete-interface.test.ts @@ -121,24 +121,20 @@ describe("Cypher Delete - interface", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE this5.title = $param2 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -175,24 +171,20 @@ describe("Cypher Delete - interface", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE (this1.title = $param1 AND this1:Movie) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE (this5.title = $param2 AND this5:Movie) WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -233,24 +225,20 @@ describe("Cypher Delete - interface", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE (this1.title = $param1 OR this1.title = $param2) WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Series) WHERE (this5.title = $param3 OR this5.title = $param4) WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -294,48 +282,40 @@ describe("Cypher Delete - interface", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) WHERE this3.name = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this8:ACTED_IN]->(this9:Series) WHERE this9.title = $param3 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this9)<-[this10:ACTED_IN]-(this11:Actor) WHERE this11.name = $param4 WITH this10, collect(DISTINCT this11) AS var12 - CALL { - WITH var12 + CALL (var12) { UNWIND var12 AS var13 DETACH DELETE var13 } } WITH this8, collect(DISTINCT this9) AS var14 - CALL { - WITH var14 + CALL (var14) { UNWIND var14 AS var15 DETACH DELETE var15 } diff --git a/packages/graphql/tests/tck/operations/delete-union.test.ts b/packages/graphql/tests/tck/operations/delete-union.test.ts index 8fc9db3399..7b4140b9bf 100644 --- a/packages/graphql/tests/tck/operations/delete-union.test.ts +++ b/packages/graphql/tests/tck/operations/delete-union.test.ts @@ -116,13 +116,11 @@ describe("Cypher Delete - union", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } @@ -165,24 +163,20 @@ describe("Cypher Delete - union", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this4:ACTED_IN]->(this5:Movie) WHERE this5.title = $param2 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -226,25 +220,21 @@ describe("Cypher Delete - union", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)<-[this2:ACTED_IN]-(this3:Actor) WHERE this3.name = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -290,25 +280,21 @@ describe("Cypher Delete - union", () => { MATCH (this:Actor) WHERE this.name = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this0:ACTED_IN]->(this1:Movie) WHERE this1.title = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)<-[this2:WORKED_ON]-(this3:ScreenWriter) WHERE this3.name = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } diff --git a/packages/graphql/tests/tck/operations/delete.test.ts b/packages/graphql/tests/tck/operations/delete.test.ts index 86910e1a52..53f39245af 100644 --- a/packages/graphql/tests/tck/operations/delete.test.ts +++ b/packages/graphql/tests/tck/operations/delete.test.ts @@ -87,13 +87,11 @@ describe("Cypher Delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } @@ -134,24 +132,20 @@ describe("Cypher Delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } } - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param2 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -193,25 +187,21 @@ describe("Cypher Delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE this3.id = $param2 WITH this2, collect(DISTINCT this3) AS var4 - CALL { - WITH var4 + CALL (var4) { UNWIND var4 AS var5 DETACH DELETE var5 } } WITH this0, collect(DISTINCT this1) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } @@ -258,37 +248,31 @@ describe("Cypher Delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE this3.id = $param2 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param3 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } WITH this2, collect(DISTINCT this3) AS var8 - CALL { - WITH var8 + CALL (var8) { UNWIND var8 AS var9 DETACH DELETE var9 } } WITH this0, collect(DISTINCT this1) AS var10 - CALL { - WITH var10 + CALL (var10) { UNWIND var10 AS var11 DETACH DELETE var11 } diff --git a/packages/graphql/tests/tck/operations/disconnect.test.ts b/packages/graphql/tests/tck/operations/disconnect.test.ts index fd2c557f14..7d879d2718 100644 --- a/packages/graphql/tests/tck/operations/disconnect.test.ts +++ b/packages/graphql/tests/tck/operations/disconnect.test.ts @@ -109,34 +109,31 @@ describe("Cypher Disconnect", () => { SET this.id = $this_update_id_SET SET this.name = $this_update_name_SET WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_colors0_disconnect0_rel:HAS_COLOR]->(this_colors0_disconnect0:Color) WHERE this_colors0_disconnect0.name = $updateProducts_args_update_colors0_disconnect0_where_Color_this_colors0_disconnect0param0 - CALL { - WITH this_colors0_disconnect0, this_colors0_disconnect0_rel, this - WITH collect(this_colors0_disconnect0) as this_colors0_disconnect0, this_colors0_disconnect0_rel, this - UNWIND this_colors0_disconnect0 as x + CALL (this_colors0_disconnect0, this_colors0_disconnect0_rel, this) { + WITH collect(this_colors0_disconnect0) as this_colors0_disconnect0_x, this_colors0_disconnect0_rel, this + UNWIND this_colors0_disconnect0_x as x DELETE this_colors0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_colors0_disconnect0 OPTIONAL MATCH (this_colors0_disconnect0)<-[this_colors0_disconnect0_photos0_rel:OF_COLOR]-(this_colors0_disconnect0_photos0:Photo) WHERE this_colors0_disconnect0_photos0.id = $updateProducts_args_update_colors0_disconnect0_disconnect_photos0_where_Photo_this_colors0_disconnect0_photos0param0 - CALL { - WITH this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 - WITH collect(this_colors0_disconnect0_photos0) as this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 - UNWIND this_colors0_disconnect0_photos0 as x + CALL (this_colors0_disconnect0_photos0, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0) { + WITH collect(this_colors0_disconnect0_photos0) as this_colors0_disconnect0_photos0_x, this_colors0_disconnect0_photos0_rel, this_colors0_disconnect0 + UNWIND this_colors0_disconnect0_photos0_x as x DELETE this_colors0_disconnect0_photos0_rel } - CALL { + CALL(*) { WITH this, this_colors0_disconnect0, this_colors0_disconnect0_photos0 OPTIONAL MATCH (this_colors0_disconnect0_photos0)-[this_colors0_disconnect0_photos0_color0_rel:OF_COLOR]->(this_colors0_disconnect0_photos0_color0:Color) WHERE this_colors0_disconnect0_photos0_color0.id = $updateProducts_args_update_colors0_disconnect0_disconnect_photos0_disconnect_color0_where_Color_this_colors0_disconnect0_photos0_color0param0 - CALL { - WITH this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 - WITH collect(this_colors0_disconnect0_photos0_color0) as this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 - UNWIND this_colors0_disconnect0_photos0_color0 as x + CALL (this_colors0_disconnect0_photos0_color0, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0) { + WITH collect(this_colors0_disconnect0_photos0_color0) as this_colors0_disconnect0_photos0_color0_x, this_colors0_disconnect0_photos0_color0_rel, this_colors0_disconnect0_photos0 + UNWIND this_colors0_disconnect0_photos0_color0_x as x DELETE this_colors0_disconnect0_photos0_color0_rel } RETURN count(*) AS disconnect_this_colors0_disconnect0_photos0_color_Color @@ -146,24 +143,22 @@ describe("Cypher Disconnect", () => { RETURN count(*) AS disconnect_this_colors0_disconnect_Color } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_photos0_disconnect0_rel:HAS_PHOTO]->(this_photos0_disconnect0:Photo) WHERE this_photos0_disconnect0.id = $updateProducts_args_update_photos0_disconnect0_where_Photo_this_photos0_disconnect0param0 - CALL { - WITH this_photos0_disconnect0, this_photos0_disconnect0_rel, this - WITH collect(this_photos0_disconnect0) as this_photos0_disconnect0, this_photos0_disconnect0_rel, this - UNWIND this_photos0_disconnect0 as x + CALL (this_photos0_disconnect0, this_photos0_disconnect0_rel, this) { + WITH collect(this_photos0_disconnect0) as this_photos0_disconnect0_x, this_photos0_disconnect0_rel, this + UNWIND this_photos0_disconnect0_x as x DELETE this_photos0_disconnect0_rel } - CALL { + CALL(*) { WITH this, this_photos0_disconnect0 OPTIONAL MATCH (this_photos0_disconnect0)-[this_photos0_disconnect0_color0_rel:OF_COLOR]->(this_photos0_disconnect0_color0:Color) WHERE this_photos0_disconnect0_color0.name = $updateProducts_args_update_photos0_disconnect0_disconnect_color0_where_Color_this_photos0_disconnect0_color0param0 - CALL { - WITH this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 - WITH collect(this_photos0_disconnect0_color0) as this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 - UNWIND this_photos0_disconnect0_color0 as x + CALL (this_photos0_disconnect0_color0, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0) { + WITH collect(this_photos0_disconnect0_color0) as this_photos0_disconnect0_color0_x, this_photos0_disconnect0_color0_rel, this_photos0_disconnect0 + UNWIND this_photos0_disconnect0_color0_x as x DELETE this_photos0_disconnect0_color0_rel } RETURN count(*) AS disconnect_this_photos0_disconnect0_color_Color @@ -171,24 +166,22 @@ describe("Cypher Disconnect", () => { RETURN count(*) AS disconnect_this_photos0_disconnect_Photo } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_photos0_disconnect1_rel:HAS_PHOTO]->(this_photos0_disconnect1:Photo) WHERE this_photos0_disconnect1.id = $updateProducts_args_update_photos0_disconnect1_where_Photo_this_photos0_disconnect1param0 - CALL { - WITH this_photos0_disconnect1, this_photos0_disconnect1_rel, this - WITH collect(this_photos0_disconnect1) as this_photos0_disconnect1, this_photos0_disconnect1_rel, this - UNWIND this_photos0_disconnect1 as x + CALL (this_photos0_disconnect1, this_photos0_disconnect1_rel, this) { + WITH collect(this_photos0_disconnect1) as this_photos0_disconnect1_x, this_photos0_disconnect1_rel, this + UNWIND this_photos0_disconnect1_x as x DELETE this_photos0_disconnect1_rel } - CALL { + CALL(*) { WITH this, this_photos0_disconnect1 OPTIONAL MATCH (this_photos0_disconnect1)-[this_photos0_disconnect1_color0_rel:OF_COLOR]->(this_photos0_disconnect1_color0:Color) WHERE this_photos0_disconnect1_color0.name = $updateProducts_args_update_photos0_disconnect0_disconnect_color0_where_Color_this_photos0_disconnect1_color0param0 - CALL { - WITH this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 - WITH collect(this_photos0_disconnect1_color0) as this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 - UNWIND this_photos0_disconnect1_color0 as x + CALL (this_photos0_disconnect1_color0, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1) { + WITH collect(this_photos0_disconnect1_color0) as this_photos0_disconnect1_color0_x, this_photos0_disconnect1_color0_rel, this_photos0_disconnect1 + UNWIND this_photos0_disconnect1_color0_x as x DELETE this_photos0_disconnect1_color0_rel } RETURN count(*) AS disconnect_this_photos0_disconnect1_color_Color diff --git a/packages/graphql/tests/tck/operations/update.test.ts b/packages/graphql/tests/tck/operations/update.test.ts index 8a5b57ee99..4defa093bf 100644 --- a/packages/graphql/tests/tck/operations/update.test.ts +++ b/packages/graphql/tests/tck/operations/update.test.ts @@ -108,7 +108,7 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 @@ -190,13 +190,13 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 SET this_actors0.name = $this_update_actors0_name_SET WITH this, this_actors0 - CALL { + CALL(*) { WITH this, this_actors0 MATCH (this_actors0)-[this_actors0_acted_in0_relationship:ACTED_IN]->(this_actors0_movies0:Movie) WHERE this_actors0_movies0.id = $updateMovies_args_update_actors0_update_node_movies0_where_this_actors0_movies0param0 @@ -279,15 +279,13 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect0_node:Actor) WHERE this_actors0_connect0_node.name = $this_actors0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect0_node CREATE (this)<-[this_actors0_connect0_relationship:ACTED_IN]-(this_actors0_connect0_node) @@ -336,15 +334,13 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect0_node:Actor) WHERE this_actors0_connect0_node.name = $this_actors0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect0_node CREATE (this)<-[this_actors0_connect0_relationship:ACTED_IN]-(this_actors0_connect0_node) @@ -354,15 +350,13 @@ describe("Cypher Update", () => { RETURN count(*) AS connect_this_actors0_connect_Actor0 } WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_actors0_connect1_node:Actor) WHERE this_actors0_connect1_node.name = $this_actors0_connect1_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_actors0_connect1_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_actors0_connect1_node CREATE (this)<-[this_actors0_connect1_relationship:ACTED_IN]-(this_actors0_connect1_node) @@ -405,14 +399,13 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_actors0_disconnect0_rel:ACTED_IN]-(this_actors0_disconnect0:Actor) WHERE this_actors0_disconnect0.name = $updateMovies_args_update_actors0_disconnect0_where_Actor_this_actors0_disconnect0param0 - CALL { - WITH this_actors0_disconnect0, this_actors0_disconnect0_rel, this - WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0, this_actors0_disconnect0_rel, this - UNWIND this_actors0_disconnect0 as x + CALL (this_actors0_disconnect0, this_actors0_disconnect0_rel, this) { + WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0_x, this_actors0_disconnect0_rel, this + UNWIND this_actors0_disconnect0_x as x DELETE this_actors0_disconnect0_rel } RETURN count(*) AS disconnect_this_actors0_disconnect_Actor @@ -478,27 +471,25 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_actors0_disconnect0_rel:ACTED_IN]-(this_actors0_disconnect0:Actor) WHERE this_actors0_disconnect0.name = $updateMovies_args_update_actors0_disconnect0_where_Actor_this_actors0_disconnect0param0 - CALL { - WITH this_actors0_disconnect0, this_actors0_disconnect0_rel, this - WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0, this_actors0_disconnect0_rel, this - UNWIND this_actors0_disconnect0 as x + CALL (this_actors0_disconnect0, this_actors0_disconnect0_rel, this) { + WITH collect(this_actors0_disconnect0) as this_actors0_disconnect0_x, this_actors0_disconnect0_rel, this + UNWIND this_actors0_disconnect0_x as x DELETE this_actors0_disconnect0_rel } RETURN count(*) AS disconnect_this_actors0_disconnect_Actor } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)<-[this_actors0_disconnect1_rel:ACTED_IN]-(this_actors0_disconnect1:Actor) WHERE this_actors0_disconnect1.name = $updateMovies_args_update_actors0_disconnect1_where_Actor_this_actors0_disconnect1param0 - CALL { - WITH this_actors0_disconnect1, this_actors0_disconnect1_rel, this - WITH collect(this_actors0_disconnect1) as this_actors0_disconnect1, this_actors0_disconnect1_rel, this - UNWIND this_actors0_disconnect1 as x + CALL (this_actors0_disconnect1, this_actors0_disconnect1_rel, this) { + WITH collect(this_actors0_disconnect1) as this_actors0_disconnect1_x, this_actors0_disconnect1_rel, this + UNWIND this_actors0_disconnect1_x as x DELETE this_actors0_disconnect1_rel } RETURN count(*) AS disconnect_this_actors0_disconnect_Actor @@ -576,8 +567,7 @@ describe("Cypher Update", () => { SET this_movies0_create0_node.title = $this_movies0_create0_node_title MERGE (this)-[this_movies0_create0_relationship:ACTED_IN]->(this_movies0_create0_node) WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .id, .title } AS update_this1 @@ -626,8 +616,7 @@ describe("Cypher Update", () => { SET this_movies0_create0_node.title = $this_movies0_create0_node_title MERGE (this)-[this_movies0_create0_relationship:ACTED_IN]->(this_movies0_create0_node) WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .id, .title } AS update_this1 @@ -687,8 +676,7 @@ describe("Cypher Update", () => { SET this_movies0_create1_node.title = $this_movies0_create1_node_title MERGE (this)-[this_movies0_create1_relationship:ACTED_IN]->(this_movies0_create1_node) WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:ACTED_IN]->(update_this1:Movie) WITH DISTINCT update_this1 WITH update_this1 { .id, .title } AS update_this1 @@ -736,13 +724,11 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors0_delete0_relationship:ACTED_IN]-(this_actors0_delete0:Actor) WHERE (this_actors0_delete0.name = $updateMovies_args_update_actors0_delete0_where_this_actors0_delete0param0 AND this_actors0_delete0_relationship.screenTime = $updateMovies_args_update_actors0_delete0_where_this_actors0_delete0param1) WITH this_actors0_delete0_relationship, collect(DISTINCT this_actors0_delete0) AS this_actors0_delete0_to_delete - CALL { - WITH this_actors0_delete0_to_delete + CALL(this_actors0_delete0_to_delete) { UNWIND this_actors0_delete0_to_delete AS x DETACH DELETE x } @@ -821,19 +807,17 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors0_delete0_relationship:ACTED_IN]-(this_actors0_delete0:Actor) WHERE this_actors0_delete0.name = $updateMovies_args_update_actors0_delete0_where_this_actors0_delete0param0 WITH this_actors0_delete0_relationship, collect(DISTINCT this_actors0_delete0) AS this_actors0_delete0_to_delete - CALL { - WITH this_actors0_delete0_to_delete + CALL(this_actors0_delete0_to_delete) { UNWIND this_actors0_delete0_to_delete AS x DETACH DELETE x } } WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 @@ -908,13 +892,11 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors0_delete0_relationship:ACTED_IN]-(this_actors0_delete0:Actor) WHERE this_actors0_delete0.name = $updateMovies_args_update_actors0_delete0_where_this_actors0_delete0param0 WITH this_actors0_delete0_relationship, collect(DISTINCT this_actors0_delete0) AS this_actors0_delete0_to_delete - CALL { - WITH this_actors0_delete0_to_delete + CALL(this_actors0_delete0_to_delete) { UNWIND this_actors0_delete0_to_delete AS x DETACH DELETE x } @@ -980,25 +962,21 @@ describe("Cypher Update", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)<-[this_actors0_delete0_relationship:ACTED_IN]-(this_actors0_delete0:Actor) WHERE this_actors0_delete0.name = $updateMovies_args_update_actors0_delete0_where_this_actors0_delete0param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this_actors0_delete0)-[this_actors0_delete0_movies0_relationship:ACTED_IN]->(this_actors0_delete0_movies0:Movie) WHERE this_actors0_delete0_movies0.id = $updateMovies_args_update_actors0_delete0_delete_movies0_where_this_actors0_delete0_movies0param0 WITH this_actors0_delete0_movies0_relationship, collect(DISTINCT this_actors0_delete0_movies0) AS this_actors0_delete0_movies0_to_delete - CALL { - WITH this_actors0_delete0_movies0_to_delete + CALL(this_actors0_delete0_movies0_to_delete) { UNWIND this_actors0_delete0_movies0_to_delete AS x DETACH DELETE x } } WITH this_actors0_delete0_relationship, collect(DISTINCT this_actors0_delete0) AS this_actors0_delete0_to_delete - CALL { - WITH this_actors0_delete0_to_delete + CALL(this_actors0_delete0_to_delete) { UNWIND this_actors0_delete0_to_delete AS x DETACH DELETE x } diff --git a/packages/graphql/tests/tck/pagination/cypher-connection-pagination.test.ts b/packages/graphql/tests/tck/pagination/cypher-connection-pagination.test.ts index 3afd6e44e9..22cac40de9 100644 --- a/packages/graphql/tests/tck/pagination/cypher-connection-pagination.test.ts +++ b/packages/graphql/tests/tck/pagination/cypher-connection-pagination.test.ts @@ -109,14 +109,11 @@ describe("Cypher Connection pagination", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -154,14 +151,11 @@ describe("Cypher Connection pagination", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -200,24 +194,19 @@ describe("Cypher Connection pagination", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } WITH count AS this1 RETURN this1 AS var2 } - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -263,14 +252,11 @@ describe("Cypher Connection pagination", () => { WHERE this0.title = $param0 WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 - CALL { - WITH this0 + CALL (this0) { + CALL (this0) { WITH this0 AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } @@ -327,23 +313,18 @@ describe("Cypher Connection pagination", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)-[this1:HAS_GENRE]->(this2:Genre) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)<-[:HAS_GENRE]-(movie:Movie) RETURN count(DISTINCT movie) as result @@ -396,23 +377,18 @@ describe("Cypher Connection pagination", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 - CALL { - WITH this2 - CALL { - WITH this2 + CALL (this2) { + CALL (this2) { WITH this2 AS this MATCH (this)-[r:ACTED_IN]->(:Movie) RETURN sum(r.screenTime) as sum diff --git a/packages/graphql/tests/tck/pagination/cypher-pagination.test.ts b/packages/graphql/tests/tck/pagination/cypher-pagination.test.ts index d41032002b..277e2c1a0d 100644 --- a/packages/graphql/tests/tck/pagination/cypher-pagination.test.ts +++ b/packages/graphql/tests/tck/pagination/cypher-pagination.test.ts @@ -99,10 +99,8 @@ describe("Cypher Sort tests", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -132,10 +130,8 @@ describe("Cypher Sort tests", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -166,20 +162,16 @@ describe("Cypher Sort tests", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } WITH count AS this0 RETURN this0 AS var1 } - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (this)-[:HAS_GENRE]->(genre:Genre) RETURN count(DISTINCT genre) as result @@ -216,10 +208,8 @@ describe("Cypher Sort tests", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { WITH this AS this MATCH (actor:Actor)-[:ACTED_IN]->(this) RETURN count(actor) as count } @@ -264,14 +254,11 @@ describe("Cypher Sort tests", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 - CALL { - WITH this1 - CALL { - WITH this1 + CALL (this1) { + CALL (this1) { WITH this1 AS this MATCH (this)<-[:HAS_GENRE]-(movie:Movie) RETURN count(DISTINCT movie) as result diff --git a/packages/graphql/tests/tck/pagination/sort.test.ts b/packages/graphql/tests/tck/pagination/sort.test.ts index ce6d5ca1f1..85406a0e2d 100644 --- a/packages/graphql/tests/tck/pagination/sort.test.ts +++ b/packages/graphql/tests/tck/pagination/sort.test.ts @@ -165,8 +165,7 @@ describe("Sort", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -195,8 +194,7 @@ describe("Sort", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:HAS_GENRE]->(this1:Genre) WITH DISTINCT this1 WITH this1 { .name } AS this1 diff --git a/packages/graphql/tests/tck/pringles.test.ts b/packages/graphql/tests/tck/pringles.test.ts index deb4dca43c..5fd8bd5dd5 100644 --- a/packages/graphql/tests/tck/pringles.test.ts +++ b/packages/graphql/tests/tck/pringles.test.ts @@ -107,7 +107,7 @@ describe("Cypher Create Pringles", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Product) SET this0.id = $this0_id SET this0.name = $this0_name @@ -143,15 +143,13 @@ describe("Cypher Create Pringles", () => { SET this0_photos1_node.description = $this0_photos1_node_description SET this0_photos1_node.url = $this0_photos1_node_url WITH * - CALL { + CALL(*) { WITH this0, this0_photos1_node OPTIONAL MATCH (this0_photos1_node_color_connect0_node:Color) WHERE this0_photos1_node_color_connect0_node.id = $this0_photos1_node_color_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_photos1_node_color_connect0_node) as connectedNodes, collect(this0_photos1_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_photos1_node UNWIND connectedNodes as this0_photos1_node_color_connect0_node CREATE (this0_photos1_node)-[:OF_COLOR]->(this0_photos1_node_color_connect0_node) @@ -167,15 +165,13 @@ describe("Cypher Create Pringles", () => { SET this0_photos2_node.description = $this0_photos2_node_description SET this0_photos2_node.url = $this0_photos2_node_url WITH * - CALL { + CALL(*) { WITH this0, this0_photos2_node OPTIONAL MATCH (this0_photos2_node_color_connect0_node:Color) WHERE this0_photos2_node_color_connect0_node.id = $this0_photos2_node_color_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH this0, collect(this0_photos2_node_color_connect0_node) as connectedNodes, collect(this0_photos2_node) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0_photos2_node UNWIND connectedNodes as this0_photos2_node_color_connect0_node CREATE (this0_photos2_node)-[:OF_COLOR]->(this0_photos2_node_color_connect0_node) @@ -187,8 +183,7 @@ describe("Cypher Create Pringles", () => { MERGE (this0)-[:HAS_PHOTO]->(this0_photos2_node) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .id } AS create_var0 } RETURN [create_var0] AS data" @@ -258,34 +253,31 @@ describe("Cypher Create Pringles", () => { MATCH (this:Product) WHERE this.name = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_has_photo0_relationship:HAS_PHOTO]->(this_photos0:Photo) WHERE this_photos0.description = $updateProducts_args_update_photos0_where_this_photos0param0 SET this_photos0.description = $this_update_photos0_description_SET WITH this, this_photos0 - CALL { + CALL(*) { WITH this, this_photos0 OPTIONAL MATCH (this_photos0)-[this_photos0_color0_disconnect0_rel:OF_COLOR]->(this_photos0_color0_disconnect0:Color) WHERE this_photos0_color0_disconnect0.name = $updateProducts_args_update_photos0_update_node_color0_disconnect0_where_Color_this_photos0_color0_disconnect0param0 - CALL { - WITH this_photos0_color0_disconnect0, this_photos0_color0_disconnect0_rel, this_photos0 - WITH collect(this_photos0_color0_disconnect0) as this_photos0_color0_disconnect0, this_photos0_color0_disconnect0_rel, this_photos0 - UNWIND this_photos0_color0_disconnect0 as x + CALL (this_photos0_color0_disconnect0, this_photos0_color0_disconnect0_rel, this_photos0) { + WITH collect(this_photos0_color0_disconnect0) as this_photos0_color0_disconnect0_x, this_photos0_color0_disconnect0_rel, this_photos0 + UNWIND this_photos0_color0_disconnect0_x as x DELETE this_photos0_color0_disconnect0_rel } RETURN count(*) AS disconnect_this_photos0_color0_disconnect_Color } WITH * - CALL { + CALL(*) { WITH this, this_photos0 OPTIONAL MATCH (this_photos0_color0_connect0_node:Color) WHERE this_photos0_color0_connect0_node.name = $this_photos0_color0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH this, collect(this_photos0_color0_connect0_node) as connectedNodes, collect(this_photos0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this_photos0 UNWIND connectedNodes as this_photos0_color0_connect0_node CREATE (this_photos0)-[:OF_COLOR]->(this_photos0_color0_connect0_node) diff --git a/packages/graphql/tests/tck/projection.test.ts b/packages/graphql/tests/tck/projection.test.ts index 162801eea0..13405813f2 100644 --- a/packages/graphql/tests/tck/projection.test.ts +++ b/packages/graphql/tests/tck/projection.test.ts @@ -89,31 +89,27 @@ describe("Cypher Projection", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Product) SET create_this1.id = create_var0.id RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this2:HAS_PHOTO]->(create_this3:Photo) WHERE create_this3.url = $create_param1 WITH DISTINCT create_this3 WITH create_this3 { .url, .location } AS create_this3 RETURN collect(create_this3) AS create_var4 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this5:HAS_COLOR]->(create_this6:Color) WHERE create_this6.id = $create_param2 WITH DISTINCT create_this6 WITH create_this6 { .id } AS create_this6 RETURN collect(create_this6) AS create_var7 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)-[create_this8:HAS_SIZE]->(create_this9:Size) WHERE create_this9.name = $create_param3 WITH DISTINCT create_this9 diff --git a/packages/graphql/tests/tck/rfcs/query-limits.test.ts b/packages/graphql/tests/tck/rfcs/query-limits.test.ts index 2b53bb3801..f6d3728570 100644 --- a/packages/graphql/tests/tck/rfcs/query-limits.test.ts +++ b/packages/graphql/tests/tck/rfcs/query-limits.test.ts @@ -159,8 +159,7 @@ describe("tck/rfcs/query-limits", () => { MATCH (this:Movie) WITH * LIMIT $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH DISTINCT this1 WITH this1 { .id } AS this1 @@ -207,13 +206,11 @@ describe("tck/rfcs/query-limits", () => { MATCH (this:Movie) WITH * LIMIT $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -262,13 +259,11 @@ describe("tck/rfcs/query-limits", () => { MATCH (this:Movie) WITH * LIMIT $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -315,13 +310,11 @@ describe("tck/rfcs/query-limits", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Festival) - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:PART_OF]-(this1:Show) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 WITH * @@ -362,8 +355,7 @@ describe("tck/rfcs/query-limits", () => { MATCH (this:Movie) WITH * LIMIT $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH DISTINCT this1 WITH this1 { .id } AS this1 diff --git a/packages/graphql/tests/tck/rfcs/rfc-022.test.ts b/packages/graphql/tests/tck/rfcs/rfc-022.test.ts index f3dcc0a210..c54114e4fa 100644 --- a/packages/graphql/tests/tck/rfcs/rfc-022.test.ts +++ b/packages/graphql/tests/tck/rfcs/rfc-022.test.ts @@ -69,8 +69,7 @@ describe("tck/rfs/022 subquery projection", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.released = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WHERE this1.name = $param1 WITH DISTINCT this1 @@ -113,13 +112,11 @@ describe("tck/rfs/022 subquery projection", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.released = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WHERE this1.name = $param1 WITH DISTINCT this1 - CALL { - WITH this1 + CALL (this1) { MATCH (this1)-[this2:DIRECTED]->(this3:Movie) WITH DISTINCT this3 WITH this3 { .title, .released } AS this3 @@ -205,8 +202,7 @@ describe("tck/rfs/022 subquery projection", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.released = $param0 - CALL { - WITH this + CALL (this) { MATCH (this)<-[this0:ACTED_IN]-(this1:Person) WITH DISTINCT this1 WITH * diff --git a/packages/graphql/tests/tck/root-connection.test.ts b/packages/graphql/tests/tck/root-connection.test.ts index 1cb287f4ca..7e6885d93a 100644 --- a/packages/graphql/tests/tck/root-connection.test.ts +++ b/packages/graphql/tests/tck/root-connection.test.ts @@ -65,8 +65,7 @@ describe("Root Connection Query tests", () => { WHERE this0.title = $param0 WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 RETURN collect({ node: { title: this0.title, __resolveType: \\"Movie\\" } }) AS var1 @@ -101,8 +100,7 @@ describe("Root Connection Query tests", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * @@ -141,8 +139,7 @@ describe("Root Connection Query tests", () => { WHERE this0.title CONTAINS $param0 WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * @@ -188,20 +185,17 @@ describe("Root Connection Query tests", () => { MATCH (this0:Movie) WITH collect({ node: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this0 WITH * ORDER BY this0.title ASC LIMIT $param0 - CALL { - WITH this0 + CALL (this0) { MATCH (this0)<-[this1:ACTED_IN]-(this2:Actor) WITH collect({ node: this2, relationship: this1 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this2, edge.relationship AS this1 RETURN collect({ node: { name: this2.name, __resolveType: \\"Actor\\" } }) AS var3 diff --git a/packages/graphql/tests/tck/subscriptions/create-auth.test.ts b/packages/graphql/tests/tck/subscriptions/create-auth.test.ts index 02c8cc0ecf..90cc5382f3 100644 --- a/packages/graphql/tests/tck/subscriptions/create-auth.test.ts +++ b/packages/graphql/tests/tck/subscriptions/create-auth.test.ts @@ -70,8 +70,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Actor) SET create_this1.id = create_var0.id diff --git a/packages/graphql/tests/tck/subscriptions/create.test.ts b/packages/graphql/tests/tck/subscriptions/create.test.ts index b535c8abf9..61d0f96516 100644 --- a/packages/graphql/tests/tck/subscriptions/create.test.ts +++ b/packages/graphql/tests/tck/subscriptions/create.test.ts @@ -103,14 +103,12 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -122,13 +120,11 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH collect({ node: create_this7, relationship: create_this6 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this7, edge.relationship AS create_this6 RETURN collect({ properties: { screenTime: create_this6.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this7.name, __resolveType: \\"Actor\\" } }) AS create_var8 @@ -208,14 +204,12 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -225,13 +219,11 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH collect({ node: create_this7, relationship: create_this6 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this7, edge.relationship AS create_this6 RETURN collect({ node: { name: create_this7.name, __resolveType: \\"Actor\\" } }) AS create_var8 @@ -329,14 +321,12 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.title = create_var0.title WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -345,8 +335,7 @@ describe("Subscriptions metadata on create", () => { SET create_this4.screenTime = create_var2.edge.screenTime WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.movies.create AS create_var5 CREATE (create_this6:Movie) SET @@ -360,13 +349,11 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this10:ACTED_IN]-(create_this11:Actor) WITH collect({ node: create_this11, relationship: create_this10 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS create_this11, edge.relationship AS create_this10 RETURN collect({ properties: { screenTime: create_this10.screenTime, __resolveType: \\"ActedIn\\" }, node: { name: create_this11.name, __resolveType: \\"Actor\\" } }) AS create_var12 @@ -484,7 +471,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * @@ -499,20 +486,18 @@ describe("Subscriptions metadata on create", () => { SET this0_directors_Actor0_relationship.year = $this0_directors_Actor0_relationship_year RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[create_this0:DIRECTED]-(create_this1:Person) - WITH create_this1 { .name, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .name, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)<-[create_this3:DIRECTED]-(create_this4:Actor) - WITH create_this4 { .name, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .name, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 @@ -624,7 +609,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * @@ -644,27 +629,24 @@ describe("Subscriptions metadata on create", () => { SET this0_directors_Actor0_relationship.year = $this0_directors_Actor0_relationship_year RETURN this0 } - CALL { - WITH this0 - CALL { - WITH this0 - CALL { + CALL (this0) { + CALL (this0) { + CALL (*) { WITH * MATCH (this0)<-[create_this0:DIRECTED]-(create_this1:Person) - WITH create_this1 { .name, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_this1 - RETURN create_this1 AS create_var2 + WITH create_this1 { .name, __resolveType: \\"Person\\", __id: id(create_this1) } AS create_var2 + RETURN create_var2 UNION WITH * MATCH (this0)<-[create_this3:DIRECTED]-(create_this4:Actor) - CALL { - WITH create_this4 + CALL (create_this4) { MATCH (create_this4)-[create_this5:ACTED_IN]->(create_this6:Movie) WITH DISTINCT create_this6 WITH create_this6 { .title } AS create_this6 RETURN collect(create_this6) AS create_var7 } - WITH create_this4 { .name, movies: create_var7, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_this4 - RETURN create_this4 AS create_var2 + WITH create_this4 { .name, movies: create_var7, __resolveType: \\"Actor\\", __id: id(create_this4) } AS create_var2 + RETURN create_var2 } WITH create_var2 RETURN collect(create_var2) AS create_var2 @@ -712,8 +694,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -749,8 +730,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id @@ -792,14 +772,12 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET @@ -809,8 +787,7 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this6:ACTED_IN]-(create_this7:Actor) WITH DISTINCT create_this7 WITH create_this7 { .name } AS create_this7 @@ -865,22 +842,19 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET create_this3.name = create_var2.node.name MERGE (create_this1)<-[create_this4:ACTED_IN]-(create_this3) WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.movies.create AS create_var5 CREATE (create_this6:Movie) SET @@ -892,8 +866,7 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this10:ACTED_IN]-(create_this11:Actor) WITH DISTINCT create_this11 WITH create_this11 { .name } AS create_this11 @@ -974,30 +947,26 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET create_this3.name = create_var2.node.name MERGE (create_this1)<-[create_this4:ACTED_IN]-(create_this3) WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.movies.create AS create_var5 CREATE (create_this6:Movie) SET create_this6.id = create_var5.node.id MERGE (create_this3)-[create_this7:ACTED_IN]->(create_this6) WITH create_this6, create_var5 - CALL { - WITH create_this6, create_var5 + CALL (create_this6, create_var5) { UNWIND create_var5.node.actors.create AS create_var8 CREATE (create_this9:Actor) SET @@ -1011,16 +980,13 @@ describe("Subscriptions metadata on create", () => { } RETURN create_this1 } - CALL { - WITH create_this1 + CALL (create_this1) { MATCH (create_this1)<-[create_this14:ACTED_IN]-(create_this15:Actor) WITH DISTINCT create_this15 - CALL { - WITH create_this15 + CALL (create_this15) { MATCH (create_this15)-[create_this16:ACTED_IN]->(create_this17:Movie) WITH DISTINCT create_this17 - CALL { - WITH create_this17 + CALL (create_this17) { MATCH (create_this17)<-[create_this18:ACTED_IN]-(create_this19:Actor) WITH DISTINCT create_this19 WITH create_this19 { .name } AS create_this19 @@ -1100,22 +1066,19 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id WITH create_this1, create_var0 - CALL { - WITH create_this1, create_var0 + CALL (create_this1, create_var0) { UNWIND create_var0.actors.create AS create_var2 CREATE (create_this3:Actor) SET create_this3.name = create_var2.node.name MERGE (create_this1)<-[create_this4:ACTED_IN]-(create_this3) WITH create_this3, create_var2 - CALL { - WITH create_this3, create_var2 + CALL (create_this3, create_var2) { UNWIND create_var2.node.movies.create AS create_var5 CREATE (create_this6:Movie) SET @@ -1196,8 +1159,7 @@ describe("Subscriptions metadata on create", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.id = create_var0.id diff --git a/packages/graphql/tests/tck/subscriptions/delete.test.ts b/packages/graphql/tests/tck/subscriptions/delete.test.ts index a1942d5787..3ec7a197a4 100644 --- a/packages/graphql/tests/tck/subscriptions/delete.test.ts +++ b/packages/graphql/tests/tck/subscriptions/delete.test.ts @@ -90,13 +90,11 @@ describe("Subscriptions metadata on delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH this0, collect(DISTINCT this1) AS var2 - CALL { - WITH var2 + CALL (var2) { UNWIND var2 AS var3 DETACH DELETE var3 } @@ -141,37 +139,31 @@ describe("Subscriptions metadata on delete", () => { MATCH (this:Movie) WHERE this.id = $param0 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)<-[this0:ACTED_IN]-(this1:Actor) WHERE this1.name = $param1 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this1)-[this2:ACTED_IN]->(this3:Movie) WHERE this3.id = $param2 WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this3)<-[this4:ACTED_IN]-(this5:Actor) WHERE this5.name = $param3 WITH this4, collect(DISTINCT this5) AS var6 - CALL { - WITH var6 + CALL (var6) { UNWIND var6 AS var7 DETACH DELETE var7 } } WITH this2, collect(DISTINCT this3) AS var8 - CALL { - WITH var8 + CALL (var8) { UNWIND var8 AS var9 DETACH DELETE var9 } } WITH this0, collect(DISTINCT this1) AS var10 - CALL { - WITH var10 + CALL (var10) { UNWIND var10 AS var11 DETACH DELETE var11 } diff --git a/packages/graphql/tests/tck/subscriptions/update.test.ts b/packages/graphql/tests/tck/subscriptions/update.test.ts index 4c48861e95..b73d028469 100644 --- a/packages/graphql/tests/tck/subscriptions/update.test.ts +++ b/packages/graphql/tests/tck/subscriptions/update.test.ts @@ -103,7 +103,7 @@ describe("Subscriptions metadata on update", () => { WHERE this.id = $param0 SET this.id = $this_update_id_SET WITH this - CALL { + CALL(*) { WITH this MATCH (this)<-[this_acted_in0_relationship:ACTED_IN]-(this_actors0:Actor) WHERE this_actors0.name = $updateMovies_args_update_actors0_where_this_actors0param0 diff --git a/packages/graphql/tests/tck/types/date.test.ts b/packages/graphql/tests/tck/types/date.test.ts index 0bf19fb98d..93fd51325f 100644 --- a/packages/graphql/tests/tck/types/date.test.ts +++ b/packages/graphql/tests/tck/types/date.test.ts @@ -111,8 +111,7 @@ describe("Cypher Date", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.date = create_var0.date diff --git a/packages/graphql/tests/tck/types/datetime.test.ts b/packages/graphql/tests/tck/types/datetime.test.ts index 9681a10ce5..fbbeed03ac 100644 --- a/packages/graphql/tests/tck/types/datetime.test.ts +++ b/packages/graphql/tests/tck/types/datetime.test.ts @@ -78,8 +78,7 @@ describe("Cypher DateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.datetime = datetime(create_var0.datetime) diff --git a/packages/graphql/tests/tck/types/duration.test.ts b/packages/graphql/tests/tck/types/duration.test.ts index 40437ab06b..9eda71c001 100644 --- a/packages/graphql/tests/tck/types/duration.test.ts +++ b/packages/graphql/tests/tck/types/duration.test.ts @@ -125,8 +125,7 @@ describe("Cypher Duration", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.duration = create_var0.duration diff --git a/packages/graphql/tests/tck/types/localdatetime.test.ts b/packages/graphql/tests/tck/types/localdatetime.test.ts index d3c43f1a06..3a3c9c8ac0 100644 --- a/packages/graphql/tests/tck/types/localdatetime.test.ts +++ b/packages/graphql/tests/tck/types/localdatetime.test.ts @@ -119,8 +119,7 @@ describe("Cypher LocalDateTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.localDT = create_var0.localDT diff --git a/packages/graphql/tests/tck/types/localtime.test.ts b/packages/graphql/tests/tck/types/localtime.test.ts index 1e58e52aa5..5199626e24 100644 --- a/packages/graphql/tests/tck/types/localtime.test.ts +++ b/packages/graphql/tests/tck/types/localtime.test.ts @@ -113,8 +113,7 @@ describe("Cypher LocalTime", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.time = create_var0.time diff --git a/packages/graphql/tests/tck/types/point.test.ts b/packages/graphql/tests/tck/types/point.test.ts index 1e6393a39e..1e2fef1dbb 100644 --- a/packages/graphql/tests/tck/types/point.test.ts +++ b/packages/graphql/tests/tck/types/point.test.ts @@ -336,8 +336,7 @@ describe("Cypher Points", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:PointContainer) SET create_this1.point = point(create_var0.point) diff --git a/packages/graphql/tests/tck/types/points.test.ts b/packages/graphql/tests/tck/types/points.test.ts index 68c56e628c..ab663dc581 100644 --- a/packages/graphql/tests/tck/types/points.test.ts +++ b/packages/graphql/tests/tck/types/points.test.ts @@ -156,8 +156,7 @@ describe("Cypher Points", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:PointContainer) SET create_this1.points = [create_var2 IN create_var0.points | point(create_var2)] diff --git a/packages/graphql/tests/tck/types/time.test.ts b/packages/graphql/tests/tck/types/time.test.ts index eb6d9868e3..cf2fd26378 100644 --- a/packages/graphql/tests/tck/types/time.test.ts +++ b/packages/graphql/tests/tck/types/time.test.ts @@ -103,8 +103,7 @@ describe("Cypher Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.time = time(create_var0.time) @@ -169,8 +168,7 @@ describe("Cypher Time", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 UNWIND $create_param0 AS create_var0 - CALL { - WITH create_var0 + CALL (create_var0) { CREATE (create_this1:Movie) SET create_this1.time = time(create_var0.time) diff --git a/packages/graphql/tests/tck/undirected-relationships/query-direction-aggregations.test.ts b/packages/graphql/tests/tck/undirected-relationships/query-direction-aggregations.test.ts index bae0d9a95d..a3778f3fcd 100644 --- a/packages/graphql/tests/tck/undirected-relationships/query-direction-aggregations.test.ts +++ b/packages/graphql/tests/tck/undirected-relationships/query-direction-aggregations.test.ts @@ -54,10 +54,8 @@ describe("QueryDirection in relationships aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]->(this1:User) RETURN { nodes: count(DISTINCT this1) } AS var2 } @@ -98,10 +96,8 @@ describe("QueryDirection in relationships aggregations", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this - CALL { - WITH this + CALL (this) { + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]-(this1:User) RETURN { nodes: count(DISTINCT this1) } AS var2 } diff --git a/packages/graphql/tests/tck/undirected-relationships/query-direction-connection.test.ts b/packages/graphql/tests/tck/undirected-relationships/query-direction-connection.test.ts index 38dd3daa10..5c12aaeb24 100644 --- a/packages/graphql/tests/tck/undirected-relationships/query-direction-connection.test.ts +++ b/packages/graphql/tests/tck/undirected-relationships/query-direction-connection.test.ts @@ -50,13 +50,11 @@ describe("QueryDirection in relationships connection", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]->(this1:User) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { __id: id(this1), __resolveType: \\"User\\" } }) AS var2 @@ -95,13 +93,11 @@ describe("QueryDirection in relationships connection", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]-(this1:User) WITH collect({ node: this1, relationship: this0 }) AS edges WITH edges, size(edges) AS totalCount - CALL { - WITH edges + CALL (edges) { UNWIND edges AS edge WITH edge.node AS this1, edge.relationship AS this0 RETURN collect({ node: { __id: id(this1), __resolveType: \\"User\\" } }) AS var2 diff --git a/packages/graphql/tests/tck/undirected-relationships/query-direction.test.ts b/packages/graphql/tests/tck/undirected-relationships/query-direction.test.ts index d493bf5243..2233939ce4 100644 --- a/packages/graphql/tests/tck/undirected-relationships/query-direction.test.ts +++ b/packages/graphql/tests/tck/undirected-relationships/query-direction.test.ts @@ -54,8 +54,7 @@ describe("queryDirection in relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]->(this1:User) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -88,8 +87,7 @@ describe("queryDirection in relationships", () => { MATCH (this)-[:FRIENDS_WITH]->(this0:User) WHERE this0.name = $param0 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this1:FRIENDS_WITH]->(this2:User) WITH DISTINCT this2 WITH this2 { .name } AS this2 @@ -132,21 +130,19 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_friends0_disconnect0_rel:FRIENDS_WITH]->(this_friends0_disconnect0:User) WHERE this_friends0_disconnect0.name = $updateUsers_args_update_friends0_disconnect0_where_User_this_friends0_disconnect0param0 - CALL { - WITH this_friends0_disconnect0, this_friends0_disconnect0_rel, this - WITH collect(this_friends0_disconnect0) as this_friends0_disconnect0, this_friends0_disconnect0_rel, this - UNWIND this_friends0_disconnect0 as x + CALL (this_friends0_disconnect0, this_friends0_disconnect0_rel, this) { + WITH collect(this_friends0_disconnect0) as this_friends0_disconnect0_x, this_friends0_disconnect0_rel, this + UNWIND this_friends0_disconnect0_x as x DELETE this_friends0_disconnect0_rel } RETURN count(*) AS disconnect_this_friends0_disconnect_User } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]->(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -212,20 +208,17 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_friends0_delete0_relationship:FRIENDS_WITH]->(this_friends0_delete0:User) WHERE this_friends0_delete0.name = $updateUsers_args_update_friends0_delete0_where_this_friends0_delete0param0 WITH this_friends0_delete0_relationship, collect(DISTINCT this_friends0_delete0) AS this_friends0_delete0_to_delete - CALL { - WITH this_friends0_delete0_to_delete + CALL(this_friends0_delete0_to_delete) { UNWIND this_friends0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]->(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -298,7 +291,7 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_friends_with0_relationship:FRIENDS_WITH]->(this_friends0:User) WHERE this_friends0.name = $updateUsers_args_update_friends0_where_this_friends0param0 @@ -306,8 +299,7 @@ describe("queryDirection in relationships", () => { RETURN count(*) AS update_this_friends0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]->(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -370,13 +362,11 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this1:FRIENDS_WITH]->(this2:User) WHERE this2.name = $param1 WITH this1, collect(DISTINCT this2) AS var3 - CALL { - WITH var3 + CALL (var3) { UNWIND var3 AS var4 DETACH DELETE var4 } @@ -427,8 +417,7 @@ describe("queryDirection in relationships", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:User) - CALL { - WITH this + CALL (this) { MATCH (this)-[this0:FRIENDS_WITH]-(this1:User) WITH DISTINCT this1 WITH this1 { .name } AS this1 @@ -461,8 +450,7 @@ describe("queryDirection in relationships", () => { MATCH (this)-[:FRIENDS_WITH]-(this0:User) WHERE this0.name = $param0 } - CALL { - WITH this + CALL (this) { MATCH (this)-[this1:FRIENDS_WITH]-(this2:User) WITH DISTINCT this2 WITH this2 { .name } AS this2 @@ -505,21 +493,19 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_friends0_disconnect0_rel:FRIENDS_WITH]-(this_friends0_disconnect0:User) WHERE this_friends0_disconnect0.name = $updateUsers_args_update_friends0_disconnect0_where_User_this_friends0_disconnect0param0 - CALL { - WITH this_friends0_disconnect0, this_friends0_disconnect0_rel, this - WITH collect(this_friends0_disconnect0) as this_friends0_disconnect0, this_friends0_disconnect0_rel, this - UNWIND this_friends0_disconnect0 as x + CALL (this_friends0_disconnect0, this_friends0_disconnect0_rel, this) { + WITH collect(this_friends0_disconnect0) as this_friends0_disconnect0_x, this_friends0_disconnect0_rel, this + UNWIND this_friends0_disconnect0_x as x DELETE this_friends0_disconnect0_rel } RETURN count(*) AS disconnect_this_friends0_disconnect_User } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]-(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -585,20 +571,17 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_friends0_delete0_relationship:FRIENDS_WITH]-(this_friends0_delete0:User) WHERE this_friends0_delete0.name = $updateUsers_args_update_friends0_delete0_where_this_friends0_delete0param0 WITH this_friends0_delete0_relationship, collect(DISTINCT this_friends0_delete0) AS this_friends0_delete0_to_delete - CALL { - WITH this_friends0_delete0_to_delete + CALL(this_friends0_delete0_to_delete) { UNWIND this_friends0_delete0_to_delete AS x DETACH DELETE x } } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]-(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -671,7 +654,7 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_friends_with0_relationship:FRIENDS_WITH]-(this_friends0:User) WHERE this_friends0.name = $updateUsers_args_update_friends0_where_this_friends0param0 @@ -679,8 +662,7 @@ describe("queryDirection in relationships", () => { RETURN count(*) AS update_this_friends0 } WITH * - CALL { - WITH this + CALL (this) { MATCH (this)-[update_this0:FRIENDS_WITH]-(update_this1:User) WITH DISTINCT update_this1 WITH update_this1 { .name } AS update_this1 @@ -743,13 +725,11 @@ describe("queryDirection in relationships", () => { WHERE this0.name = $param0 } WITH * - CALL { - WITH * + CALL (*) { OPTIONAL MATCH (this)-[this1:FRIENDS_WITH]-(this2:User) WHERE this2.name = $param1 WITH this1, collect(DISTINCT this2) AS var3 - CALL { - WITH var3 + CALL (var3) { UNWIND var3 AS var4 DETACH DELETE var4 } diff --git a/packages/graphql/tests/tck/union.test.ts b/packages/graphql/tests/tck/union.test.ts index ab79e7a158..6565870206 100644 --- a/packages/graphql/tests/tck/union.test.ts +++ b/packages/graphql/tests/tck/union.test.ts @@ -78,19 +78,18 @@ describe("Cypher Union", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Genre) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.jwtAllowedNamesExample IS NOT NULL AND this1.name = $jwt.jwtAllowedNamesExample)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Movie) - WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -128,19 +127,18 @@ describe("Cypher Union", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 MATCH (this:Movie) - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Genre) CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.jwtAllowedNamesExample IS NOT NULL AND this1.name = $jwt.jwtAllowedNamesExample)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Movie) - WITH this4 { __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 RETURN collect(var2) AS var2 @@ -186,21 +184,20 @@ describe("Cypher Union", () => { "CYPHER 5 MATCH (this:Movie) WHERE this.title = $param0 - CALL { - WITH this - CALL { + CALL (this) { + CALL (*) { WITH * MATCH (this)-[this0:SEARCH]->(this1:Genre) WHERE this1.name = $param1 CALL apoc.util.validate(NOT ($isAuthenticated = true AND ($jwt.jwtAllowedNamesExample IS NOT NULL AND this1.name = $jwt.jwtAllowedNamesExample)), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS this1 - RETURN this1 AS var2 + WITH this1 { .name, __resolveType: \\"Genre\\", __id: id(this1) } AS var2 + RETURN var2 UNION WITH * MATCH (this)-[this3:SEARCH]->(this4:Movie) WHERE this4.title = $param4 - WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS this4 - RETURN this4 AS var2 + WITH this4 { .title, __resolveType: \\"Movie\\", __id: id(this4) } AS var2 + RETURN var2 } WITH var2 SKIP $param5 @@ -250,7 +247,7 @@ describe("Cypher Union", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * @@ -259,8 +256,7 @@ describe("Cypher Union", () => { MERGE (this0)-[:SEARCH]->(this0_search_Genre0_node) RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .title } AS create_var0 } RETURN [create_var0] AS data" @@ -330,19 +326,17 @@ describe("Cypher Union", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "CYPHER 5 - CALL { + CALL(*) { CREATE (this0:Movie) SET this0.title = $this0_title WITH * - CALL { + CALL(*) { WITH this0 OPTIONAL MATCH (this0_search_Genre_connect0_node:Genre) WHERE this0_search_Genre_connect0_node.name = $this0_search_Genre_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this0_search_Genre_connect0_node) as connectedNodes, collect(this0) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this0 UNWIND connectedNodes as this0_search_Genre_connect0_node CREATE (this0)-[:SEARCH]->(this0_search_Genre_connect0_node) @@ -353,8 +347,7 @@ describe("Cypher Union", () => { } RETURN this0 } - CALL { - WITH this0 + CALL (this0) { RETURN this0 { .title } AS create_var0 } RETURN [create_var0] AS data" @@ -400,7 +393,7 @@ describe("Cypher Union", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { + CALL(*) { WITH this MATCH (this)-[this_search0_relationship:SEARCH]->(this_search_Genre0:Genre) WHERE this_search_Genre0.name = $updateMovies_args_update_search_Genre0_where_this_search_Genre0param0 @@ -466,14 +459,13 @@ describe("Cypher Union", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH this - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this)-[this_search_Genre0_disconnect0_rel:SEARCH]->(this_search_Genre0_disconnect0:Genre) WHERE this_search_Genre0_disconnect0.name = $updateMovies_args_update_search_Genre0_disconnect0_where_Genre_this_search_Genre0_disconnect0param0 - CALL { - WITH this_search_Genre0_disconnect0, this_search_Genre0_disconnect0_rel, this - WITH collect(this_search_Genre0_disconnect0) as this_search_Genre0_disconnect0, this_search_Genre0_disconnect0_rel, this - UNWIND this_search_Genre0_disconnect0 as x + CALL (this_search_Genre0_disconnect0, this_search_Genre0_disconnect0_rel, this) { + WITH collect(this_search_Genre0_disconnect0) as this_search_Genre0_disconnect0_x, this_search_Genre0_disconnect0_rel, this + UNWIND this_search_Genre0_disconnect0_x as x DELETE this_search_Genre0_disconnect0_rel } RETURN count(*) AS disconnect_this_search_Genre0_disconnect_Genre @@ -535,15 +527,13 @@ describe("Cypher Union", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { + CALL(*) { WITH this OPTIONAL MATCH (this_search_Genre0_connect0_node:Genre) WHERE this_search_Genre0_connect0_node.name = $this_search_Genre0_connect0_node_param0 - CALL { - WITH * + CALL(*) { WITH collect(this_search_Genre0_connect0_node) as connectedNodes, collect(this) as parentNodes - CALL { - WITH connectedNodes, parentNodes + CALL(connectedNodes, parentNodes) { UNWIND parentNodes as this UNWIND connectedNodes as this_search_Genre0_connect0_node CREATE (this)-[:SEARCH]->(this_search_Genre0_connect0_node) @@ -586,13 +576,11 @@ describe("Cypher Union", () => { MATCH (this:Movie) WHERE this.title = $param0 WITH * - CALL { - WITH * + CALL(*) { OPTIONAL MATCH (this)-[this_search_Genre0_delete0_relationship:SEARCH]->(this_search_Genre0_delete0:Genre) WHERE this_search_Genre0_delete0.name = $updateMovies_args_update_search0_delete_Genre0_where_this_search_Genre0_delete0param0 WITH this_search_Genre0_delete0_relationship, collect(DISTINCT this_search_Genre0_delete0) AS this_search_Genre0_delete0_to_delete - CALL { - WITH this_search_Genre0_delete0_to_delete + CALL(this_search_Genre0_delete0_to_delete) { UNWIND this_search_Genre0_delete0_to_delete AS x DETACH DELETE x }