diff --git a/packages/graphql/src/classes/utils/verify-database.test.ts b/packages/graphql/src/classes/utils/verify-database.test.ts index 1eef78e1b3..082634b0e6 100644 --- a/packages/graphql/src/classes/utils/verify-database.test.ts +++ b/packages/graphql/src/classes/utils/verify-database.test.ts @@ -19,7 +19,7 @@ import type { Driver, Session } from "neo4j-driver"; import checkNeo4jCompat from "./verify-database"; -import { REQUIRED_APOC_FUNCTIONS, REQUIRED_APOC_PROCEDURES, MIN_NEO4J_VERSION } from "../../constants"; +import { REQUIRED_APOC_FUNCTIONS, MIN_NEO4J_VERSION } from "../../constants"; import { Neo4jDatabaseInfo } from "../Neo4jDatabaseInfo"; import type { Neo4jGraphQLSessionConfig } from "../Executor"; @@ -37,7 +37,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: minVersion, functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -82,7 +81,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: invalidVersion, functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -118,7 +116,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: invalidVersion, functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -152,7 +149,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: "4.0-aura", functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -185,7 +181,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: minVersion, functions: [], - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -211,44 +206,6 @@ describe("checkNeo4jCompat", () => { ); }); - test("should throw missing APOC procedures", async () => { - const minVersion = MIN_NEO4J_VERSION; - - // @ts-ignore - const fakeSession: Session = { - // @ts-ignore - run: () => ({ - records: [ - { - toObject: () => ({ - version: minVersion, - functions: REQUIRED_APOC_FUNCTIONS, - procedures: [], - }), - }, - ], - }), - // @ts-ignore - close: () => undefined, - }; - - // @ts-ignore - const fakeDriver: Driver = { - // @ts-ignore - session: () => fakeSession, - // @ts-ignore - verifyConnectivity: () => undefined, - }; - - await expect( - checkNeo4jCompat({ driver: fakeDriver, dbInfo: new Neo4jDatabaseInfo(minVersion) }) - ).rejects.toThrow( - `Encountered the following DBMS compatiblility issues:\nMissing APOC procedures: [ ${REQUIRED_APOC_PROCEDURES.join( - ", " - )} ]` - ); - }); - test("should throw no errors with valid DB", async () => { const minVersion = MIN_NEO4J_VERSION; @@ -261,7 +218,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: minVersion, functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -293,7 +249,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: "20.1.1", functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], @@ -325,7 +280,6 @@ describe("checkNeo4jCompat", () => { toObject: () => ({ version: "4.1.10", functions: REQUIRED_APOC_FUNCTIONS, - procedures: REQUIRED_APOC_PROCEDURES, }), }, ], diff --git a/packages/graphql/src/classes/utils/verify-database.ts b/packages/graphql/src/classes/utils/verify-database.ts index f36dc8dc2e..9042062f78 100644 --- a/packages/graphql/src/classes/utils/verify-database.ts +++ b/packages/graphql/src/classes/utils/verify-database.ts @@ -20,7 +20,6 @@ import type { Driver } from "neo4j-driver"; import type { Neo4jDatabaseInfo } from "../Neo4jDatabaseInfo"; import { verifyFunctions } from "./verify-functions"; -import { verifyProcedures } from "./verify-procedures"; import { verifyVersion } from "./verify-version"; import type { Neo4jGraphQLSessionConfig } from "../Executor"; @@ -45,16 +44,11 @@ async function checkNeo4jCompat({ errors.push((e as Error).message); } - const verificationResults = await Promise.allSettled([ - verifyFunctions(sessionFactory), - verifyProcedures(sessionFactory), - ]); - - verificationResults.forEach((v) => { - if (v.status === "rejected") { - errors.push((v.reason as Error).message); - } - }); + try { + await verifyFunctions(sessionFactory); + } catch (e) { + errors.push((e as Error).message); + } if (errors.length) { throw new Error(`Encountered the following DBMS compatiblility issues:\n${errors.join("\n")}`); diff --git a/packages/graphql/src/classes/utils/verify-procedures.ts b/packages/graphql/src/classes/utils/verify-procedures.ts deleted file mode 100644 index d5316bcdea..0000000000 --- a/packages/graphql/src/classes/utils/verify-procedures.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) "Neo4j" - * Neo4j Sweden AB [http://neo4j.com] - * - * This file is part of Neo4j. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import type { Session } from "neo4j-driver"; -import { REQUIRED_APOC_PROCEDURES } from "../../constants"; - -export async function verifyProcedures(sessionFactory: () => Session): Promise { - const session = sessionFactory(); - - const cypher = ` - SHOW PROCEDURES - YIELD name - WHERE name IN ["${REQUIRED_APOC_PROCEDURES.join('", "')}"] - RETURN collect(name) as procedures - `; - - try { - const result = await session.run<{ procedures: string[] }>(cypher); - const record = result.records[0]?.toObject(); - if (!record) throw new Error("verifyProcedures failed to get functions"); - - const missingProcedures = REQUIRED_APOC_PROCEDURES.filter((f) => !record.procedures.includes(f)); - if (missingProcedures.length) { - throw new Error(`Missing APOC procedures: [ ${missingProcedures.join(", ")} ]`); - } - } finally { - await session.close(); - } -} diff --git a/packages/graphql/src/constants.ts b/packages/graphql/src/constants.ts index a04c40e787..900f327ec2 100644 --- a/packages/graphql/src/constants.ts +++ b/packages/graphql/src/constants.ts @@ -23,7 +23,6 @@ export const AUTH_FORBIDDEN_ERROR = "@neo4j/graphql/FORBIDDEN"; export const AUTH_UNAUTHENTICATED_ERROR = "@neo4j/graphql/UNAUTHENTICATED"; export const MIN_NEO4J_VERSION = "4.4"; export const REQUIRED_APOC_FUNCTIONS = ["apoc.util.validatePredicate", "apoc.date.convertFormat"]; -export const REQUIRED_APOC_PROCEDURES = ["apoc.util.validate"]; export const AUTHORIZATION_UNAUTHENTICATED = "Unauthenticated"; export const DEBUG_ALL = `${DEBUG_PREFIX}:*`; export const DEBUG_AUTH = `${DEBUG_PREFIX}:auth`; diff --git a/packages/graphql/src/translate/create-relationship-validation-string.ts b/packages/graphql/src/translate/create-relationship-validation-string.ts index abfd20c59a..280a86da26 100644 --- a/packages/graphql/src/translate/create-relationship-validation-string.ts +++ b/packages/graphql/src/translate/create-relationship-validation-string.ts @@ -60,7 +60,7 @@ function createRelationshipValidationString({ context )})`, `\tWITH count(${relVarname}) as c, other`, - `\tCALL apoc.util.validate(NOT (${predicate}), '${errorMsg}', [0])`, + `\tWHERE apoc.util.validatePredicate(NOT (${predicate}), '${errorMsg}', [0])`, `\tRETURN collect(c) AS ${relVarname}_ignored`, `}`, ].join("\n"); @@ -78,7 +78,7 @@ function createRelationshipValidationString({ `\tWITH ${varName}`, `\tMATCH (${varName})${inStr}[${relVarname}:${field.type}]${outStr}(${toNode.getLabelString(context)})`, `\tWITH count(${relVarname}) as c`, - `\tCALL apoc.util.validate(NOT (${predicate}), '${errorMsg}', [0])`, + `\tWHERE apoc.util.validatePredicate(NOT (${predicate}), '${errorMsg}', [0])`, `\tRETURN c AS ${relVarname}_ignored`, `}`, ].join("\n"); diff --git a/packages/graphql/src/translate/create-update-and-params.ts b/packages/graphql/src/translate/create-update-and-params.ts index ee4ab3992b..24eac4dd87 100644 --- a/packages/graphql/src/translate/create-update-and-params.ts +++ b/packages/graphql/src/translate/create-update-and-params.ts @@ -24,7 +24,7 @@ import type { BaseField, Context } from "../types"; import createConnectAndParams from "./create-connect-and-params"; import createDisconnectAndParams from "./create-disconnect-and-params"; import createCreateAndParams from "./create-create-and-params"; -import { AUTH_FORBIDDEN_ERROR, META_CYPHER_VARIABLE, META_OLD_PROPS_CYPHER_VARIABLE } from "../constants"; +import { META_CYPHER_VARIABLE, META_OLD_PROPS_CYPHER_VARIABLE } from "../constants"; import createDeleteAndParams from "./create-delete-and-params"; import createSetRelationshipProperties from "./create-set-relationship-properties"; import createConnectionWhereAndParams from "./where/create-connection-where-and-params"; @@ -54,8 +54,6 @@ interface Res { interface UpdateMeta { preArrayMethodValidationStrs: [string, string][]; - preAuthStrs: string[]; - postAuthStrs: string[]; authorizationBeforeSubqueries: string[]; authorizationBeforePredicates: string[]; authorizationAfterSubqueries: string[]; @@ -664,8 +662,6 @@ export default function createUpdateAndParams({ strs: [], meta: { preArrayMethodValidationStrs: [], - preAuthStrs: [], - postAuthStrs: [], authorizationBeforeSubqueries: [], authorizationBeforePredicates: [], authorizationAfterSubqueries: [], @@ -676,9 +672,6 @@ export default function createUpdateAndParams({ const { strs, meta } = reducedUpdate; let params = reducedUpdate.params; - let preAuthStrs: string[] = []; - let postAuthStrs: string[] = []; - const authorizationBeforeStrs = meta.authorizationBeforePredicates; const authorizationBeforeSubqueries = meta.authorizationBeforeSubqueries; const authorizationAfterStrs = meta.authorizationAfterPredicates; @@ -705,52 +698,37 @@ export default function createUpdateAndParams({ } } - if (meta) { - preAuthStrs = [...preAuthStrs, ...meta.preAuthStrs]; - postAuthStrs = [...postAuthStrs, ...meta.postAuthStrs]; - } + const preUpdatePredicates = authorizationBeforeStrs; - let preArrayMethodValidationStr = ""; - let preAuthStr = ""; - let postAuthStr = ""; + const preArrayMethodValidationStr = ""; const relationshipValidationStr = includeRelationshipValidation ? createRelationshipValidationStr({ node, context, varName }) : ""; - const forbiddenString = `"${AUTH_FORBIDDEN_ERROR}"`; - if (meta.preArrayMethodValidationStrs.length) { const nullChecks = meta.preArrayMethodValidationStrs.map((validationStr) => `${validationStr[0]} IS NULL`); const propertyNames = meta.preArrayMethodValidationStrs.map((validationStr) => validationStr[1]); - preArrayMethodValidationStr = `CALL apoc.util.validate(${nullChecks.join(" OR ")}, "${pluralize( - "Property", - propertyNames.length - )} ${propertyNames.map(() => "%s").join(", ")} cannot be NULL", [${wrapStringInApostrophes(propertyNames).join( - ", " - )}])`; - } - - if (preAuthStrs.length) { - const apocStr = `CALL apoc.util.validate(NOT (${preAuthStrs.join(" AND ")}), ${forbiddenString}, [0])`; - preAuthStr = `${withStr}\n${apocStr}`; - } - - if (postAuthStrs.length) { - const apocStr = `CALL apoc.util.validate(NOT (${postAuthStrs.join(" AND ")}), ${forbiddenString}, [0])`; - postAuthStr = `${withStr}\n${apocStr}`; + preUpdatePredicates.push( + `apoc.util.validatePredicate(${nullChecks.join(" OR ")}, "${pluralize( + "Property", + propertyNames.length + )} ${propertyNames.map(() => "%s").join(", ")} cannot be NULL", [${wrapStringInApostrophes( + propertyNames + ).join(", ")}])` + ); } - let authorizationBeforeStr = ""; + let preUpdatePredicatesStr = ""; let authorizationAfterStr = ""; - if (authorizationBeforeStrs.length) { + if (preUpdatePredicates.length) { if (authorizationBeforeSubqueries.length) { - authorizationBeforeStr = `${withStr}\n${authorizationBeforeSubqueries.join( + preUpdatePredicatesStr = `${withStr}\n${authorizationBeforeSubqueries.join( "\n" - )}\nWITH *\nWHERE ${authorizationBeforeStrs.join(" AND ")}`; + )}\nWITH *\nWHERE ${preUpdatePredicates.join(" AND ")}`; } else { - authorizationBeforeStr = `${withStr}\nWHERE ${authorizationBeforeStrs.join(" AND ")}`; + preUpdatePredicatesStr = `${withStr}\nWHERE ${preUpdatePredicates.join(" AND ")}`; } } @@ -775,12 +753,10 @@ export default function createUpdateAndParams({ } return [ [ - authorizationBeforeStr, - preAuthStr, + preUpdatePredicatesStr, preArrayMethodValidationStr, ...statements, authorizationAfterStr, - postAuthStr, ...(relationshipValidationStr ? [withStr, relationshipValidationStr] : []), ].join("\n"), params, diff --git a/packages/graphql/src/translate/translate-update.ts b/packages/graphql/src/translate/translate-update.ts index ac4b5e2da6..24b79e19e0 100644 --- a/packages/graphql/src/translate/translate-update.ts +++ b/packages/graphql/src/translate/translate-update.ts @@ -208,10 +208,23 @@ export default async function translateUpdate({ if (!relationField.typeMeta.array) { const inStr = relationField.direction === "IN" ? "<-" : "-"; const outStr = relationField.direction === "OUT" ? "->" : "-"; + + const validatePredicates: string[] = []; refNodes.forEach((refNode) => { - const validateRelationshipExistence = `CALL apoc.util.validate(EXISTS((${varName})${inStr}[:${relationField.type}]${outStr}(:${refNode.name})),'Relationship field "%s.%s" cannot have more than one node linked',["${relationField.connectionPrefix}","${relationField.fieldName}"])`; - connectStrs.push(validateRelationshipExistence); + const validateRelationshipExistence = `EXISTS((${varName})${inStr}[:${relationField.type}]${outStr}(:${refNode.name}))`; + validatePredicates.push(validateRelationshipExistence); }); + + if (validatePredicates.length) { + connectStrs.push("WITH *"); + connectStrs.push( + `WHERE apoc.util.validatePredicate(${validatePredicates.join( + " OR " + )},'Relationship field "%s.%s" cannot have more than one node linked',["${ + relationField.connectionPrefix + }","${relationField.fieldName}"])` + ); + } } const connectAndParams = createConnectAndParams({ @@ -339,23 +352,27 @@ export default async function translateUpdate({ const relTypeStr = `[${relationVarName}:${relationField.type}]`; if (!relationField.typeMeta.array) { - // const validateRelationshipExistence = `CALL apoc.util.validate(EXISTS((${varName})${inStr}[:${relationField.type}]${outStr}(:${refNode.name})),'Relationship field "%s.%s" cannot have more than one node linked',["${relationField.connectionPrefix}","${relationField.fieldName}"])`; - // createStrs.push(validateRelationshipExistence); + createStrs.push("WITH *"); + + const validatePredicateTemplate = (condition: string) => + `WHERE apoc.util.validatePredicate(${condition},'Relationship field "%s.%s" cannot have more than one node linked',["${relationField.connectionPrefix}","${relationField.fieldName}"])`; + const singleCardinalityValidationTemplate = (nodeName) => - `CALL apoc.util.validate(EXISTS((${varName})${inStr}[:${relationField.type}]${outStr}(:${nodeName})),'Relationship field "%s.%s" cannot have more than one node linked',["${relationField.connectionPrefix}","${relationField.fieldName}"])`; + `EXISTS((${varName})${inStr}[:${relationField.type}]${outStr}(:${nodeName}))`; + if (relationField.union && relationField.union.nodes) { const validateRelationshipExistence = relationField.union.nodes.map( singleCardinalityValidationTemplate ); - createStrs.push(...validateRelationshipExistence); + createStrs.push(validatePredicateTemplate(validateRelationshipExistence.join(" OR "))); } else if (relationField.interface && relationField.interface.implementations) { const validateRelationshipExistence = relationField.interface.implementations.map( singleCardinalityValidationTemplate ); - createStrs.push(...validateRelationshipExistence); + createStrs.push(validatePredicateTemplate(validateRelationshipExistence.join(" OR "))); } else { const validateRelationshipExistence = singleCardinalityValidationTemplate(refNode.name); - createStrs.push(validateRelationshipExistence); + createStrs.push(validatePredicateTemplate(validateRelationshipExistence)); } } diff --git a/packages/graphql/src/translate/utils/math.ts b/packages/graphql/src/translate/utils/math.ts index e48faac304..619802740e 100644 --- a/packages/graphql/src/translate/utils/math.ts +++ b/packages/graphql/src/translate/utils/math.ts @@ -103,30 +103,42 @@ export function buildMathStatements( if (mathDescriptor.operationSymbol === "/" && mathDescriptor.value === 0) { throw new Error("Division by zero is not supported"); } - const statements: string[] = []; - const mathScope = Array.from(new Set([scope, ...withVars])); - statements.push(`WITH ${mathScope.join(", ")}`); - statements.push(`CALL {`); - statements.push(`WITH ${scope}`); + + const validatePredicates: string[] = []; + // Raise for operations with NAN - statements.push( - `CALL apoc.util.validate(${scope}.${mathDescriptor.dbName} IS NULL, 'Cannot %s %s to Nan', ["${mathDescriptor.operationName}", $${param}])` + validatePredicates.push( + `apoc.util.validatePredicate(${scope}.${mathDescriptor.dbName} IS NULL, 'Cannot %s %s to Nan', ["${mathDescriptor.operationName}", $${param}])` ); + const bitSize = mathDescriptor.graphQLType === "Int" ? 32 : 64; // Avoid overflows, for 64 bit overflows, a long overflow is raised anyway by Neo4j - statements.push( - `CALL apoc.util.validate(${scope}.${mathDescriptor.dbName} ${mathDescriptor.operationSymbol} $${param} > 2^${ + validatePredicates.push( + `apoc.util.validatePredicate(${scope}.${mathDescriptor.dbName} IS NOT NULL AND ${scope}.${ + mathDescriptor.dbName + } ${mathDescriptor.operationSymbol} $${param} > 2^${ bitSize - 1 }-1, 'Overflow: Value returned from operator %s is larger than %s bit', ["${ mathDescriptor.operationName }", "${bitSize}"])` ); + // Avoid type coercion where dividing an integer would result in a float value - if (mathDescriptor.graphQLType === "Int" || mathDescriptor.graphQLType === "BigInt") { - statements.push( - `CALL apoc.util.validate((${scope}.${mathDescriptor.dbName} ${mathDescriptor.operationSymbol} $${param}) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', ["${mathDescriptor.operationName}", "${mathDescriptor.graphQLType}"])` + if (mathDescriptor.operationSymbol === "/" && mathDescriptor.graphQLType.includes("Int")) { + validatePredicates.push( + `apoc.util.validatePredicate(${scope}.${mathDescriptor.dbName} IS NOT NULL AND (${scope}.${mathDescriptor.dbName} ${mathDescriptor.operationSymbol} $${param}) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', ["${mathDescriptor.operationName}", "${mathDescriptor.graphQLType}"])` ); } + + 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(`WITH ${scope}`); + // Validations + statements.push(`WHERE ${validatePredicates.join(" AND ")}`); statements.push( `SET ${scope}.${mathDescriptor.dbName} = ${scope}.${mathDescriptor.dbName} ${mathDescriptor.operationSymbol} $${param}` ); diff --git a/packages/graphql/tests/integration/neo4j.ts b/packages/graphql/tests/integration/neo4j.ts index 6314e68f26..f53715c6ce 100644 --- a/packages/graphql/tests/integration/neo4j.ts +++ b/packages/graphql/tests/integration/neo4j.ts @@ -102,9 +102,9 @@ class Neo4j { public getContextValues(options?: Record): Neo4jGraphQLContext { const database = this.hasIntegrationTestDb ? INT_TEST_DB_NAME : "neo4j"; return { - ...(options || {}), executionContext: this.driver, sessionConfig: { database }, + ...(options || {}), }; } } diff --git a/packages/graphql/tests/tck/array-methods.test.ts b/packages/graphql/tests/tck/array-methods.test.ts index 2c80f8e9e1..d419646b95 100644 --- a/packages/graphql/tests/tck/array-methods.test.ts +++ b/packages/graphql/tests/tck/array-methods.test.ts @@ -50,7 +50,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) + WITH this + WHERE apoc.util.validatePredicate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) SET this.ratings = this.ratings + $this_update_ratings_PUSH RETURN collect(DISTINCT this { .title, .ratings }) AS data" `); @@ -94,7 +95,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) + WITH this + WHERE apoc.util.validatePredicate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) SET this.ratings = this.ratings + $this_update_ratings_PUSH SET this.scores = this.scores + $this_update_scores_PUSH RETURN collect(DISTINCT this { .title, .ratings, .scores }) AS data" @@ -152,7 +154,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.filmingLocations IS NULL, \\"Property %s cannot be NULL\\", ['filmingLocations']) + WITH this + WHERE apoc.util.validatePredicate(this.filmingLocations IS NULL, \\"Property %s cannot be NULL\\", ['filmingLocations']) SET this.filmingLocations = this.filmingLocations + [p in $this_update_filmingLocations_PUSH | point(p)] RETURN collect(DISTINCT this { .title, filmingLocations: CASE WHEN this.filmingLocations IS NOT NULL THEN [update_var0 IN this.filmingLocations | { point: update_var0 }] @@ -210,8 +213,7 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) WITH this - WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL apoc.util.validate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) + WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) SET this.ratings = this.ratings + $this_update_ratings_PUSH WITH this WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) @@ -260,7 +262,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) + WITH this + WHERE apoc.util.validatePredicate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) SET this.ratings = this.ratings[0..-$this_update_ratings_POP] RETURN collect(DISTINCT this { .title, .ratings }) AS data" `); @@ -305,7 +308,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) + WITH this + WHERE apoc.util.validatePredicate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) SET this.ratings = this.ratings[0..-$this_update_ratings_POP] SET this.scores = this.scores[0..-$this_update_scores_POP] RETURN collect(DISTINCT this { .title, .ratings, .scores }) AS data" @@ -362,8 +366,7 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) WITH this - WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) - CALL apoc.util.validate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) + WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) AND apoc.util.validatePredicate(this.ratings IS NULL, \\"Property %s cannot be NULL\\", ['ratings']) SET this.ratings = this.ratings[0..-$this_update_ratings_POP] WITH this WHERE apoc.util.validatePredicate(NOT ($isAuthenticated = true AND $authorization_param1 IN $jwt.roles), \\"@neo4j/graphql/FORBIDDEN\\", [0]) @@ -415,7 +418,8 @@ describe("Arrays Methods", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Movie) - CALL apoc.util.validate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) + WITH this + WHERE apoc.util.validatePredicate(this.ratings IS NULL OR this.scores IS NULL, \\"Properties %s, %s cannot be NULL\\", ['ratings', 'scores']) SET this.ratings = this.ratings + $this_update_ratings_PUSH SET this.scores = this.scores[0..-$this_update_scores_POP] RETURN collect(DISTINCT this { .title, .ratings, .scores }) AS data" 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 57fb9eb823..fa54c9126d 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 @@ -451,7 +451,7 @@ describe("Cypher Auth Allow", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_POST]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" @@ -514,7 +514,7 @@ describe("Cypher Auth Allow", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_POST]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" @@ -773,14 +773,14 @@ describe("Cypher Auth Allow", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_COMMENT]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } CALL { WITH this MATCH (this)<-[this_post_Post_unique:HAS_COMMENT]-(:Post) WITH count(this_post_Post_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) RETURN c AS this_post_Post_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" 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 042eccb735..46e72a3f60 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 @@ -241,14 +241,14 @@ describe("@auth allow on specific interface implementation", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } CALL { WITH this_content0 MATCH (this_content0)<-[this_content0_post_Post_unique:HAS_COMMENT]-(:Post) WITH count(this_content0_post_Post_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) RETURN c AS this_content0_post_Post_unique_ignored } RETURN count(*) AS update_this_content0 @@ -270,7 +270,7 @@ describe("@auth allow on specific interface implementation", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } RETURN count(*) AS update_this_content0 diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/bind/bind.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/bind/bind.test.ts index 99099cae51..908a9ee565 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/bind/bind.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/bind/bind.test.ts @@ -194,7 +194,7 @@ describe("Cypher Auth Allow", () => { WITH create_this5 MATCH (create_this5)<-[create_this5_creator_User_unique:HAS_POST]-(:User) WITH count(create_this5_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS create_this5_creator_User_unique_ignored } RETURN collect(NULL) AS create_var14 @@ -331,7 +331,7 @@ describe("Cypher Auth Allow", () => { WITH this_posts0 MATCH (this_posts0)<-[this_posts0_creator_User_unique:HAS_POST]-(:User) WITH count(this_posts0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_posts0_creator_User_unique_ignored } RETURN count(*) AS update_this_posts0 @@ -433,7 +433,7 @@ describe("Cypher Auth Allow", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_POST]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" @@ -499,7 +499,7 @@ describe("Cypher Auth Allow", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_POST]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" diff --git a/packages/graphql/tests/tck/directives/authorization/arguments/bind/interface-relationships/implementation-bind.test.ts b/packages/graphql/tests/tck/directives/authorization/arguments/bind/interface-relationships/implementation-bind.test.ts index 2280695412..11cb8365bb 100644 --- a/packages/graphql/tests/tck/directives/authorization/arguments/bind/interface-relationships/implementation-bind.test.ts +++ b/packages/graphql/tests/tck/directives/authorization/arguments/bind/interface-relationships/implementation-bind.test.ts @@ -142,7 +142,7 @@ describe("Cypher Auth Allow", () => { WITH this0_contentPost0_node MATCH (this0_contentPost0_node)<-[this0_contentPost0_node_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this0_contentPost0_node_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this0_contentPost0_node_creator_User_unique_ignored } WITH this0 @@ -226,7 +226,7 @@ describe("Cypher Auth Allow", () => { WITH this0_contentComment0_node MATCH (this0_contentComment0_node)<-[this0_contentComment0_node_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this0_contentComment0_node_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) RETURN c AS this0_contentComment0_node_creator_User_unique_ignored } WITH this0 @@ -304,7 +304,7 @@ describe("Cypher Auth Allow", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } RETURN count(*) AS update_this_content0 @@ -337,7 +337,7 @@ describe("Cypher Auth Allow", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } RETURN count(*) AS update_this_content0 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 ab13f78b41..aa50eb06fd 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 @@ -674,7 +674,7 @@ describe("Cypher Auth Where with Roles", () => { WITH this_posts0 MATCH (this_posts0)<-[this_posts0_creator_User_unique:HAS_POST]-(:User) WITH count(this_posts0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator must be less than or equal to one', [0]) RETURN c AS this_posts0_creator_User_unique_ignored } RETURN count(*) AS update_this_posts0 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 aca9b4cad5..b96f7eaa3b 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 @@ -530,7 +530,7 @@ describe("Cypher Auth Roles", () => { WITH this_post0 MATCH (this_post0)-[this_post0_creator_User_unique:HAS_POST]->(:User) WITH count(this_post0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_post0_creator_User_unique_ignored } RETURN count(*) AS update_this_post0 @@ -540,7 +540,7 @@ describe("Cypher Auth Roles", () => { WITH this MATCH (this)<-[this_post_Post_unique:HAS_COMMENT]-(:Post) WITH count(this_post_Post_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) RETURN c AS this_post_Post_unique_ignored } RETURN collect(DISTINCT this { .content }) AS data" @@ -674,7 +674,7 @@ describe("Cypher Auth Roles", () => { WITH this_post0 MATCH (this_post0)-[this_post0_creator_User_unique:HAS_POST]->(:User) WITH count(this_post0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_post0_creator_User_unique_ignored } RETURN count(*) AS update_this_post0 @@ -684,7 +684,7 @@ describe("Cypher Auth Roles", () => { WITH this MATCH (this)<-[this_post_Post_unique:HAS_COMMENT]-(:Post) WITH count(this_post_Post_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.post required exactly once', [0]) RETURN c AS this_post_Post_unique_ignored } RETURN collect(DISTINCT this { .content }) AS data" 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 9724c3dcd1..70e4916fb6 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 @@ -376,7 +376,7 @@ describe("Cypher Auth Where", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" @@ -424,7 +424,7 @@ describe("Cypher Auth Where", () => { WITH this MATCH (this)<-[this_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_creator_User_unique_ignored } RETURN collect(DISTINCT this { .id }) AS data" @@ -478,7 +478,7 @@ describe("Cypher Auth Where", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDComment.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } RETURN count(*) AS update_this_content0 @@ -500,7 +500,7 @@ describe("Cypher Auth Where", () => { WITH this_content0 MATCH (this_content0)<-[this_content0_creator_User_unique:HAS_CONTENT]-(:User) WITH count(this_content0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_content0_creator_User_unique_ignored } RETURN count(*) AS update_this_content0 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 503ae92b1b..01fb269670 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 @@ -643,7 +643,7 @@ describe("Cypher Auth Where", () => { WITH this_posts0 MATCH (this_posts0)<-[this_posts0_creator_User_unique:HAS_POST]-(:User) WITH count(this_posts0_creator_User_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPost.creator required exactly once', [0]) RETURN c AS this_posts0_creator_User_unique_ignored } RETURN count(*) AS update_this_posts0 diff --git a/packages/graphql/tests/tck/issues/1430.test.ts b/packages/graphql/tests/tck/issues/1430.test.ts index 3f64e1e304..d5019282f0 100644 --- a/packages/graphql/tests/tck/issues/1430.test.ts +++ b/packages/graphql/tests/tck/issues/1430.test.ts @@ -81,8 +81,8 @@ describe("https://github.com/neo4j/graphql/issues/1430", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:ABCE) WHERE this.id = $param0 - CALL apoc.util.validate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildOne)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) - CALL apoc.util.validate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildTwo)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) + WITH * + WHERE apoc.util.validatePredicate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildOne)) OR EXISTS((this)-[:HAS_INTERFACE]->(:ChildTwo)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) CREATE (this_create_interface_ChildOne0_node_ChildOne:ChildOne) SET this_create_interface_ChildOne0_node_ChildOne.id = randomUUID() SET this_create_interface_ChildOne0_node_ChildOne.name = $this_create_interface_ChildOne0_node_ChildOne_name @@ -140,8 +140,8 @@ describe("https://github.com/neo4j/graphql/issues/1430", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:ABCE) WHERE this.id = $param0 - CALL apoc.util.validate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildOne)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) - CALL apoc.util.validate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildTwo)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) + WITH * + WHERE apoc.util.validatePredicate(EXISTS((this)-[:HAS_INTERFACE]->(:ChildOne)) OR EXISTS((this)-[:HAS_INTERFACE]->(:ChildTwo)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"ABCE\\",\\"interface\\"]) WITH this CALL { WITH this diff --git a/packages/graphql/tests/tck/issues/3027.test.ts b/packages/graphql/tests/tck/issues/3027.test.ts index 4890cf3f59..e2dd085861 100644 --- a/packages/graphql/tests/tck/issues/3027.test.ts +++ b/packages/graphql/tests/tck/issues/3027.test.ts @@ -85,8 +85,8 @@ describe("https://github.com/neo4j/graphql/issues/3027", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Book) WHERE this.isbn = $param0 - CALL apoc.util.validate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_SV)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) - CALL apoc.util.validate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_EN)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) + WITH * + WHERE apoc.util.validatePredicate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_SV)) OR EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_EN)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) CREATE (this_create_translatedTitle_BookTitle_EN0_node:BookTitle_EN) SET this_create_translatedTitle_BookTitle_EN0_node.value = $this_create_translatedTitle_BookTitle_EN0_node_value MERGE (this)<-[:TRANSLATED_BOOK_TITLE]-(this_create_translatedTitle_BookTitle_EN0_node) @@ -176,8 +176,8 @@ describe("https://github.com/neo4j/graphql/issues/3027", () => { expect(formatCypher(result.cypher)).toMatchInlineSnapshot(` "MATCH (this:Book) WHERE this.isbn = $param0 - CALL apoc.util.validate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_SV)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) - CALL apoc.util.validate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_EN)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) + WITH * + WHERE apoc.util.validatePredicate(EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_SV)) OR EXISTS((this)<-[:TRANSLATED_BOOK_TITLE]-(:BookTitle_EN)),'Relationship field \\"%s.%s\\" cannot have more than one node linked',[\\"Book\\",\\"translatedTitle\\"]) CREATE (this_create_translatedTitle_BookTitle_EN0_node_BookTitle_EN:BookTitle_EN) SET this_create_translatedTitle_BookTitle_EN0_node_BookTitle_EN.value = $this_create_translatedTitle_BookTitle_EN0_node_BookTitle_EN_value MERGE (this)<-[:TRANSLATED_BOOK_TITLE]-(this_create_translatedTitle_BookTitle_EN0_node_BookTitle_EN) diff --git a/packages/graphql/tests/tck/issues/324.test.ts b/packages/graphql/tests/tck/issues/324.test.ts index b1793f191e..2d8670cb5a 100644 --- a/packages/graphql/tests/tck/issues/324.test.ts +++ b/packages/graphql/tests/tck/issues/324.test.ts @@ -123,7 +123,7 @@ describe("#324", () => { WITH this_car0_manufacturer0 MATCH (this_car0_manufacturer0)-[this_car0_manufacturer0_logo_Logo_unique:LOGO]->(:Logo) WITH count(this_car0_manufacturer0_logo_Logo_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDManufacturer.logo required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDManufacturer.logo required exactly once', [0]) RETURN c AS this_car0_manufacturer0_logo_Logo_unique_ignored } RETURN count(*) AS update_this_car0_manufacturer0 @@ -133,7 +133,7 @@ describe("#324", () => { WITH this_car0 MATCH (this_car0)-[this_car0_manufacturer_Manufacturer_unique:MANUFACTURER]->(:Manufacturer) WITH count(this_car0_manufacturer_Manufacturer_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDCar.manufacturer required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDCar.manufacturer required exactly once', [0]) RETURN c AS this_car0_manufacturer_Manufacturer_unique_ignored } RETURN count(*) AS update_this_car0 @@ -143,7 +143,7 @@ describe("#324", () => { WITH this MATCH (this)-[this_car_Car_unique:CAR]->(:Car) WITH count(this_car_Car_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPerson.car required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPerson.car required exactly once', [0]) RETURN c AS this_car_Car_unique_ignored } RETURN collect(DISTINCT this { .identifier }) AS data" diff --git a/packages/graphql/tests/tck/issues/3251.test.ts b/packages/graphql/tests/tck/issues/3251.test.ts index 71069c1ab1..1ff06253e3 100644 --- a/packages/graphql/tests/tck/issues/3251.test.ts +++ b/packages/graphql/tests/tck/issues/3251.test.ts @@ -97,7 +97,7 @@ describe("https://github.com/neo4j/graphql/issues/3251", () => { WITH this MATCH (this)-[this_genre_Genre_unique:HAS_GENRE]->(:Genre) WITH count(this_genre_Genre_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.genre required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.genre required exactly once', [0]) RETURN c AS this_genre_Genre_unique_ignored } RETURN collect(DISTINCT this { .name, genre: update_var2 }) AS data" diff --git a/packages/graphql/tests/tck/issues/894.test.ts b/packages/graphql/tests/tck/issues/894.test.ts index df58e8beb8..3f1d1b64b8 100644 --- a/packages/graphql/tests/tck/issues/894.test.ts +++ b/packages/graphql/tests/tck/issues/894.test.ts @@ -102,7 +102,7 @@ describe("https://github.com/neo4j/graphql/issues/894", () => { WITH this MATCH (this)-[this_activeOrganization_Organization_unique:ACTIVELY_MANAGING]->(:Organization) WITH count(this_activeOrganization_Organization_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDUser.activeOrganization must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDUser.activeOrganization must be less than or equal to one', [0]) RETURN c AS this_activeOrganization_Organization_unique_ignored } RETURN collect(DISTINCT this { id: this._id }) AS data" diff --git a/packages/graphql/tests/tck/math.test.ts b/packages/graphql/tests/tck/math.test.ts index 142c8fd82a..6f7e1fbb59 100644 --- a/packages/graphql/tests/tck/math.test.ts +++ b/packages/graphql/tests/tck/math.test.ts @@ -80,9 +80,8 @@ describe("Math operators", () => { WITH this CALL { WITH this - CALL apoc.util.validate(this.viewers IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_viewers_INCREMENT]) - CALL apoc.util.validate(this.viewers + $this_update_viewers_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) - CALL apoc.util.validate((this.viewers + $this_update_viewers_INCREMENT) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', [\\"_INCREMENT\\", \\"Int\\"]) + 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 RETURN this as this_viewers__INCREMENT } @@ -118,8 +117,8 @@ describe("Math operators", () => { WITH this CALL { WITH this - CALL apoc.util.validate(this.revenue IS NULL, 'Cannot %s %s to Nan', [\\"_MULTIPLY\\", $this_update_revenue_MULTIPLY]) - CALL apoc.util.validate(this.revenue * $this_update_revenue_MULTIPLY > 2^63-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_MULTIPLY\\", \\"64\\"]) + 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 RETURN this as this_revenue__MULTIPLY } @@ -158,9 +157,8 @@ describe("Math operators", () => { WITH this_actedIn0, this CALL { WITH this_actedIn0 - CALL apoc.util.validate(this_actedIn0.viewers IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_actedIn0_viewers_INCREMENT]) - CALL apoc.util.validate(this_actedIn0.viewers + $this_update_actedIn0_viewers_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) - CALL apoc.util.validate((this_actedIn0.viewers + $this_update_actedIn0_viewers_INCREMENT) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', [\\"_INCREMENT\\", \\"Int\\"]) + 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 RETURN this_actedIn0 as this_actedIn0_viewers__INCREMENT } @@ -216,8 +214,8 @@ describe("Math operators", () => { WITH this_acted_in0_relationship, this CALL { WITH this_acted_in0_relationship - CALL apoc.util.validate(this_acted_in0_relationship.pay IS NULL, 'Cannot %s %s to Nan', [\\"_ADD\\", $updateActors.args.update.actedIn[0].update.edge.pay_ADD]) - CALL apoc.util.validate(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\\"]) + 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 RETURN this_acted_in0_relationship as this_acted_in0_relationship_pay__ADD } @@ -290,9 +288,8 @@ describe("Math operators", () => { WITH this_marriedWith0, this CALL { WITH this_marriedWith0 - CALL apoc.util.validate(this_marriedWith0.marriageLength IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_marriedWith0_marriageLength_INCREMENT]) - CALL apoc.util.validate(this_marriedWith0.marriageLength + $this_update_marriedWith0_marriageLength_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) - CALL apoc.util.validate((this_marriedWith0.marriageLength + $this_update_marriedWith0_marriageLength_INCREMENT) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', [\\"_INCREMENT\\", \\"Int\\"]) + 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 RETURN this_marriedWith0 as this_marriedWith0_marriageLength__INCREMENT } @@ -301,7 +298,7 @@ describe("Math operators", () => { WITH this_marriedWith0 MATCH (this_marriedWith0)<-[this_marriedWith0_marriedWith_Actor_unique:MARRIED_WITH]-(:Actor) WITH count(this_marriedWith0_marriedWith_Actor_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDStar.marriedWith must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDStar.marriedWith must be less than or equal to one', [0]) RETURN c AS this_marriedWith0_marriedWith_Actor_unique_ignored } RETURN count(*) AS update_this_marriedWith0 @@ -365,15 +362,14 @@ describe("Math operators", () => { WITH this_marriedWith0 MATCH (this_marriedWith0)<-[this_marriedWith0_marriedWith_Actor_unique:MARRIED_WITH]-(:Actor) WITH count(this_marriedWith0_marriedWith_Actor_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDStar.marriedWith must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDStar.marriedWith must be less than or equal to one', [0]) RETURN c AS this_marriedWith0_marriedWith_Actor_unique_ignored } WITH this_marriedWith0, this CALL { WITH this_marriedWith0 - CALL apoc.util.validate(this_marriedWith0.marriageLength IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_marriedWith0_on_Star_marriageLength_INCREMENT]) - CALL apoc.util.validate(this_marriedWith0.marriageLength + $this_update_marriedWith0_on_Star_marriageLength_INCREMENT > 2^31-1, 'Overflow: Value returned from operator %s is larger than %s bit', [\\"_INCREMENT\\", \\"32\\"]) - CALL apoc.util.validate((this_marriedWith0.marriageLength + $this_update_marriedWith0_on_Star_marriageLength_INCREMENT) % 1 <> 0, 'Type Mismatch: Value returned from operator %s does not match: %s', [\\"_INCREMENT\\", \\"Int\\"]) + WITH this_marriedWith0 + WHERE apoc.util.validatePredicate(this_marriedWith0.marriageLength IS NULL, 'Cannot %s %s to Nan', [\\"_INCREMENT\\", $this_update_marriedWith0_on_Star_marriageLength_INCREMENT]) AND apoc.util.validatePredicate(this_marriedWith0.marriageLength IS NOT NULL AND this_marriedWith0.marriageLength + $this_update_marriedWith0_on_Star_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_on_Star_marriageLength_INCREMENT RETURN this_marriedWith0 as this_marriedWith0_marriageLength__INCREMENT } 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 49d2088321..801eb730a3 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 @@ -94,7 +94,7 @@ describe("Batch Create, Auth", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -169,7 +169,7 @@ describe("Batch Create, Auth", () => { WITH create_this8 MATCH (create_this8)-[create_this8_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this8_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS create_this8_website_Website_unique_ignored } RETURN collect(NULL) AS create_var10 @@ -181,7 +181,7 @@ describe("Batch Create, Auth", () => { WITH create_this0 MATCH (create_this0)-[create_this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this0_website_Website_unique_ignored } RETURN create_this0 @@ -299,7 +299,7 @@ describe("Batch Create, Auth", () => { WITH this0_actors0_node MATCH (this0_actors0_node)-[this0_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this0_actors0_node_website_Website_unique_ignored } WITH this0 @@ -309,7 +309,7 @@ describe("Batch Create, Auth", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -328,7 +328,7 @@ describe("Batch Create, Auth", () => { WITH this1_actors0_node MATCH (this1_actors0_node)-[this1_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this1_actors0_node_website_Website_unique_ignored } WITH this1 @@ -338,7 +338,7 @@ describe("Batch Create, Auth", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -357,7 +357,7 @@ describe("Batch Create, Auth", () => { WITH this2 MATCH (this2)-[this2_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this2_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this2_website_Website_unique_ignored } RETURN this2 @@ -390,7 +390,7 @@ describe("Batch Create, Auth", () => { WITH this3 MATCH (this3)-[this3_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this3_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this3_website_Website_unique_ignored } RETURN this3 @@ -414,7 +414,7 @@ describe("Batch Create, Auth", () => { WITH this4 MATCH (this4)-[this4_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this4_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this4_website_Website_unique_ignored } RETURN this4 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 191757e0ce..6d343a2800 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 @@ -93,7 +93,7 @@ describe("Batch Create, Scalar types", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -200,7 +200,7 @@ describe("Batch Create, Scalar types", () => { WITH create_this5 MATCH (create_this5)-[create_this5_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this5_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS create_this5_website_Website_unique_ignored } RETURN collect(NULL) AS create_var13 @@ -221,7 +221,7 @@ describe("Batch Create, Scalar types", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -320,7 +320,7 @@ describe("Batch Create, Scalar types", () => { WITH create_this8 MATCH (create_this8)-[create_this8_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this8_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS create_this8_website_Website_unique_ignored } RETURN collect(NULL) AS create_var10 @@ -330,7 +330,7 @@ describe("Batch Create, Scalar types", () => { WITH create_this0 MATCH (create_this0)-[create_this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this0_website_Website_unique_ignored } RETURN create_this0 @@ -441,7 +441,7 @@ describe("Batch Create, Scalar types", () => { WITH this0_actors0_node MATCH (this0_actors0_node)-[this0_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this0_actors0_node_website_Website_unique_ignored } WITH this0 @@ -449,7 +449,7 @@ describe("Batch Create, Scalar types", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -470,7 +470,7 @@ describe("Batch Create, Scalar types", () => { WITH this1_actors0_node MATCH (this1_actors0_node)-[this1_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this1_actors0_node_website_Website_unique_ignored } WITH this1 @@ -478,7 +478,7 @@ describe("Batch Create, Scalar types", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -496,7 +496,7 @@ describe("Batch Create, Scalar types", () => { WITH this2 MATCH (this2)-[this2_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this2_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this2_website_Website_unique_ignored } RETURN this2 @@ -528,7 +528,7 @@ describe("Batch Create, Scalar types", () => { WITH this3 MATCH (this3)-[this3_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this3_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this3_website_Website_unique_ignored } RETURN this3 @@ -552,7 +552,7 @@ describe("Batch Create, Scalar types", () => { WITH this4 MATCH (this4)-[this4_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this4_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this4_website_Website_unique_ignored } RETURN this4 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 cbd441122d..4b51976ef4 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 @@ -92,7 +92,7 @@ describe("Batch Create, Interface", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -161,7 +161,7 @@ describe("Batch Create, Interface", () => { WITH this0_workersActor0_node MATCH (this0_workersActor0_node)-[this0_workersActor0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_workersActor0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this0_workersActor0_node_website_Website_unique_ignored } WITH this0 @@ -169,7 +169,7 @@ describe("Batch Create, Interface", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -188,7 +188,7 @@ describe("Batch Create, Interface", () => { WITH this1_workersModeler0_node MATCH (this1_workersModeler0_node)-[this1_workersModeler0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_workersModeler0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDModeler.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDModeler.website must be less than or equal to one', [0]) RETURN c AS this1_workersModeler0_node_website_Website_unique_ignored } WITH this1 @@ -196,7 +196,7 @@ describe("Batch Create, Interface", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -308,7 +308,7 @@ describe("Batch Create, Interface", () => { WITH this0_workersActor0_node MATCH (this0_workersActor0_node)-[this0_workersActor0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_workersActor0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this0_workersActor0_node_website_Website_unique_ignored } WITH this0 @@ -316,7 +316,7 @@ describe("Batch Create, Interface", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -335,7 +335,7 @@ describe("Batch Create, Interface", () => { WITH this1_workersActor0_node MATCH (this1_workersActor0_node)-[this1_workersActor0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_workersActor0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this1_workersActor0_node_website_Website_unique_ignored } WITH this1 @@ -343,7 +343,7 @@ describe("Batch Create, Interface", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -360,7 +360,7 @@ describe("Batch Create, Interface", () => { WITH this2 MATCH (this2)-[this2_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this2_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this2_website_Website_unique_ignored } RETURN this2 @@ -408,7 +408,7 @@ describe("Batch Create, Interface", () => { WITH this3 MATCH (this3)-[this3_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this3_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this3_website_Website_unique_ignored } RETURN this3 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 d5afd166b7..7a0bed377b 100644 --- a/packages/graphql/tests/tck/operations/batch/batch-create.test.ts +++ b/packages/graphql/tests/tck/operations/batch/batch-create.test.ts @@ -80,7 +80,7 @@ describe("Batch Create", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -169,7 +169,7 @@ describe("Batch Create", () => { WITH create_this5 MATCH (create_this5)-[create_this5_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this5_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS create_this5_website_Website_unique_ignored } RETURN collect(NULL) AS create_var13 @@ -190,7 +190,7 @@ describe("Batch Create", () => { WITH create_this1 MATCH (create_this1)-[create_this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this1_website_Website_unique_ignored } RETURN create_this1 @@ -287,7 +287,7 @@ describe("Batch Create", () => { WITH create_this8 MATCH (create_this8)-[create_this8_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this8_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS create_this8_website_Website_unique_ignored } RETURN collect(NULL) AS create_var10 @@ -297,7 +297,7 @@ describe("Batch Create", () => { WITH create_this0 MATCH (create_this0)-[create_this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(create_this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS create_this0_website_Website_unique_ignored } RETURN create_this0 @@ -404,7 +404,7 @@ describe("Batch Create", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -435,7 +435,7 @@ describe("Batch Create", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -516,7 +516,7 @@ describe("Batch Create", () => { WITH this0_actors0_node MATCH (this0_actors0_node)-[this0_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this0_actors0_node_website_Website_unique_ignored } WITH this0 @@ -524,7 +524,7 @@ describe("Batch Create", () => { WITH this0 MATCH (this0)-[this0_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this0_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this0_website_Website_unique_ignored } RETURN this0 @@ -543,7 +543,7 @@ describe("Batch Create", () => { WITH this1_actors0_node MATCH (this1_actors0_node)-[this1_actors0_node_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_actors0_node_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDActor.website must be less than or equal to one', [0]) RETURN c AS this1_actors0_node_website_Website_unique_ignored } WITH this1 @@ -551,7 +551,7 @@ describe("Batch Create", () => { WITH this1 MATCH (this1)-[this1_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this1_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this1_website_Website_unique_ignored } RETURN this1 @@ -568,7 +568,7 @@ describe("Batch Create", () => { WITH this2 MATCH (this2)-[this2_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this2_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this2_website_Website_unique_ignored } RETURN this2 @@ -599,7 +599,7 @@ describe("Batch Create", () => { WITH this3 MATCH (this3)-[this3_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this3_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this3_website_Website_unique_ignored } RETURN this3 @@ -621,7 +621,7 @@ describe("Batch Create", () => { WITH this4 MATCH (this4)-[this4_website_Website_unique:HAS_WEBSITE]->(:Website) WITH count(this4_website_Website_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.website must be less than or equal to one', [0]) RETURN c AS this4_website_Website_unique_ignored } RETURN this4 diff --git a/packages/graphql/tests/tck/operations/connect.test.ts b/packages/graphql/tests/tck/operations/connect.test.ts index 027c2697c9..0c84b0f741 100644 --- a/packages/graphql/tests/tck/operations/connect.test.ts +++ b/packages/graphql/tests/tck/operations/connect.test.ts @@ -147,7 +147,7 @@ describe("Cypher Connect", () => { WITH this0_colors_connect0_node_photos0_node MATCH (this0_colors_connect0_node_photos0_node)-[this0_colors_connect0_node_photos0_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_colors_connect0_node_photos0_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_colors_connect0_node_photos0_node_color_Color_unique_ignored } WITH this0, this0_colors_connect0_node, this0_colors_connect0_node_photos0_node @@ -170,7 +170,7 @@ describe("Cypher Connect", () => { WITH this0_colors_connect0_node_photos0_node MATCH (this0_colors_connect0_node_photos0_node)-[this0_colors_connect0_node_photos0_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_colors_connect0_node_photos0_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_colors_connect0_node_photos0_node_color_Color_unique_ignored } WITH this0, this0_colors_connect0_node, this0_colors_connect0_node_photos0_node, this0_colors_connect0_node_photos0_node_color0_node @@ -215,7 +215,7 @@ describe("Cypher Connect", () => { WITH this0_photos_connect0_node MATCH (this0_photos_connect0_node)-[this0_photos_connect0_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_photos_connect0_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_photos_connect0_node_color_Color_unique_ignored } WITH this0, this0_photos_connect0_node, this0_photos_connect0_node_color0_node @@ -258,7 +258,7 @@ describe("Cypher Connect", () => { WITH this0_photos_connect1_node MATCH (this0_photos_connect1_node)-[this0_photos_connect1_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_photos_connect1_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_photos_connect1_node_color_Color_unique_ignored } WITH this0, this0_photos_connect1_node, this0_photos_connect1_node_color0_node diff --git a/packages/graphql/tests/tck/pringles.test.ts b/packages/graphql/tests/tck/pringles.test.ts index 9cd215624b..9af6b2458b 100644 --- a/packages/graphql/tests/tck/pringles.test.ts +++ b/packages/graphql/tests/tck/pringles.test.ts @@ -143,7 +143,7 @@ describe("Cypher Create Pringles", () => { WITH this0_photos0_node MATCH (this0_photos0_node)-[this0_photos0_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_photos0_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_photos0_node_color_Color_unique_ignored } WITH this0 @@ -175,7 +175,7 @@ describe("Cypher Create Pringles", () => { WITH this0_photos1_node MATCH (this0_photos1_node)-[this0_photos1_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_photos1_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_photos1_node_color_Color_unique_ignored } WITH this0 @@ -207,7 +207,7 @@ describe("Cypher Create Pringles", () => { WITH this0_photos2_node MATCH (this0_photos2_node)-[this0_photos2_node_color_Color_unique:OF_COLOR]->(:Color) WITH count(this0_photos2_node_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this0_photos2_node_color_Color_unique_ignored } RETURN this0 @@ -319,7 +319,7 @@ describe("Cypher Create Pringles", () => { WITH this_photos0 MATCH (this_photos0)-[this_photos0_color_Color_unique:OF_COLOR]->(:Color) WITH count(this_photos0_color_Color_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDPhoto.color required exactly once', [0]) RETURN c AS this_photos0_color_Color_unique_ignored } RETURN count(*) AS update_this_photos0 diff --git a/packages/graphql/tests/tck/rfcs/rfc-003.test.ts b/packages/graphql/tests/tck/rfcs/rfc-003.test.ts index 0d3e84d248..38f1c2b6f4 100644 --- a/packages/graphql/tests/tck/rfcs/rfc-003.test.ts +++ b/packages/graphql/tests/tck/rfcs/rfc-003.test.ts @@ -64,7 +64,7 @@ describe("tck/rfs/003", () => { WITH create_this1 MATCH (create_this1)<-[create_this1_director_Director_unique:DIRECTED]-(:Director) WITH count(create_this1_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS create_this1_director_Director_unique_ignored } RETURN create_this1 @@ -124,7 +124,7 @@ describe("tck/rfs/003", () => { WITH create_this1 MATCH (create_this1)<-[create_this1_director_Director_unique:DIRECTED]-(:Director) WITH count(create_this1_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS create_this1_director_Director_unique_ignored } RETURN create_this1 @@ -200,7 +200,7 @@ describe("tck/rfs/003", () => { WITH create_this5 MATCH (create_this5)-[create_this5_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(create_this5_address_Address_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) RETURN c AS create_this5_address_Address_unique_ignored } RETURN collect(NULL) AS create_var7 @@ -210,7 +210,7 @@ describe("tck/rfs/003", () => { WITH create_this1 MATCH (create_this1)<-[create_this1_director_Director_unique:DIRECTED]-(:Director) WITH count(create_this1_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS create_this1_director_Director_unique_ignored } RETURN create_this1 @@ -292,7 +292,7 @@ describe("tck/rfs/003", () => { WITH create_this5 MATCH (create_this5)-[create_this5_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(create_this5_address_Address_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address must be less than or equal to one', [0]) RETURN c AS create_this5_address_Address_unique_ignored } RETURN collect(NULL) AS create_var7 @@ -302,7 +302,7 @@ describe("tck/rfs/003", () => { WITH create_this1 MATCH (create_this1)<-[create_this1_director_Director_unique:DIRECTED]-(:Director) WITH count(create_this1_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS create_this1_director_Director_unique_ignored } RETURN create_this1 @@ -368,7 +368,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -420,7 +420,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -486,7 +486,7 @@ describe("tck/rfs/003", () => { WITH this_director0 MATCH (this_director0)-[this_director0_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(this_director0_address_Address_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) RETURN c AS this_director0_address_Address_unique_ignored } RETURN count(*) AS update_this_director0 @@ -496,7 +496,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -561,7 +561,7 @@ describe("tck/rfs/003", () => { WITH this_director0 MATCH (this_director0)-[this_director0_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(this_director0_address_Address_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address must be less than or equal to one', [0]) RETURN c AS this_director0_address_Address_unique_ignored } RETURN count(*) AS update_this_director0 @@ -571,7 +571,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -635,7 +635,7 @@ describe("tck/rfs/003", () => { WITH this_director0_create0_node MATCH (this_director0_create0_node)-[this_director0_create0_node_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(this_director0_create0_node_address_Address_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) RETURN c AS this_director0_create0_node_address_Address_unique_ignored } WITH * @@ -643,7 +643,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -742,14 +742,14 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } CALL { WITH this MATCH (this)<-[this_coDirector_CoDirector_unique:CO_DIRECTED]-(:CoDirector) WITH count(this_coDirector_CoDirector_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.coDirector must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.coDirector must be less than or equal to one', [0]) RETURN c AS this_coDirector_CoDirector_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -867,14 +867,14 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS this_director_Director_unique_ignored } CALL { WITH this MATCH (this)<-[this_coDirector_CoDirector_unique:CO_DIRECTED]-(:CoDirector) WITH count(this_coDirector_CoDirector_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.coDirector must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.coDirector must be less than or equal to one', [0]) RETURN c AS this_coDirector_CoDirector_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -971,7 +971,7 @@ describe("tck/rfs/003", () => { WITH this0 MATCH (this0)<-[this0_director_Director_unique:DIRECTED]-(:Director) WITH count(this0_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this0_director_Director_unique_ignored } RETURN this0 @@ -1044,7 +1044,7 @@ describe("tck/rfs/003", () => { WITH this0 MATCH (this0)<-[this0_director_Director_unique:DIRECTED]-(:Director) WITH count(this0_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS this0_director_Director_unique_ignored } RETURN this0 @@ -1147,7 +1147,7 @@ describe("tck/rfs/003", () => { WITH this0_director_connect0_node MATCH (this0_director_connect0_node)-[this0_director_connect0_node_address_Address_unique:HAS_ADDRESS]->(:Address) WITH count(this0_director_connect0_node_address_Address_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDDirector.address required exactly once', [0]) RETURN c AS this0_director_connect0_node_address_Address_unique_ignored } WITH this0, this0_director_connect0_node, this0_director_connect0_node_address0_node @@ -1160,7 +1160,7 @@ describe("tck/rfs/003", () => { WITH this0 MATCH (this0)<-[this0_director_Director_unique:DIRECTED]-(:Director) WITH count(this0_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this0_director_Director_unique_ignored } RETURN this0 @@ -1232,7 +1232,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN 'Query cannot conclude with CALL'" @@ -1349,7 +1349,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) + WHERE apoc.util.validatePredicate(NOT (c = 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director required exactly once', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN collect(DISTINCT this { .id, director: update_var2 }) AS data" @@ -1465,7 +1465,7 @@ describe("tck/rfs/003", () => { WITH this MATCH (this)<-[this_director_Director_unique:DIRECTED]-(:Director) WITH count(this_director_Director_unique) as c - CALL apoc.util.validate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) + WHERE apoc.util.validatePredicate(NOT (c <= 1), '@neo4j/graphql/RELATIONSHIP-REQUIREDMovie.director must be less than or equal to one', [0]) RETURN c AS this_director_Director_unique_ignored } RETURN collect(DISTINCT this { .id, director: update_var2 }) AS data"