diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..2312dc587 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/package-lock.json b/package-lock.json index 6d8f9d6a1..a7797d1b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,11 +49,11 @@ "deep-equal-in-any-order": "^1.1.20", "express": "^4.19.2", "graphql": "^16.6.0", - "husky": "^8.0.1", + "husky": "^9.1.7", "knip": "^5.27.0", "lint-staged": "^15.2.10", "log4js": "^6.6.0", - "mocha": "^11.7.1", + "mocha": "^11.7.5", "nyc": "^15.1.0", "prettier": "^3.3.3", "rimraf": "^3.0.2", @@ -3405,15 +3405,16 @@ } }, "node_modules/husky": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", - "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true, + "license": "MIT", "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" @@ -3657,6 +3658,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -5047,9 +5058,9 @@ "integrity": "sha512-ZdPeXAL5AZCkNBETgXLm4EOHFpXtPEXrqmd6YBvatyY24x3f/i2nYSVw/F3gk78TxX5/ogm+yAxFrS713ZhsFg==" }, "node_modules/mocha": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz", - "integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==", + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", "dev": true, "license": "MIT", "dependencies": { @@ -5061,6 +5072,7 @@ "find-up": "^5.0.0", "glob": "^10.4.5", "he": "^1.2.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", "minimatch": "^9.0.5", @@ -10331,9 +10343,9 @@ } }, "husky": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.1.tgz", - "integrity": "sha512-xs7/chUH/CKdOCs7Zy0Aev9e/dKOMZf3K1Az1nar3tzlv0jfqnYtu235bstsWTmXOR0EfINrPa97yy4Lz6RiKw==", + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", "dev": true }, "iconv-lite": { @@ -10484,6 +10496,12 @@ "has-tostringtag": "^1.0.0" } }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -11454,9 +11472,9 @@ "integrity": "sha512-ZdPeXAL5AZCkNBETgXLm4EOHFpXtPEXrqmd6YBvatyY24x3f/i2nYSVw/F3gk78TxX5/ogm+yAxFrS713ZhsFg==" }, "mocha": { - "version": "11.7.1", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.1.tgz", - "integrity": "sha512-5EK+Cty6KheMS/YLPPMJC64g5V61gIR25KsRItHw6x4hEKT6Njp1n9LOlH4gpevuwMVS66SXaBBpg+RWZkza4A==", + "version": "11.7.5", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.5.tgz", + "integrity": "sha512-mTT6RgopEYABzXWFx+GcJ+ZQ32kp4fMf0xvpZIIfSq9Z8lC/++MtcCnQ9t5FP2veYEP95FIYSvW+U9fV4xrlig==", "dev": true, "requires": { "browser-stdout": "^1.3.1", @@ -11467,6 +11485,7 @@ "find-up": "^5.0.0", "glob": "^10.4.5", "he": "^1.2.0", + "is-path-inside": "^3.0.3", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", "minimatch": "^9.0.5", diff --git a/package.json b/package.json index 7f043aadc..4768cb3c6 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "stop_arangodb": "arangodb --starter.mode=single --starter.local --starter.port=8528 --starter.data-dir=./db stop", "compile-json-schema": "ajv --all-errors true compile -s src/schema/preparation/source-validation-modules/schema/schema.json -o src/schema/preparation/source-validation-modules/schema/validate-schema.js", "mrproper": "rimraf dist db node_modules package-lock.json", - "prepare": "husky install", + "prepare": "husky", "dev": "node cruddl-dev.js", "knip": "knip", "knip:prod": "knip --production" @@ -60,11 +60,11 @@ "deep-equal-in-any-order": "^1.1.20", "express": "^4.19.2", "graphql": "^16.6.0", - "husky": "^8.0.1", + "husky": "^9.1.7", "knip": "^5.27.0", "lint-staged": "^15.2.10", "log4js": "^6.6.0", - "mocha": "^11.7.1", + "mocha": "^11.7.5", "nyc": "^15.1.0", "prettier": "^3.3.3", "rimraf": "^3.0.2", @@ -111,11 +111,6 @@ ], "all": true }, - "husky": { - "hooks": { - "pre-commit": "npx lint-staged" - } - }, "lint-staged": { "*": "prettier --ignore-unknown --write" } diff --git a/spec/dev/model/simple.graphqls b/spec/dev/model/simple.graphqls index b06b23bce..a91057efb 100644 --- a/spec/dev/model/simple.graphqls +++ b/spec/dev/model/simple.graphqls @@ -50,7 +50,7 @@ type Skill @valueObject { } "A superhero movie" -type Movie @rootEntity @roles(read: ["logistics-reader"]) { +type Movie @rootEntity { name: String "All the heroes starring in this movie" heroes: [Hero] @relation @@ -71,6 +71,7 @@ type Movie @rootEntity @roles(read: ["logistics-reader"]) { type Director @rootEntity { name: String movies: [Movie] @relation(inverseOf: "director") + allMissions: [Mission] @collect(path: "movies.heroes.missions", aggregate: DISTINCT) } "A description of a hero suit" diff --git a/spec/dev/server.ts b/spec/dev/server.ts index da2eee7eb..6fe746bfb 100644 --- a/spec/dev/server.ts +++ b/spec/dev/server.ts @@ -3,7 +3,7 @@ import bodyParser from 'body-parser'; import cors from 'cors'; import express from 'express'; import { resolve } from 'path'; -import { ArangoDBAdapter, Project } from '../..'; +import { ArangoDBAdapter, ExecutionOptions, Project } from '../..'; import { globalContext } from '../../src/config/global'; import { InMemoryAdapter } from '../../src/database/inmemory'; import { getMetaSchema } from '../../src/meta-schema/meta-schema'; @@ -18,7 +18,7 @@ const databaseURL = 'http://root:@localhost:8529'; // const databaseURL = 'http://root:@localhost:7050'; export async function start() { - const loggerProvider = new Log4jsLoggerProvider('error'); + const loggerProvider = new Log4jsLoggerProvider(); let db; if (process.argv.includes('--db=in-memory')) { @@ -44,7 +44,7 @@ export async function start() { ); }, getOperationIdentifier: ({ context }) => context as object, // each operation is executed with an unique context object - getExecutionOptions: ({ context }: { context: any }) => { + getExecutionOptions: ({ context }: { context: any }): ExecutionOptions => { return { authContext: { authRoles: ['allusers'] }, recordTimings: true, diff --git a/spec/helpers/log4js-logger-provider.ts b/spec/helpers/log4js-logger-provider.ts index 4b08a5e8e..4839b9d11 100644 --- a/spec/helpers/log4js-logger-provider.ts +++ b/spec/helpers/log4js-logger-provider.ts @@ -2,15 +2,10 @@ import { getLogger } from 'log4js'; import { Logger, LoggerProvider } from '../../src/config/logging'; export class Log4jsLoggerProvider implements LoggerProvider { - constructor( - public readonly level: string, - public readonly levelByCategory: { [category: string]: string } = {}, - ) {} - getLogger(category: string): Logger { - const logger = getLogger(category); - logger.level = - category in this.levelByCategory ? this.levelByCategory[category] : this.level; - return logger; + // note: we used to change the level here, but that does not work because in log4js, + // everything is global state (you're actually changing a category's level globally if you + // set .level on a logger) + return getLogger(category); } } diff --git a/spec/helpers/warn-and-error-logger-provider.ts b/spec/helpers/warn-and-error-logger-provider.ts new file mode 100644 index 000000000..5bad4bf4c --- /dev/null +++ b/spec/helpers/warn-and-error-logger-provider.ts @@ -0,0 +1,33 @@ +import { Logger, LoggerProvider } from '../../src/config/logging'; + +export class WarnAndErrorLoggerProvider implements LoggerProvider { + getLogger(category: string): Logger { + // note: can't use log4js's getLogger because we can't set a log level on a logger + // (setting .level on a logger actually changes the level globally for that category) + return new WarnAndErrorLogger(category); + } +} + +export class WarnAndErrorLogger implements Logger { + constructor(private category?: string) {} + + trace = () => {}; + debug = () => {}; + info = () => {}; + warn = (message: string, ...args: unknown[]) => + console.warn(`[WARN] ${this.category}: ${message}`, ...args); + error = (message: string, ...args: unknown[]) => + console.error(`[ERROR] ${this.category}: ${message}`, ...args); + fatal = (message: string, ...args: unknown[]) => + console.error(`[FATAL] ${this.category}: ${message}`, ...args); + + level = 'warn'; + + isLevelEnabled = (level: string) => ['warn', 'error', 'fatal'].includes(level.toLowerCase()); + isTraceEnabled = () => false; + isDebugEnabled = () => false; + isInfoEnabled = () => false; + isWarnEnabled = () => true; + isErrorEnabled = () => true; + isFatalEnabled = () => true; +} diff --git a/spec/performance/support/helpers.ts b/spec/performance/support/helpers.ts index d1fa7164c..88f7ccde7 100644 --- a/spec/performance/support/helpers.ts +++ b/spec/performance/support/helpers.ts @@ -6,10 +6,10 @@ import { ArangoDBAdapter } from '../../../src/database/arangodb'; import { Project } from '../../../src/project/project'; import { loadProjectFromDir } from '../../../src/project/project-from-fs'; import { range } from '../../../src/utils/utils'; -import { Log4jsLoggerProvider } from '../../helpers/log4js-logger-provider'; import { createTempDatabase } from '../../regression/initialization'; +import { WarnAndErrorLoggerProvider } from '../../helpers/warn-and-error-logger-provider'; -// arangojs typings for this are completely broken +// arangojs typings for this are completely bro ken export const aql: (template: TemplateStringsArray, ...args: ReadonlyArray) => any = require('arangojs').aql; @@ -22,7 +22,7 @@ export interface TestEnvironment { } const schemaContext: ProjectOptions = { - loggerProvider: new Log4jsLoggerProvider('warn'), + loggerProvider: new WarnAndErrorLoggerProvider(), getExecutionOptions: ({}) => ({ authContext: { authRoles: ['admin'] } }), }; diff --git a/spec/regression/access-groups/tests/accounting.result.json b/spec/regression/access-groups/tests/accounting.result.json deleted file mode 100644 index 9f9a333ae..000000000 --- a/spec/regression/access-groups/tests/accounting.result.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "allFiles": [ - { - "name": "accounting" - }, - { - "name": "public" - } - ] - } -} diff --git a/spec/regression/access-groups/tests/accounting/aql/allFiles.aql b/spec/regression/access-groups/tests/accounting/aql/allFiles.aql new file mode 100644 index 000000000..5c36bdc2e --- /dev/null +++ b/spec/regression/access-groups/tests/accounting/aql/allFiles.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-groups/tests/accounting.context.json b/spec/regression/access-groups/tests/accounting/context.json similarity index 100% rename from spec/regression/access-groups/tests/accounting.context.json rename to spec/regression/access-groups/tests/accounting/context.json diff --git a/spec/regression/access-groups/tests/accounting/result.json b/spec/regression/access-groups/tests/accounting/result.json new file mode 100644 index 000000000..bdb176296 --- /dev/null +++ b/spec/regression/access-groups/tests/accounting/result.json @@ -0,0 +1,14 @@ +{ + "allFiles": { + "data": { + "allFiles": [ + { + "name": "accounting" + }, + { + "name": "public" + } + ] + } + } +} diff --git a/spec/regression/access-groups/tests/accounting.graphql b/spec/regression/access-groups/tests/accounting/test.graphql similarity index 76% rename from spec/regression/access-groups/tests/accounting.graphql rename to spec/regression/access-groups/tests/accounting/test.graphql index 7312f121a..5b4944b5d 100644 --- a/spec/regression/access-groups/tests/accounting.graphql +++ b/spec/regression/access-groups/tests/accounting/test.graphql @@ -1,4 +1,4 @@ -{ +query allFiles { allFiles(orderBy: name_ASC) { name } diff --git a/spec/regression/access-groups/tests/dynamic-access-groups/aql/correctAccessGroups.aql b/spec/regression/access-groups/tests/dynamic-access-groups/aql/correctAccessGroups.aql new file mode 100644 index 000000000..38c89fe26 --- /dev/null +++ b/spec/regression/access-groups/tests/dynamic-access-groups/aql/correctAccessGroups.aql @@ -0,0 +1,76 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +WITH @@files +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +WITH @@files +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "f1": @v_createFile1, + "f2": @v_createFile2, + "f3": @v_createFile3 +} diff --git a/spec/regression/access-groups/tests/dynamic-access-groups/aql/list.aql b/spec/regression/access-groups/tests/dynamic-access-groups/aql/list.aql new file mode 100644 index 000000000..122ce08cf --- /dev/null +++ b/spec/regression/access-groups/tests/dynamic-access-groups/aql/list.aql @@ -0,0 +1,16 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name`, + "accessGroup": v_file1.`accessGroup` + } + ) +} diff --git a/spec/regression/access-groups/tests/dynamic-access-groups/aql/wrongAccessGroup.aql b/spec/regression/access-groups/tests/dynamic-access-groups/aql/wrongAccessGroup.aql new file mode 100644 index 000000000..838aa79a0 --- /dev/null +++ b/spec/regression/access-groups/tests/dynamic-access-groups/aql/wrongAccessGroup.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-groups/tests/dynamic-access-groups.context.json b/spec/regression/access-groups/tests/dynamic-access-groups/context.json similarity index 100% rename from spec/regression/access-groups/tests/dynamic-access-groups.context.json rename to spec/regression/access-groups/tests/dynamic-access-groups/context.json diff --git a/spec/regression/access-groups/tests/dynamic-access-groups.result.json b/spec/regression/access-groups/tests/dynamic-access-groups/result.json similarity index 100% rename from spec/regression/access-groups/tests/dynamic-access-groups.result.json rename to spec/regression/access-groups/tests/dynamic-access-groups/result.json diff --git a/spec/regression/access-groups/tests/dynamic-access-groups.graphql b/spec/regression/access-groups/tests/dynamic-access-groups/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/dynamic-access-groups.graphql rename to spec/regression/access-groups/tests/dynamic-access-groups/test.graphql diff --git a/spec/regression/access-groups/tests/flex-search/aql/flexAuth.aql b/spec/regression/access-groups/tests/flex-search/aql/flexAuth.aql new file mode 100644 index 000000000..9e2e9ce54 --- /dev/null +++ b/spec/regression/access-groups/tests/flex-search/aql/flexAuth.aql @@ -0,0 +1,3 @@ +RETURN { + "flexSearchFiles": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/access-groups/tests/flex-search.result.json b/spec/regression/access-groups/tests/flex-search/result.json similarity index 100% rename from spec/regression/access-groups/tests/flex-search.result.json rename to spec/regression/access-groups/tests/flex-search/result.json diff --git a/spec/regression/access-groups/tests/flex-search.graphql b/spec/regression/access-groups/tests/flex-search/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/flex-search.graphql rename to spec/regression/access-groups/tests/flex-search/test.graphql diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deletePublic.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deletePublic.aql new file mode 100644 index 000000000..7536aa921 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deletePublic.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file2._key == @var2) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..7536aa921 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file2._key == @var2) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..7536aa921 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file2._key == @var2) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updatePublic.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updatePublic.aql new file mode 100644 index 000000000..a4c63f297 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updatePublic.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestricted.aql new file mode 100644 index 000000000..a4c63f297 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestricted.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d300bc05e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..d300bc05e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d300bc05e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..a4c63f297 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d300bc05e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk.context.json b/spec/regression/access-groups/tests/logistics-reader-bulk/context.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-bulk.context.json rename to spec/regression/access-groups/tests/logistics-reader-bulk/context.json diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk.result.json b/spec/regression/access-groups/tests/logistics-reader-bulk/result.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-bulk.result.json rename to spec/regression/access-groups/tests/logistics-reader-bulk/result.json diff --git a/spec/regression/access-groups/tests/logistics-reader-bulk.graphql b/spec/regression/access-groups/tests/logistics-reader-bulk/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-bulk.graphql rename to spec/regression/access-groups/tests/logistics-reader-bulk/test.graphql diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql new file mode 100644 index 000000000..02cce795f --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` IN @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..02cce795f --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` IN @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/deletePublic.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/deletePublic.aql new file mode 100644 index 000000000..c5e1777b8 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/deletePublic.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..c5e1777b8 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteReadRestricted.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..c5e1777b8 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/deleteWriteRestricted.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/q.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/q.aql new file mode 100644 index 000000000..5c36bdc2e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updatePublic.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updatePublic.aql new file mode 100644 index 000000000..22d1e184e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updatePublic.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestricted.aql new file mode 100644 index 000000000..22d1e184e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestricted.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..7553fada6 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..7553fada6 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..7553fada6 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..22d1e184e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestricted.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..7553fada6 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader-many.context.json b/spec/regression/access-groups/tests/logistics-reader-many/context.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-many.context.json rename to spec/regression/access-groups/tests/logistics-reader-many/context.json diff --git a/spec/regression/access-groups/tests/logistics-reader-many.result.json b/spec/regression/access-groups/tests/logistics-reader-many/result.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-many.result.json rename to spec/regression/access-groups/tests/logistics-reader-many/result.json diff --git a/spec/regression/access-groups/tests/logistics-reader-many.graphql b/spec/regression/access-groups/tests/logistics-reader-many/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader-many.graphql rename to spec/regression/access-groups/tests/logistics-reader-many/test.graphql diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql new file mode 100644 index 000000000..724019bb5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..724019bb5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/deletePublic.aql b/spec/regression/access-groups/tests/logistics-reader/aql/deletePublic.aql new file mode 100644 index 000000000..b61b153c5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/deletePublic.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/deleteReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..b61b153c5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/deleteReadRestricted.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/deleteWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..b61b153c5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/deleteWriteRestricted.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/q.aql b/spec/regression/access-groups/tests/logistics-reader/aql/q.aql new file mode 100644 index 000000000..5c36bdc2e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updatePublic.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updatePublic.aql new file mode 100644 index 000000000..dfdacff71 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updatePublic.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestricted.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestricted.aql new file mode 100644 index 000000000..dfdacff71 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestricted.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..89a428c8c --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..89a428c8c --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..89a428c8c --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestricted.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..dfdacff71 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestricted.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..89a428c8c --- /dev/null +++ b/spec/regression/access-groups/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics-reader.context.json b/spec/regression/access-groups/tests/logistics-reader/context.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader.context.json rename to spec/regression/access-groups/tests/logistics-reader/context.json diff --git a/spec/regression/access-groups/tests/logistics-reader.result.json b/spec/regression/access-groups/tests/logistics-reader/result.json similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader.result.json rename to spec/regression/access-groups/tests/logistics-reader/result.json diff --git a/spec/regression/access-groups/tests/logistics-reader.graphql b/spec/regression/access-groups/tests/logistics-reader/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/logistics-reader.graphql rename to spec/regression/access-groups/tests/logistics-reader/test.graphql diff --git a/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql new file mode 100644 index 000000000..02cce795f --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` IN @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql new file mode 100644 index 000000000..02cce795f --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` IN @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithPermissions.aql new file mode 100644 index 000000000..724019bb5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithPermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql new file mode 100644 index 000000000..724019bb5 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/q.aql b/spec/regression/access-groups/tests/logistics/aql/q.aql new file mode 100644 index 000000000..5c36bdc2e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-groups/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..d300bc05e --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var3)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var3, + "updatedAt": @var4 + }).`accessGroup` IN @var5)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var3, + "updatedAt": @var4 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN ((v_entity1.`accessGroup` IN @var1) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..7553fada6 --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-groups/tests/logistics/aql/updateToAccessGroupWithPermissions.aql b/spec/regression/access-groups/tests/logistics/aql/updateToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..89a428c8c --- /dev/null +++ b/spec/regression/access-groups/tests/logistics/aql/updateToAccessGroupWithPermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file2._key == @var2) + LIMIT @var3 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` IN @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER (v_item2.`accessGroup` IN @var1) + RETURN v_item2 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` IN @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_file1._key == @var2) + LIMIT @var3 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN ((v_entity1.`accessGroup` IN @var2) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-groups/tests/logistics.context.json b/spec/regression/access-groups/tests/logistics/context.json similarity index 100% rename from spec/regression/access-groups/tests/logistics.context.json rename to spec/regression/access-groups/tests/logistics/context.json diff --git a/spec/regression/access-groups/tests/logistics.result.json b/spec/regression/access-groups/tests/logistics/result.json similarity index 100% rename from spec/regression/access-groups/tests/logistics.result.json rename to spec/regression/access-groups/tests/logistics/result.json diff --git a/spec/regression/access-groups/tests/logistics.graphql b/spec/regression/access-groups/tests/logistics/test.graphql similarity index 100% rename from spec/regression/access-groups/tests/logistics.graphql rename to spec/regression/access-groups/tests/logistics/test.graphql diff --git a/spec/regression/access-restrictions/tests/accounting.result.json b/spec/regression/access-restrictions/tests/accounting.result.json deleted file mode 100644 index 9f9a333ae..000000000 --- a/spec/regression/access-restrictions/tests/accounting.result.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "allFiles": [ - { - "name": "accounting" - }, - { - "name": "public" - } - ] - } -} diff --git a/spec/regression/access-restrictions/tests/accounting/aql/allFiles.aql b/spec/regression/access-restrictions/tests/accounting/aql/allFiles.aql new file mode 100644 index 000000000..4be675fcb --- /dev/null +++ b/spec/regression/access-restrictions/tests/accounting/aql/allFiles.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/accounting.context.json b/spec/regression/access-restrictions/tests/accounting/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/accounting.context.json rename to spec/regression/access-restrictions/tests/accounting/context.json diff --git a/spec/regression/access-restrictions/tests/accounting/result.json b/spec/regression/access-restrictions/tests/accounting/result.json new file mode 100644 index 000000000..bdb176296 --- /dev/null +++ b/spec/regression/access-restrictions/tests/accounting/result.json @@ -0,0 +1,14 @@ +{ + "allFiles": { + "data": { + "allFiles": [ + { + "name": "accounting" + }, + { + "name": "public" + } + ] + } + } +} diff --git a/spec/regression/access-restrictions/tests/accounting.graphql b/spec/regression/access-restrictions/tests/accounting/test.graphql similarity index 76% rename from spec/regression/access-restrictions/tests/accounting.graphql rename to spec/regression/access-restrictions/tests/accounting/test.graphql index 7312f121a..5b4944b5d 100644 --- a/spec/regression/access-restrictions/tests/accounting.graphql +++ b/spec/regression/access-restrictions/tests/accounting/test.graphql @@ -1,4 +1,4 @@ -{ +query allFiles { allFiles(orderBy: name_ASC) { name } diff --git a/spec/regression/access-restrictions/tests/customer-flex/aql/flexAuth.aql b/spec/regression/access-restrictions/tests/customer-flex/aql/flexAuth.aql new file mode 100644 index 000000000..25859c67b --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer-flex/aql/flexAuth.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @@flex_view_files + SEARCH (true && ((v_file1.`customerName` == @var1) || (v_file1.`customerName` IN @var2))) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var3) + +// -------------------------------- + +RETURN { + "flexSearchFiles": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_file1 + IN ( + FOR v_file2 + IN @@flex_view_files + SEARCH (true && ((v_file2.`customerName` == @var3) || (v_file2.`customerName` IN @var4))) + RETURN v_file2 + ) + SORT (v_file1.`name`) , (v_file1._key) + RETURN { + "name": v_file1.`name` + } + )) +} diff --git a/spec/regression/access-restrictions/tests/customer-flex.context.json b/spec/regression/access-restrictions/tests/customer-flex/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/customer-flex.context.json rename to spec/regression/access-restrictions/tests/customer-flex/context.json diff --git a/spec/regression/access-restrictions/tests/customer-flex.meta.json b/spec/regression/access-restrictions/tests/customer-flex/meta.json similarity index 100% rename from spec/regression/access-restrictions/tests/customer-flex.meta.json rename to spec/regression/access-restrictions/tests/customer-flex/meta.json diff --git a/spec/regression/access-restrictions/tests/customer-flex.result.json b/spec/regression/access-restrictions/tests/customer-flex/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/customer-flex.result.json rename to spec/regression/access-restrictions/tests/customer-flex/result.json diff --git a/spec/regression/access-restrictions/tests/customer-flex.graphql b/spec/regression/access-restrictions/tests/customer-flex/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/customer-flex.graphql rename to spec/regression/access-restrictions/tests/customer-flex/test.graphql diff --git a/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithWritePermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithWritePermissions.aql new file mode 100644 index 000000000..d407d3e0e --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`customerName` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`customerName` == @var1) || (v_entity1.`customerName` IN @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithoutWritePermissions.aql new file mode 100644 index 000000000..d407d3e0e --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/createWithValueWithoutWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`customerName` IN @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`customerName` == @var1) || (v_entity1.`customerName` IN @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/deleteOwn.aql b/spec/regression/access-restrictions/tests/customer/aql/deleteOwn.aql new file mode 100644 index 000000000..fd6c323bf --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/deleteOwn.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`customerName` IN @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/q.aql b/spec/regression/access-restrictions/tests/customer/aql/q.aql new file mode 100644 index 000000000..4c4365614 --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/updateOwn.aql b/spec/regression/access-restrictions/tests/customer/aql/updateOwn.aql new file mode 100644 index 000000000..d7ab6d2de --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/updateOwn.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`customerName` IN @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`customerName` IN @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`customerName` == @var2) || (v_entity1.`customerName` IN @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/updateReadRestrictedToValueWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/updateReadRestrictedToValueWithoutWritePermissions.aql new file mode 100644 index 000000000..fe74ed706 --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/updateReadRestrictedToValueWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`customerName` IN @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`customerName` IN @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`customerName` == @var2) || (v_entity1.`customerName` IN @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutReadPermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutReadPermissions.aql new file mode 100644 index 000000000..11c566df8 --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutReadPermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`customerName` IN @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "customerName": @var5, + "updatedAt": @var6 + }).`customerName` IN @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "customerName": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`customerName` == @var2) || (v_entity1.`customerName` IN @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutWritePermissions.aql new file mode 100644 index 000000000..11c566df8 --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/updateToValueWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`customerName` IN @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "customerName": @var5, + "updatedAt": @var6 + }).`customerName` IN @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "customerName": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`customerName` == @var2) || (v_entity1.`customerName` IN @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/customer/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..11c566df8 --- /dev/null +++ b/spec/regression/access-restrictions/tests/customer/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`customerName` IN @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`customerName` == @var1) || (v_item2.`customerName` IN @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "customerName": @var5, + "updatedAt": @var6 + }).`customerName` IN @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`customerName` == @var1) || (v_item1.`customerName` IN @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "customerName": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`customerName` == @var2) || (v_entity1.`customerName` IN @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/customer.context.json b/spec/regression/access-restrictions/tests/customer/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/customer.context.json rename to spec/regression/access-restrictions/tests/customer/context.json diff --git a/spec/regression/access-restrictions/tests/customer.result.json b/spec/regression/access-restrictions/tests/customer/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/customer.result.json rename to spec/regression/access-restrictions/tests/customer/result.json diff --git a/spec/regression/access-restrictions/tests/customer.graphql b/spec/regression/access-restrictions/tests/customer/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/customer.graphql rename to spec/regression/access-restrictions/tests/customer/test.graphql diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/correctAccessGroups.aql b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/correctAccessGroups.aql new file mode 100644 index 000000000..a5df32b95 --- /dev/null +++ b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/correctAccessGroups.aql @@ -0,0 +1,76 @@ +RETURN ((@var1.`accessGroup` IN @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` IN @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN ((@var1.`accessGroup` IN @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +WITH @@files +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` IN @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN ((@var1.`accessGroup` IN @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +WITH @@files +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` IN @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "f1": @v_createFile1, + "f2": @v_createFile2, + "f3": @v_createFile3 +} diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/list.aql b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/list.aql new file mode 100644 index 000000000..2d604aa94 --- /dev/null +++ b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/list.aql @@ -0,0 +1,16 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` IN @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name`, + "accessGroup": v_file1.`accessGroup` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/wrongAccessGroup.aql b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/wrongAccessGroup.aql new file mode 100644 index 000000000..64c08c784 --- /dev/null +++ b/spec/regression/access-restrictions/tests/dynamic-access-groups/aql/wrongAccessGroup.aql @@ -0,0 +1,26 @@ +RETURN ((@var1.`accessGroup` IN @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` IN @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "accessGroup": v_file1.`accessGroup` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups.context.json b/spec/regression/access-restrictions/tests/dynamic-access-groups/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/dynamic-access-groups.context.json rename to spec/regression/access-restrictions/tests/dynamic-access-groups/context.json diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups.result.json b/spec/regression/access-restrictions/tests/dynamic-access-groups/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/dynamic-access-groups.result.json rename to spec/regression/access-restrictions/tests/dynamic-access-groups/result.json diff --git a/spec/regression/access-restrictions/tests/dynamic-access-groups.graphql b/spec/regression/access-restrictions/tests/dynamic-access-groups/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/dynamic-access-groups.graphql rename to spec/regression/access-restrictions/tests/dynamic-access-groups/test.graphql diff --git a/spec/regression/access-restrictions/tests/flex-search/aql/flexAuth.aql b/spec/regression/access-restrictions/tests/flex-search/aql/flexAuth.aql new file mode 100644 index 000000000..3136ba77e --- /dev/null +++ b/spec/regression/access-restrictions/tests/flex-search/aql/flexAuth.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @@flex_view_files + SEARCH (true && ((v_file1.`accessGroup` == @var1) || (v_file1.`accessGroup` == @var2))) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var3) + +// -------------------------------- + +RETURN { + "flexSearchFiles": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_file1 + IN ( + FOR v_file2 + IN @@flex_view_files + SEARCH (true && ((v_file2.`accessGroup` == @var3) || (v_file2.`accessGroup` == @var4))) + RETURN v_file2 + ) + SORT (v_file1.`name`) , (v_file1._key) + RETURN { + "name": v_file1.`name` + } + )) +} diff --git a/spec/regression/access-restrictions/tests/flex-search.context.json b/spec/regression/access-restrictions/tests/flex-search/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/flex-search.context.json rename to spec/regression/access-restrictions/tests/flex-search/context.json diff --git a/spec/regression/access-restrictions/tests/flex-search.meta.json b/spec/regression/access-restrictions/tests/flex-search/meta.json similarity index 100% rename from spec/regression/access-restrictions/tests/flex-search.meta.json rename to spec/regression/access-restrictions/tests/flex-search/meta.json diff --git a/spec/regression/access-restrictions/tests/flex-search.result.json b/spec/regression/access-restrictions/tests/flex-search/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/flex-search.result.json rename to spec/regression/access-restrictions/tests/flex-search/result.json diff --git a/spec/regression/access-restrictions/tests/flex-search.graphql b/spec/regression/access-restrictions/tests/flex-search/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/flex-search.graphql rename to spec/regression/access-restrictions/tests/flex-search/test.graphql diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deletePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deletePublic.aql new file mode 100644 index 000000000..edf68c4bd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deletePublic.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file2._key == @var3) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..edf68c4bd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteReadRestricted.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file2._key == @var3) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..edf68c4bd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/deleteWriteRestricted.aql @@ -0,0 +1,49 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file2._key == @var3) + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllFiles": @v_deleteAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updatePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updatePublic.aql new file mode 100644 index 000000000..2e3c6dbdf --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updatePublic.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestricted.aql new file mode 100644 index 000000000..2e3c6dbdf --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestricted.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..9a5280b50 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..9a5280b50 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..9a5280b50 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..2e3c6dbdf --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestricted.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..9a5280b50 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-bulk/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,96 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var4)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk.context.json b/spec/regression/access-restrictions/tests/logistics-reader-bulk/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-bulk.context.json rename to spec/regression/access-restrictions/tests/logistics-reader-bulk/context.json diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk.result.json b/spec/regression/access-restrictions/tests/logistics-reader-bulk/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-bulk.result.json rename to spec/regression/access-restrictions/tests/logistics-reader-bulk/result.json diff --git a/spec/regression/access-restrictions/tests/logistics-reader-bulk.graphql b/spec/regression/access-restrictions/tests/logistics-reader-bulk/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-bulk.graphql rename to spec/regression/access-restrictions/tests/logistics-reader-bulk/test.graphql diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql new file mode 100644 index 000000000..9fefa9178 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithWritePermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` == @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..9fefa9178 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/createWithAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN (v_object1.`accessGroup` == @var2) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deletePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deletePublic.aql new file mode 100644 index 000000000..24f030e77 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deletePublic.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..24f030e77 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteReadRestricted.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..24f030e77 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/deleteWriteRestricted.aql @@ -0,0 +1,51 @@ +WITH @@files +RETURN ( + FOR v_item1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + )._key + ] + FILTER (v_item1 > NULL) + RETURN v_item1 +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFiles": @v_deleteFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/q.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/q.aql new file mode 100644 index 000000000..4be675fcb --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updatePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updatePublic.aql new file mode 100644 index 000000000..b387f4fb0 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updatePublic.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestricted.aql new file mode 100644 index 000000000..b387f4fb0 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestricted.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d7900d5cc --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..d7900d5cc --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d7900d5cc --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..b387f4fb0 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestricted.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..d7900d5cc --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader-many/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many.context.json b/spec/regression/access-restrictions/tests/logistics-reader-many/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-many.context.json rename to spec/regression/access-restrictions/tests/logistics-reader-many/context.json diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many.result.json b/spec/regression/access-restrictions/tests/logistics-reader-many/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-many.result.json rename to spec/regression/access-restrictions/tests/logistics-reader-many/result.json diff --git a/spec/regression/access-restrictions/tests/logistics-reader-many.graphql b/spec/regression/access-restrictions/tests/logistics-reader-many/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader-many.graphql rename to spec/regression/access-restrictions/tests/logistics-reader-many/test.graphql diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql new file mode 100644 index 000000000..611f5a449 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` == @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..611f5a449 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/createWithAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,26 @@ +RETURN (@var1.`accessGroup` == @var2) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/deletePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/deletePublic.aql new file mode 100644 index 000000000..b1c1786a3 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/deletePublic.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteReadRestricted.aql new file mode 100644 index 000000000..b1c1786a3 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteReadRestricted.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteWriteRestricted.aql new file mode 100644 index 000000000..b1c1786a3 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/deleteWriteRestricted.aql @@ -0,0 +1,48 @@ +RETURN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1._key +) + +// -------------------------------- + +WITH @@files +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN @v_ids1 + FILTER !((DOCUMENT(@@files, v_file1).`accessGroup` == @var1)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST(( + FOR v_file2 + IN @v_ids1 + REMOVE v_file2 + IN @@files + RETURN OLD +)) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "deleteFile": @v_deleteFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/q.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/q.aql new file mode 100644 index 000000000..4be675fcb --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updatePublic.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updatePublic.aql new file mode 100644 index 000000000..0612a71cd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updatePublic.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestricted.aql new file mode 100644 index 000000000..0612a71cd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestricted.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..74448ee97 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateReadRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql new file mode 100644 index 000000000..74448ee97 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutReadPermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..74448ee97 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestricted.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestricted.aql new file mode 100644 index 000000000..0612a71cd --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestricted.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "name": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql new file mode 100644 index 000000000..74448ee97 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/aql/updateWriteRestrictedToAccessGroupWithoutWritePermissions.aql @@ -0,0 +1,94 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !((v_file1.`accessGroup` == @var5)) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7)) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader.context.json b/spec/regression/access-restrictions/tests/logistics-reader/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics-reader.context.json rename to spec/regression/access-restrictions/tests/logistics-reader/context.json diff --git a/spec/regression/access-restrictions/tests/logistics-reader/result.json b/spec/regression/access-restrictions/tests/logistics-reader/result.json new file mode 100644 index 000000000..469f50f6e --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/result.json @@ -0,0 +1,174 @@ +{ + "q": { + "data": { + "allFiles": [ + { + "name": "logistics" + }, + { + "name": "public" + } + ] + } + }, + "updatePublic": { + "data": { + "updateFile": { + "name": "public2" + } + } + }, + "updateToAccessGroupWithoutReadPermissions": { + "errors": [ + { + "message": "Not authorized to set File.accessGroup to this value", + "locations": [ + { + "line": 15, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "updateToAccessGroupWithoutWritePermissions": { + "errors": [ + { + "message": "Not authorized to set File.accessGroup to this value", + "locations": [ + { + "line": 22, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "createWithAccessGroupWithWritePermissions": { + "data": { + "createFile": { + "name": "test" + } + } + }, + "createWithAccessGroupWithoutWritePermissions": { + "errors": [ + { + "message": "Not authorized to set File.accessGroup to this value", + "locations": [ + { + "line": 36, + "column": 5 + } + ], + "path": ["createFile"] + } + ], + "data": null + }, + "updateWriteRestricted": { + "errors": [ + { + "message": "Not authorized to update this File object", + "locations": [ + { + "line": 42, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "updateWriteRestrictedToAccessGroupWithoutWritePermissions": { + "errors": [ + { + "message": "Not authorized to update this File object", + "locations": [ + { + "line": 49, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "updateReadRestricted": { + "errors": [ + { + "message": "File with id '@{ids/File/1}' could not be found.", + "locations": [ + { + "line": 55, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "updateReadRestrictedToAccessGroupWithoutWritePermissions": { + "errors": [ + { + "message": "File with id '@{ids/File/1}' could not be found.", + "locations": [ + { + "line": 62, + "column": 5 + } + ], + "path": ["updateFile"] + } + ], + "data": { + "updateFile": null + } + }, + "deletePublic": { + "data": { + "deleteFile": { + "name": "public2" + } + } + }, + "deleteWriteRestricted": { + "errors": [ + { + "message": "Not authorized to delete this File object", + "locations": [ + { + "line": 74, + "column": 5 + } + ], + "path": ["deleteFile"] + } + ], + "data": { + "deleteFile": null + } + }, + "deleteReadRestricted": { + "data": { + "deleteFile": null + } + } +} diff --git a/spec/regression/access-restrictions/tests/logistics-reader/test.graphql b/spec/regression/access-restrictions/tests/logistics-reader/test.graphql new file mode 100644 index 000000000..68f7461de --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics-reader/test.graphql @@ -0,0 +1,83 @@ +query q { + allFiles(orderBy: name_ASC) { + name + } +} + +mutation updatePublic { + updateFile(input: { id: "@{ids/File/3}", name: "public2" }) { + name + } +} + +# should fail +mutation updateToAccessGroupWithoutReadPermissions { + updateFile(input: { id: "@{ids/File/3}", accessGroup: "accounting" }) { + name + } +} + +# should fail +mutation updateToAccessGroupWithoutWritePermissions { + updateFile(input: { id: "@{ids/File/3}", accessGroup: "logistics" }) { + name + } +} + +# should pass +mutation createWithAccessGroupWithWritePermissions { + createFile(input: { name: "test", accessGroup: "public" }) { + name + } +} + +# should fail +mutation createWithAccessGroupWithoutWritePermissions { + createFile(input: { name: "test", accessGroup: "logistics" }) { + name + } +} + +mutation updateWriteRestricted { + updateFile(input: { id: "@{ids/File/2}", name: "logistics2" }) { + name + } +} + +# should fail with first error (write restriction vs. setting the value) +mutation updateWriteRestrictedToAccessGroupWithoutWritePermissions { + updateFile(input: { id: "@{ids/File/2}", accessGroup: "logistics" }) { + name + } +} + +mutation updateReadRestricted { + updateFile(input: { id: "@{ids/File/1}", name: "accounting" }) { + name + } +} + +# should not find this and not report that the accessGroup can not be set +mutation updateReadRestrictedToAccessGroupWithoutWritePermissions { + updateFile(input: { id: "@{ids/File/1}", accessGroup: "logistics" }) { + name + } +} + +mutation deletePublic { + deleteFile(id: "@{ids/File/3}") { + name + } +} + +mutation deleteWriteRestricted { + deleteFile(id: "@{ids/File/2}") { + name + } +} + +mutation deleteReadRestricted { + deleteFile(id: "@{ids/File/1}") { + name + } +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql new file mode 100644 index 000000000..74caf82b5 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithPermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN ((v_object1.`accessGroup` == @var2) || (v_object1.`accessGroup` == @var3)) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql new file mode 100644 index 000000000..74caf82b5 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/createManyWithAccessGroupWithoutPermissions.aql @@ -0,0 +1,41 @@ +RETURN FIRST( + FOR v_item1 + IN ( + FOR v_object1 + IN @var1 + RETURN ((v_object1.`accessGroup` == @var2) || (v_object1.`accessGroup` == @var3)) + ) + COLLECT AGGREGATE v_every_true1 = MAX(!v_item1) + RETURN v_every_true1 < true +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "createFiles": @v_createFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithPermissions.aql new file mode 100644 index 000000000..35ea052f1 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithPermissions.aql @@ -0,0 +1,26 @@ +RETURN ((@var1.`accessGroup` == @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql new file mode 100644 index 000000000..35ea052f1 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/createWithAccessGroupWithoutPermissions.aql @@ -0,0 +1,26 @@ +RETURN ((@var1.`accessGroup` == @var2) || (@var3.`accessGroup` == @var4)) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@files + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @v_newEntityId1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "createFile": @v_createFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/q.aql b/spec/regression/access-restrictions/tests/logistics/aql/q.aql new file mode 100644 index 000000000..4be675fcb --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/q.aql @@ -0,0 +1,15 @@ +RETURN { + "allFiles": ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + SORT (v_file1.`name`) + RETURN { + "name": v_file1.`name` + } + ) +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..6d79a8193 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/updateAllToAccessGroupWithPermissions.aql @@ -0,0 +1,99 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + RETURN v_file2 + ) + FILTER !(((v_file1.`accessGroup` == @var4) || (v_file1.`accessGroup` == @var5))) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + FILTER !(((MERGE(v_currentEntity1, { + "accessGroup": @var4, + "updatedAt": @var5 + }).`accessGroup` == @var6) || (MERGE(v_currentEntity1, { + "accessGroup": @var7, + "updatedAt": @var8 + }).`accessGroup` == @var9))) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var4, + "updatedAt": @var5 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + LET v_entity1 = DOCUMENT(@@files, v_id1) + RETURN (((v_entity1.`accessGroup` == @var1) || (v_entity1.`accessGroup` == @var2)) ? v_entity1 : null) + ) + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateAllFiles": @v_updateAllFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..02294bc33 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/updateManyToAccessGroupWithPermissions.aql @@ -0,0 +1,102 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !(((v_file1.`accessGroup` == @var5) || (v_file1.`accessGroup` == @var6))) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !(((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7) || (MERGE(v_currentEntity1, { + "accessGroup": @var8, + "updatedAt": @var9 + }).`accessGroup` == @var10))) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +RETURN ( + FOR v_file1 + IN [ + FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) + ) + ] + RETURN { + "name": v_file1.`name` + } +) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFiles": @v_updateFiles1 +} diff --git a/spec/regression/access-restrictions/tests/logistics/aql/updateToAccessGroupWithPermissions.aql b/spec/regression/access-restrictions/tests/logistics/aql/updateToAccessGroupWithPermissions.aql new file mode 100644 index 000000000..dcb400710 --- /dev/null +++ b/spec/regression/access-restrictions/tests/logistics/aql/updateToAccessGroupWithPermissions.aql @@ -0,0 +1,97 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_file1 + IN ( + FOR v_file2 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file2._key == @var3) + LIMIT @var4 + RETURN v_file2 + ) + FILTER !(((v_file1.`accessGroup` == @var5) || (v_file1.`accessGroup` == @var6))) + RETURN v_file1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item2 + IN @@files + FILTER ((v_item2.`accessGroup` == @var1) || (v_item2.`accessGroup` == @var2)) + RETURN v_item2 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + FILTER !(((MERGE(v_currentEntity1, { + "accessGroup": @var5, + "updatedAt": @var6 + }).`accessGroup` == @var7) || (MERGE(v_currentEntity1, { + "accessGroup": @var8, + "updatedAt": @var9 + }).`accessGroup` == @var10))) + RETURN v_currentEntity1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) == 0) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_file1 + IN ( + FOR v_item1 + IN @@files + FILTER ((v_item1.`accessGroup` == @var1) || (v_item1.`accessGroup` == @var2)) + RETURN v_item1 + ) + FILTER (v_file1._key == @var3) + LIMIT @var4 + RETURN v_file1 + ) + UPDATE v_currentEntity1 + WITH { + "accessGroup": @var5, + "updatedAt": @var6 + } + IN @@files + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@files +LET v_file1 = FIRST( + LET v_entity1 = DOCUMENT(@@files, @var1) + RETURN (((v_entity1.`accessGroup` == @var2) || (v_entity1.`accessGroup` == @var3)) ? v_entity1 : null) +) +RETURN (IS_NULL(v_file1) ? null : { + "name": v_file1.`name` +}) + +// -------------------------------- + +WITH @@files +RETURN { + "updateFile": @v_updateFile1 +} diff --git a/spec/regression/access-restrictions/tests/logistics.context.json b/spec/regression/access-restrictions/tests/logistics/context.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics.context.json rename to spec/regression/access-restrictions/tests/logistics/context.json diff --git a/spec/regression/access-restrictions/tests/logistics.result.json b/spec/regression/access-restrictions/tests/logistics/result.json similarity index 100% rename from spec/regression/access-restrictions/tests/logistics.result.json rename to spec/regression/access-restrictions/tests/logistics/result.json diff --git a/spec/regression/access-restrictions/tests/logistics.graphql b/spec/regression/access-restrictions/tests/logistics/test.graphql similarity index 100% rename from spec/regression/access-restrictions/tests/logistics.graphql rename to spec/regression/access-restrictions/tests/logistics/test.graphql diff --git a/spec/regression/collect/model/model.graphqls b/spec/regression/collect/model/model.graphqls index 0a4717b50..f062dd2e8 100644 --- a/spec/regression/collect/model/model.graphqls +++ b/spec/regression/collect/model/model.graphqls @@ -10,15 +10,22 @@ type Shipment @rootEntity { allHandlingUnits: [HandlingUnit] @collect(path: "deliveries.allHandlingUnits", aggregate: DISTINCT) allOrders: [Order] @collect(path: "deliveries.order", aggregate: DISTINCT) + allInvoices: [Invoice] @collect(path: "deliveries.invoices") allDeliveryContents: [DeliveryContent] @collect(path: "deliveries.deliveryContents") allItems: [DeliveryItem] @collect(path: "deliveries.deliveryContents.items") + allDeliveryLocationIdentCodes: [String] + @collect(path: "deliveries.location.identCode", aggregate: DISTINCT) totalWeightInKg: Decimal3 @collect(path: "allItems.weightInKg", aggregate: SUM) maxPriority: Int @collect(path: "deliveries.priority", aggregate: MAX) itemCount: Int @collect(path: "allItems", aggregate: COUNT) deliveryCount: Int @collect(path: "deliveries", aggregate: COUNT) allDeliveriesHaveOrders: Boolean @collect(path: "deliveries.order", aggregate: NONE_NULL) + allDeliveriesHaveOriginalOrders: Boolean + @collect(path: "deliveries.order.originalOrder", aggregate: NONE_NULL) allDeliveriesArePayed: Boolean @collect(path: "deliveries.order.payedAt", aggregate: NONE_NULL) numberOfDeliveriesWithoutOrder: Int @collect(path: "deliveries.order", aggregate: COUNT_NULL) + numberOfDeliveriesWithoutOriginalOrder: Int + @collect(path: "deliveries.order.originalOrder", aggregate: COUNT_NULL) numberOfDeliveriesWithoutPayedOrder: Int @collect(path: "deliveries.order.payedAt", aggregate: COUNT_NULL) #numberOfUnpayedOrders: Int @collect(path: "allOrders.payedAt", aggregate: COUNT_NULL) # waiting for DISTINCT aggregations to be supported in collect paths @@ -38,6 +45,7 @@ type Delivery @rootEntity { handlingUnits: [HandlingUnit] @relation shipment: Shipment @relation(inverseOf: "deliveries") order: Order @relation + invoices: [Invoice] @relation allItems: [DeliveryItem] @collect(path: "deliveryContents.items") allItemNumbers: [String] @@ -102,13 +110,21 @@ type Order @rootEntity { accessGroup: String location: Location @accessField payedAt: DateTime - + originalOrder: Order @relation # so we can have two 1-to-1 relations in a row delivery: Delivery @relation(inverseOf: "order") allOuterHandlingUnits: [HandlingUnit] @collect(path: "delivery.handlingUnits") allItems: [DeliveryItem] @collect(path: "delivery.allItems") } +type Invoice @rootEntity { + invoiceNumber: String @key + accessGroup: String + location: Location @accessField + + delivery: Delivery @relation(inverseOf: "invoices") +} + type DeliveryContent @childEntity { deliveryContentNumber: String diff --git a/spec/regression/collect/test-data.json b/spec/regression/collect/test-data.json index 5013bcb9f..10f6f01be 100644 --- a/spec/regression/collect/test-data.json +++ b/spec/regression/collect/test-data.json @@ -250,6 +250,18 @@ "warehouse": "North", "level": 0 } + }, + { + "@id": "5", + "handlingUnitNumber": "H5", + "accessGroup": "H5", + "location": { + "identCode": "licH5" + }, + "warehouseSlot": { + "warehouse": "North", + "level": 0 + } } ], "Order": [ @@ -286,6 +298,44 @@ "identCode": "licO4" } } + ], + "Invoice": [ + { + "@id": "1", + "invoiceNumber": "I1", + "accessGroup": "I1", + "location": { "identCode": "licI1" } + }, + { + "@id": "2", + "invoiceNumber": "I2", + "accessGroup": "I2", + "location": { "identCode": "licI2" } + }, + { + "@id": "3", + "invoiceNumber": "I3", + "accessGroup": "I3", + "location": { "identCode": "licI3" } + }, + { + "@id": "4", + "invoiceNumber": "I4", + "accessGroup": "I4", + "location": { "identCode": "licI4" } + }, + { + "@id": "5", + "invoiceNumber": "I5", + "accessGroup": "I5", + "location": { "identCode": "licI5" } + }, + { + "@id": "6", + "invoiceNumber": "I6", + "accessGroup": "D6", + "location": { "identCode": "licI6" } + } ] } } diff --git a/spec/regression/collect/tests/collect-edge-count-access-group/aql/count.aql b/spec/regression/collect/tests/collect-edge-count-access-group/aql/count.aql new file mode 100644 index 000000000..b57e48227 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count-access-group/aql/count.aql @@ -0,0 +1,41 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN ( + FOR v_item1 + IN @@shipments + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_shipment2.`shipmentNumber` == @var2) + LIMIT @var3 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + @var4: { + "count": FIRST( + FOR v_item2 + IN ( + FOR v_item3 + IN OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_item3.`accessGroup` IN @var5) + FILTER v_item3._key != null + RETURN v_item3 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }, + "deliveryCount": FIRST( + FOR v_item4 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var6..@var7 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_node1.`accessGroup` IN @var8) + RETURN v_node1 + ) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + }) +} diff --git a/spec/regression/collect/tests/collect-edge-count-access-group/aql/createEdges.aql b/spec/regression/collect/tests/collect-edge-count-access-group/aql/createEdges.aql new file mode 100644 index 000000000..39aa50569 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count-access-group/aql/createEdges.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN { + "updateShipment": @v_updateShipment1 +} diff --git a/spec/regression/collect/tests/collect-edge-count-access-group.context.json b/spec/regression/collect/tests/collect-edge-count-access-group/context.json similarity index 100% rename from spec/regression/collect/tests/collect-edge-count-access-group.context.json rename to spec/regression/collect/tests/collect-edge-count-access-group/context.json diff --git a/spec/regression/collect/tests/collect-edge-count-access-group.meta.json b/spec/regression/collect/tests/collect-edge-count-access-group/meta.json similarity index 100% rename from spec/regression/collect/tests/collect-edge-count-access-group.meta.json rename to spec/regression/collect/tests/collect-edge-count-access-group/meta.json diff --git a/spec/regression/collect/tests/collect-edge-count-access-group.result.json b/spec/regression/collect/tests/collect-edge-count-access-group/result.json similarity index 100% rename from spec/regression/collect/tests/collect-edge-count-access-group.result.json rename to spec/regression/collect/tests/collect-edge-count-access-group/result.json diff --git a/spec/regression/collect/tests/collect-edge-count-access-group.graphql b/spec/regression/collect/tests/collect-edge-count-access-group/test.graphql similarity index 100% rename from spec/regression/collect/tests/collect-edge-count-access-group.graphql rename to spec/regression/collect/tests/collect-edge-count-access-group/test.graphql diff --git a/spec/regression/collect/tests/collect-edge-count/aql/countAfter.aql b/spec/regression/collect/tests/collect-edge-count/aql/countAfter.aql new file mode 100644 index 000000000..869b0fa84 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count/aql/countAfter.aql @@ -0,0 +1,34 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + @var3: { + "count": FIRST( + FOR v_item1 + IN ( + FOR v_node1 + IN OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_node1._key != null + RETURN v_node1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }, + "deliveryCount": FIRST( + FOR v_item2 + IN ( + FOR v_node2, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + RETURN v_node2 + ) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + }) +} diff --git a/spec/regression/collect/tests/collect-edge-count/aql/countBefore.aql b/spec/regression/collect/tests/collect-edge-count/aql/countBefore.aql new file mode 100644 index 000000000..869b0fa84 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count/aql/countBefore.aql @@ -0,0 +1,34 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + @var3: { + "count": FIRST( + FOR v_item1 + IN ( + FOR v_node1 + IN OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_node1._key != null + RETURN v_node1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }, + "deliveryCount": FIRST( + FOR v_item2 + IN ( + FOR v_node2, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + RETURN v_node2 + ) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + }) +} diff --git a/spec/regression/collect/tests/collect-edge-count/aql/createEdges.aql b/spec/regression/collect/tests/collect-edge-count/aql/createEdges.aql new file mode 100644 index 000000000..39aa50569 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count/aql/createEdges.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN { + "updateShipment": @v_updateShipment1 +} diff --git a/spec/regression/collect/tests/collect-edge-count/aql/deleteDelivery.aql b/spec/regression/collect/tests/collect-edge-count/aql/deleteDelivery.aql new file mode 100644 index 000000000..0c4de7b96 --- /dev/null +++ b/spec/regression/collect/tests/collect-edge-count/aql/deleteDelivery.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_invoices + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_invoices +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @v_ids1 + REMOVE v_delivery2 + IN @@deliveries + RETURN OLD +)) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +RETURN { + "deleteDelivery": @v_deleteDelivery1 +} diff --git a/spec/regression/collect/tests/collect-edge-count.result.json b/spec/regression/collect/tests/collect-edge-count/result.json similarity index 100% rename from spec/regression/collect/tests/collect-edge-count.result.json rename to spec/regression/collect/tests/collect-edge-count/result.json diff --git a/spec/regression/collect/tests/collect-edge-count.graphql b/spec/regression/collect/tests/collect-edge-count/test.graphql similarity index 81% rename from spec/regression/collect/tests/collect-edge-count.graphql rename to spec/regression/collect/tests/collect-edge-count/test.graphql index 53e6edab1..cb43b572a 100644 --- a/spec/regression/collect/tests/collect-edge-count.graphql +++ b/spec/regression/collect/tests/collect-edge-count/test.graphql @@ -1,6 +1,8 @@ # make sure that counting edges does not include dangling edges # obviously, there should be no dangling edges because we should delete them properly, but this test is probably still # a good idea +# TODO this does not actually test if dangling edges are filtered because deleteDelivery deletes the edges +# if we want to test that, we need an test-data.ts that uses AQL directly mutation createEdges { updateShipment( diff --git a/spec/regression/collect/tests/distinct-aggregation/aql/createEdges.aql b/spec/regression/collect/tests/distinct-aggregation/aql/createEdges.aql new file mode 100644 index 000000000..245d376c4 --- /dev/null +++ b/spec/regression/collect/tests/distinct-aggregation/aql/createEdges.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4}, {_from: CONCAT(@var5, FIRST(@v_updatedIds1)), _to: @var6}, {_from: CONCAT(@var7, FIRST(@v_updatedIds1)), _to: @var8} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/collect/tests/distinct-aggregation/aql/distinct.aql b/spec/regression/collect/tests/distinct-aggregation/aql/distinct.aql new file mode 100644 index 000000000..528508c95 --- /dev/null +++ b/spec/regression/collect/tests/distinct-aggregation/aql/distinct.aql @@ -0,0 +1,31 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allWarehouseSlots": ( + FOR v_warehouseSlot1 + IN ( + FOR v_item1 + IN ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_root1._key != null + RETURN v_root1.`warehouseSlot` + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_warehouseSlot1.`warehouse`) , (v_warehouseSlot1.`level`) + RETURN { + "warehouse": v_warehouseSlot1.`warehouse`, + "level": v_warehouseSlot1.`level` + } + ) + }) +} diff --git a/spec/regression/collect/tests/distinct-aggregation.result.json b/spec/regression/collect/tests/distinct-aggregation/result.json similarity index 100% rename from spec/regression/collect/tests/distinct-aggregation.result.json rename to spec/regression/collect/tests/distinct-aggregation/result.json diff --git a/spec/regression/collect/tests/distinct-aggregation.graphql b/spec/regression/collect/tests/distinct-aggregation/test.graphql similarity index 100% rename from spec/regression/collect/tests/distinct-aggregation.graphql rename to spec/regression/collect/tests/distinct-aggregation/test.graphql diff --git a/spec/regression/collect/tests/field-aggregation/aql/fields.aql b/spec/regression/collect/tests/field-aggregation/aql/fields.aql new file mode 100644 index 000000000..f22556d4f --- /dev/null +++ b/spec/regression/collect/tests/field-aggregation/aql/fields.aql @@ -0,0 +1,140 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "totalWeightInKg": FIRST( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`weightInKg` + FILTER v_item1 != null + COLLECT AGGREGATE v_sum1 = SUM(v_item1) + RETURN v_sum1 != null ? v_sum1 : 0 + ), + "averageWeightInKg": FIRST( + FOR v_item2 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`weightInKg` + FILTER v_item2 != null + COLLECT AGGREGATE v_average1 = AVERAGE(v_item2) + RETURN v_average1 + ), + "minWeightInKg": FIRST( + FOR v_item3 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`weightInKg` + FILTER v_item3 != null + COLLECT AGGREGATE v_min1 = MIN(v_item3) + RETURN v_min1 + ), + "maxWeightInKg": FIRST( + FOR v_item4 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`weightInKg` + FILTER v_item4 != null + COLLECT AGGREGATE v_max1 = MAX(v_item4) + RETURN v_max1 + ), + "allItemNumbers": ( + FOR v_item5 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`itemNumber` + FILTER v_item5 != null + SORT v_item5 + COLLECT v_distinct1 = v_item5 + RETURN v_distinct1 + ), + "itemCount": FIRST( + FOR v_item6 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ), + "hasItems": FIRST( + FOR v_item7 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + COLLECT AGGREGATE v_some1 = COUNT(v_item7) + RETURN v_some1 > 0 + ), + "hasNoItems": FIRST( + FOR v_item8 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + COLLECT AGGREGATE v_none1 = COUNT(v_item8) + RETURN v_none1 == 0 + ), + "hasDangerousGoods": FIRST( + FOR v_item9 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_some_true1 = MAX(v_item9) + RETURN v_some_true1 >= true + ), + "hasNonDangerousGoods": FIRST( + FOR v_item10 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_some_not_true1 = MAX(!v_item10) + RETURN v_some_not_true1 >= true + ), + "hasOnlyDangerousGoods": FIRST( + FOR v_item11 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_every_true1 = MAX(!v_item11) + RETURN v_every_true1 < true + ), + "hasNoDangerousGoods": FIRST( + FOR v_item12 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_none_true1 = MAX(v_item12) + RETURN v_none_true1 < true + ), + "dangerousItemCount": FIRST( + FOR v_item13 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + FILTER v_item13 >= true + COLLECT AGGREGATE v_count_true1 = COUNT(v_item13) + RETURN v_count_true1 + ), + "nonDangerousItemCount": FIRST( + FOR v_item14 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + FILTER v_item14 < true + COLLECT AGGREGATE v_count_not_true1 = COUNT(v_item14) + RETURN v_count_not_true1 + ), + "hasMissingDangerousGoodsFlag": FIRST( + FOR v_item15 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_some_null1 = MAX(v_item15 == null) + RETURN v_some_null1 >= true + ), + "hasSomeDangerousGoodsFlag": FIRST( + FOR v_item16 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_some_not_null1 = MAX(v_item16 != null) + RETURN v_some_not_null1 >= true + ), + "hasAllDangerousGoodsFlags": FIRST( + FOR v_item17 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_none_null1 = MAX(v_item17 == null) + RETURN v_none_null1 < true + ), + "hasNoDangerousGoodsFlag": FIRST( + FOR v_item18 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + COLLECT AGGREGATE v_every_null1 = MAX(v_item18 != null) + RETURN v_every_null1 < true + ), + "missingDangerousGoodsFlagCount": FIRST( + FOR v_item19 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + FILTER v_item19 == null + COLLECT AGGREGATE v_count_null1 = COUNT(v_item19) + RETURN v_count_null1 + ), + "setDangerousGoodsFlagCount": FIRST( + FOR v_item20 + IN v_delivery1.`deliveryContents`[*].`items`[*][**].`isDangerousGoods` + FILTER v_item20 != null + COLLECT AGGREGATE v_count_not_null1 = COUNT(v_item20) + RETURN v_count_not_null1 + ) + } + ) +} diff --git a/spec/regression/collect/tests/field-aggregation.result.json b/spec/regression/collect/tests/field-aggregation/result.json similarity index 100% rename from spec/regression/collect/tests/field-aggregation.result.json rename to spec/regression/collect/tests/field-aggregation/result.json diff --git a/spec/regression/collect/tests/field-aggregation.graphql b/spec/regression/collect/tests/field-aggregation/test.graphql similarity index 100% rename from spec/regression/collect/tests/field-aggregation.graphql rename to spec/regression/collect/tests/field-aggregation/test.graphql diff --git a/spec/regression/collect/tests/field-traversal.graphql b/spec/regression/collect/tests/field-traversal.graphql deleted file mode 100644 index 7e7b707ce..000000000 --- a/spec/regression/collect/tests/field-traversal.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query fields { - Delivery(deliveryNumber: "D1") { - allItems { - itemNumber - } - } -} diff --git a/spec/regression/collect/tests/field-traversal.result.json b/spec/regression/collect/tests/field-traversal.result.json deleted file mode 100644 index 7ebeb8b9d..000000000 --- a/spec/regression/collect/tests/field-traversal.result.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "fields": { - "data": { - "Delivery": { - "allItems": [ - { - "itemNumber": "DI1.1.1" - }, - { - "itemNumber": "DI1.1.2" - }, - { - "itemNumber": "DI1.2.1" - }, - { - "itemNumber": "DI1.2.2" - } - ] - } - } - } -} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN.aql new file mode 100644 index 000000000..bd65061be --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN.aql @@ -0,0 +1,14 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter.aql new file mode 100644 index 000000000..7b96fda50 --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter.aql @@ -0,0 +1,14 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var3)) == @var4) RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order.aql new file mode 100644 index 000000000..a6b7e3de7 --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order.aql @@ -0,0 +1,20 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": ( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + FILTER (RIGHT(v_item1.`itemNumber`, LENGTH(@var3)) == @var4) + SORT (v_item1.`itemNumber`) DESC + RETURN { + "itemNumber": v_item1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order_pagination.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order_pagination.aql new file mode 100644 index 000000000..bd1f54a9f --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_order_pagination.aql @@ -0,0 +1,21 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": ( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + FILTER (RIGHT(v_item1.`itemNumber`, LENGTH(@var3)) == @var4) + SORT (v_item1.`itemNumber`) DESC + LIMIT @var5, @var6 + RETURN { + "itemNumber": v_item1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_pagination.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_pagination.aql new file mode 100644 index 000000000..76d29730e --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_filter_pagination.aql @@ -0,0 +1,14 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var3)) == @var4) LIMIT @var5, @var6 RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order.aql new file mode 100644 index 000000000..29a15b1ee --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": ( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + SORT (v_item1.`itemNumber`) DESC + RETURN { + "itemNumber": v_item1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order_pagination.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order_pagination.aql new file mode 100644 index 000000000..6d7f033a0 --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_order_pagination.aql @@ -0,0 +1,20 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": ( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + SORT (v_item1.`itemNumber`) DESC + LIMIT @var3, @var4 + RETURN { + "itemNumber": v_item1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/field-traversal/aql/fieldsToN_pagination.aql b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_pagination.aql new file mode 100644 index 000000000..a9b5cfd8f --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/aql/fieldsToN_pagination.aql @@ -0,0 +1,14 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** LIMIT @var3, @var4 RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + }) +} diff --git a/spec/regression/collect/tests/field-traversal/result.json b/spec/regression/collect/tests/field-traversal/result.json new file mode 100644 index 000000000..34a41e831 --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/result.json @@ -0,0 +1,114 @@ +{ + "fieldsToN": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.2.2" + } + ] + } + } + }, + "fieldsToN_order": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.2.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.1.1" + } + ] + } + } + }, + "fieldsToN_pagination": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.1.2" + } + ] + } + } + }, + "fieldsToN_order_pagination": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "fieldsToN_filter": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "fieldsToN_filter_order": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.1.1" + } + ] + } + } + }, + "fieldsToN_filter_pagination": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "fieldsToN_filter_order_pagination": { + "data": { + "Delivery": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + } + ] + } + } + } +} diff --git a/spec/regression/collect/tests/field-traversal/test.graphql b/spec/regression/collect/tests/field-traversal/test.graphql new file mode 100644 index 000000000..ca182ae4f --- /dev/null +++ b/spec/regression/collect/tests/field-traversal/test.graphql @@ -0,0 +1,66 @@ +query fieldsToN { + Delivery(deliveryNumber: "D1") { + allItems { + itemNumber + } + } +} + +query fieldsToN_order { + Delivery(deliveryNumber: "D1") { + allItems(orderBy: itemNumber_DESC) { + itemNumber + } + } +} +query fieldsToN_pagination { + Delivery(deliveryNumber: "D1") { + allItems(skip: 1, first: 1) { + itemNumber + } + } +} + +query fieldsToN_order_pagination { + Delivery(deliveryNumber: "D1") { + allItems(orderBy: itemNumber_DESC, skip: 1, first: 1) { + itemNumber + } + } +} + +query fieldsToN_filter { + Delivery(deliveryNumber: "D1") { + allItems(filter: { itemNumber_ends_with: "1" }) { + itemNumber + } + } +} + +query fieldsToN_filter_order { + Delivery(deliveryNumber: "D1") { + allItems(filter: { itemNumber_ends_with: "1" }, orderBy: itemNumber_DESC) { + itemNumber + } + } +} +query fieldsToN_filter_pagination { + Delivery(deliveryNumber: "D1") { + allItems(filter: { itemNumber_ends_with: "1" }, skip: 1, first: 1) { + itemNumber + } + } +} + +query fieldsToN_filter_order_pagination { + Delivery(deliveryNumber: "D1") { + allItems( + filter: { itemNumber_ends_with: "1" } + orderBy: itemNumber_DESC + skip: 1 + first: 1 + ) { + itemNumber + } + } +} diff --git a/spec/regression/collect/tests/input-type-compat/aql/create.aql b/spec/regression/collect/tests/input-type-compat/aql/create.aql new file mode 100644 index 000000000..21c94d2ba --- /dev/null +++ b/spec/regression/collect/tests/input-type-compat/aql/create.aql @@ -0,0 +1,27 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "itemCount": FIRST( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ), + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/collect/tests/input-type-compat/aql/update.aql b/spec/regression/collect/tests/input-type-compat/aql/update.aql new file mode 100644 index 000000000..991d31a8c --- /dev/null +++ b/spec/regression/collect/tests/input-type-compat/aql/update.aql @@ -0,0 +1,38 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "itemCount": FIRST( + FOR v_item1 + IN v_delivery1.`deliveryContents`[*].`items`[*][**] + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ), + "allItems": v_delivery1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/collect/tests/input-type-compat.result.json b/spec/regression/collect/tests/input-type-compat/result.json similarity index 100% rename from spec/regression/collect/tests/input-type-compat.result.json rename to spec/regression/collect/tests/input-type-compat/result.json diff --git a/spec/regression/collect/tests/input-type-compat.graphql b/spec/regression/collect/tests/input-type-compat/test.graphql similarity index 100% rename from spec/regression/collect/tests/input-type-compat.graphql rename to spec/regression/collect/tests/input-type-compat/test.graphql diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/createEdges.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/createEdges.aql new file mode 100644 index 000000000..83d089045 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/createEdges.aql @@ -0,0 +1,388 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])}, {_from: CONCAT(@var5, (@v_newEntityIds1)[@var6]), _to: CONCAT(@var7, (@v_newEntityIds2)[@var8])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])}, {_from: CONCAT(@var5, (@v_newEntityIds1)[@var6]), _to: CONCAT(@var7, (@v_newEntityIds2)[@var8])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2, + "h1": @v_updateHandlingUnit1, + "h2": @v_updateHandlingUnit2, + "h3": @v_updateHandlingUnit3 +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to1.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to1.aql new file mode 100644 index 000000000..2ab0678c2 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to1.aql @@ -0,0 +1,28 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits0to1": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER (v_node2.`accessGroup` IN @var9) + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to2.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to2.aql new file mode 100644 index 000000000..7111c599a --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct0to2.aql @@ -0,0 +1,29 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits0to2": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + PRUNE !((v_node2.`accessGroup` IN @var9)) + FILTER v_path2.vertices[*].`accessGroup` ALL IN @var10 + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to1.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to1.aql new file mode 100644 index 000000000..1a108a9e3 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to1.aql @@ -0,0 +1,28 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits1to1": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER (v_node2.`accessGroup` IN @var9) + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to2.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to2.aql new file mode 100644 index 000000000..26ff3ac7c --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct1to2.aql @@ -0,0 +1,29 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits1to2": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + PRUNE !((v_node2.`accessGroup` IN @var9)) + FILTER v_path2.vertices[*].`accessGroup` ALL IN @var10 + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct2to2.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct2to2.aql new file mode 100644 index 000000000..0dcf37507 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct2to2.aql @@ -0,0 +1,29 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits2to2": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + PRUNE !((v_node2.`accessGroup` IN @var9)) + FILTER v_path2.vertices[*].`accessGroup` ALL IN @var10 + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct3to3.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct3to3.aql new file mode 100644 index 000000000..b1d95a97b --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/direct3to3.aql @@ -0,0 +1,29 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits3to3": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + PRUNE !((v_node2.`accessGroup` IN @var9)) + FILTER v_path2.vertices[*].`accessGroup` ALL IN @var10 + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/indirect.aql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/indirect.aql new file mode 100644 index 000000000..f97978a4d --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal-access-group/aql/indirect.aql @@ -0,0 +1,41 @@ +WITH @@deliveries, @@handlingUnits +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN ( + FOR v_item1 + IN @@shipments + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_shipment2.`shipmentNumber` == @var2) + LIMIT @var3 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_item2 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER (v_node2.`accessGroup` IN @var9) + FOR v_node3, v_edge3, v_path3 IN @var10..@var11 OUTBOUND v_node2 @@handlingUnits_childHandlingUnits + PRUNE !((v_node3.`accessGroup` IN @var12)) + FILTER v_path3.vertices[*].`accessGroup` ALL IN @var13 + FILTER v_node3._key != null + RETURN v_node3 + ) + FILTER v_item2 != null + COLLECT v_distinct1 = v_item2 + RETURN v_distinct1 + ) + SORT (v_handlingUnit1.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group.context.json b/spec/regression/collect/tests/recursive-relation-traversal-access-group/context.json similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal-access-group.context.json rename to spec/regression/collect/tests/recursive-relation-traversal-access-group/context.json diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group.meta.json b/spec/regression/collect/tests/recursive-relation-traversal-access-group/meta.json similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal-access-group.meta.json rename to spec/regression/collect/tests/recursive-relation-traversal-access-group/meta.json diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group.result.json b/spec/regression/collect/tests/recursive-relation-traversal-access-group/result.json similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal-access-group.result.json rename to spec/regression/collect/tests/recursive-relation-traversal-access-group/result.json diff --git a/spec/regression/collect/tests/recursive-relation-traversal-access-group.graphql b/spec/regression/collect/tests/recursive-relation-traversal-access-group/test.graphql similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal-access-group.graphql rename to spec/regression/collect/tests/recursive-relation-traversal-access-group/test.graphql diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/createEdges.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/createEdges.aql new file mode 100644 index 000000000..83d089045 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/createEdges.aql @@ -0,0 +1,388 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])}, {_from: CONCAT(@var5, (@v_newEntityIds1)[@var6]), _to: CONCAT(@var7, (@v_newEntityIds2)[@var8])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])}, {_from: CONCAT(@var5, (@v_newEntityIds1)[@var6]), _to: CONCAT(@var7, (@v_newEntityIds2)[@var8])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2, + "h1": @v_updateHandlingUnit1, + "h2": @v_updateHandlingUnit2, + "h3": @v_updateHandlingUnit3 +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to1.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to1.aql new file mode 100644 index 000000000..7be8469f6 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to1.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits0to1": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to2.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to2.aql new file mode 100644 index 000000000..a6cd29e86 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct0to2.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits0to2": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to1.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to1.aql new file mode 100644 index 000000000..8a8758562 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to1.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits1to1": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to2.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to2.aql new file mode 100644 index 000000000..e3236d253 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct1to2.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits1to2": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct2to2.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct2to2.aql new file mode 100644 index 000000000..af62cf5c2 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct2to2.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits2to2": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/direct3to3.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct3to3.aql new file mode 100644 index 000000000..34969aa66 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/direct3to3.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits3to3": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal/aql/indirect.aql b/spec/regression/collect/tests/recursive-relation-traversal/aql/indirect.aql new file mode 100644 index 000000000..af3ea0eb9 --- /dev/null +++ b/spec/regression/collect/tests/recursive-relation-traversal/aql/indirect.aql @@ -0,0 +1,32 @@ +WITH @@deliveries, @@handlingUnits +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_item1 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_handlingUnits + FOR v_node3, v_edge3, v_path3 IN @var7..@var8 OUTBOUND v_node2 @@handlingUnits_childHandlingUnits + FILTER v_node3._key != null + RETURN v_node3 + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_handlingUnit1.`handlingUnitNumber`) + RETURN { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/recursive-relation-traversal.meta.json b/spec/regression/collect/tests/recursive-relation-traversal/meta.json similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal.meta.json rename to spec/regression/collect/tests/recursive-relation-traversal/meta.json diff --git a/spec/regression/collect/tests/recursive-relation-traversal.result.json b/spec/regression/collect/tests/recursive-relation-traversal/result.json similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal.result.json rename to spec/regression/collect/tests/recursive-relation-traversal/result.json diff --git a/spec/regression/collect/tests/recursive-relation-traversal.graphql b/spec/regression/collect/tests/recursive-relation-traversal/test.graphql similarity index 100% rename from spec/regression/collect/tests/recursive-relation-traversal.graphql rename to spec/regression/collect/tests/recursive-relation-traversal/test.graphql diff --git a/spec/regression/collect/tests/relation-and-field-aggregation/aql/createEdges.aql b/spec/regression/collect/tests/relation-and-field-aggregation/aql/createEdges.aql new file mode 100644 index 000000000..622b27262 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-aggregation/aql/createEdges.aql @@ -0,0 +1,221 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4}, {_from: CONCAT(@var5, FIRST(@v_updatedIds1)), _to: @var6}, {_from: CONCAT(@var7, FIRST(@v_updatedIds1)), _to: @var8} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_order1 + IN @@orders + FILTER (v_order1._key == @var1) + LIMIT @var2 + RETURN v_order1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@orders + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@orders_originalOrder +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +LET v_order1 = DOCUMENT(@@orders, @var1) +RETURN (IS_NULL(v_order1) ? null : { + "orderNumber": v_order1.`orderNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2, + "o1": @v_updateOrder1 +} diff --git a/spec/regression/collect/tests/relation-and-field-aggregation/aql/fields.aql b/spec/regression/collect/tests/relation-and-field-aggregation/aql/fields.aql new file mode 100644 index 000000000..7dd828ff5 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-aggregation/aql/fields.aql @@ -0,0 +1,170 @@ +WITH @@deliveries, @@orders +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "totalWeightInKg": FIRST( + FOR v_item1 + IN ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item2 IN v_root1.`deliveryContents`[*].`items`[*][**].`weightInKg` + RETURN v_item2 + ) + FILTER v_item1 != null + COLLECT AGGREGATE v_sum1 = SUM(v_item1) + RETURN v_sum1 != null ? v_sum1 : 0 + ), + "maxPriority": FIRST( + FOR v_item3 + IN ( + FOR v_root2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + RETURN v_root2.`priority` + ) + FILTER v_item3 != null + COLLECT AGGREGATE v_max1 = MAX(v_item3) + RETURN v_max1 + ), + "itemCount": FIRST( + FOR v_item4 + IN ( + FOR v_root3, v_edge3, v_path3 IN @var7..@var8 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_item5 IN v_root3.`deliveryContents`[*].`items`[*][**] + RETURN v_item5 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ), + "allDeliveriesHaveOrders": FIRST( + FOR v_item6 + IN ( + FOR v_node1, v_edge4, v_path4 IN @var9..@var10 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_node2 = FIRST(FOR v_node3, v_edge5, v_path5 IN @var11..@var12 OUTBOUND v_node1 @@deliveries_order FILTER v_node3._key != NULL RETURN v_node3) + RETURN v_node2 + ) + COLLECT AGGREGATE v_none_null1 = MAX(v_item6 == null) + RETURN v_none_null1 < true + ), + "allDeliveriesHaveOriginalOrders": FIRST( + FOR v_item7 + IN ( + FOR v_node4, v_edge6, v_path6 IN @var13..@var14 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_nullableNode1 = FIRST(FOR v_node5, v_edge7, v_path7 IN @var15..@var16 OUTBOUND v_node4 @@deliveries_order FILTER v_node5._key != NULL RETURN v_node5) + LET v_node6 = FIRST(FOR v_node7, v_edge8, v_path8 IN @var17..@var18 OUTBOUND v_nullableNode1 @@orders_originalOrder FILTER v_node7._key != NULL RETURN v_node7) + RETURN v_node6 + ) + COLLECT AGGREGATE v_none_null2 = MAX(v_item7 == null) + RETURN v_none_null2 < true + ), + "allDeliveriesArePayed": FIRST( + FOR v_item8 + IN ( + FOR v_node8, v_edge9, v_path9 IN @var19..@var20 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_root4 = FIRST(FOR v_node9, v_edge10, v_path10 IN @var21..@var22 OUTBOUND v_node8 @@deliveries_order FILTER v_node9._key != NULL RETURN v_node9) + RETURN v_root4.`payedAt` + ) + COLLECT AGGREGATE v_none_null3 = MAX(v_item8 == null) + RETURN v_none_null3 < true + ), + "allDeliveryLocationIdentCodes": ( + FOR v_item9 + IN ( + FOR v_root5, v_edge11, v_path11 IN @var23..@var24 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root5._key != null + RETURN v_root5.`location`.`identCode` + ) + FILTER v_item9 != null + SORT v_item9 + COLLECT v_distinct1 = v_item9 + RETURN v_distinct1 + ), + "numberOfDeliveriesWithoutOrder": FIRST( + FOR v_item10 + IN ( + FOR v_node10, v_edge12, v_path12 IN @var25..@var26 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_node11 = FIRST(FOR v_node12, v_edge13, v_path13 IN @var27..@var28 OUTBOUND v_node10 @@deliveries_order FILTER v_node12._key != NULL RETURN v_node12) + RETURN v_node11 + ) + FILTER v_item10 == null + COLLECT AGGREGATE v_count_null1 = COUNT(v_item10) + RETURN v_count_null1 + ), + "numberOfDeliveriesWithoutOriginalOrder": FIRST( + FOR v_item11 + IN ( + FOR v_node13, v_edge14, v_path14 IN @var29..@var30 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_nullableNode2 = FIRST(FOR v_node14, v_edge15, v_path15 IN @var31..@var32 OUTBOUND v_node13 @@deliveries_order FILTER v_node14._key != NULL RETURN v_node14) + LET v_node15 = FIRST(FOR v_node16, v_edge16, v_path16 IN @var33..@var34 OUTBOUND v_nullableNode2 @@orders_originalOrder FILTER v_node16._key != NULL RETURN v_node16) + RETURN v_node15 + ) + FILTER v_item11 == null + COLLECT AGGREGATE v_count_null2 = COUNT(v_item11) + RETURN v_count_null2 + ), + "numberOfDeliveriesWithoutPayedOrder": FIRST( + FOR v_item12 + IN ( + FOR v_node17, v_edge17, v_path17 IN @var35..@var36 OUTBOUND v_shipment1 @@shipments_deliveries + LET v_root6 = FIRST(FOR v_node18, v_edge18, v_path18 IN @var37..@var38 OUTBOUND v_node17 @@deliveries_order FILTER v_node18._key != NULL RETURN v_node18) + RETURN v_root6.`payedAt` + ) + FILTER v_item12 == null + COLLECT AGGREGATE v_count_null3 = COUNT(v_item12) + RETURN v_count_null3 + ), + "startedDispatchingAt": FIRST( + FOR v_item13 + IN ( + FOR v_offsetDateTime1 + IN ( + FOR v_root7, v_edge19, v_path19 IN @var39..@var40 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root7._key != null + RETURN v_root7.`dispatchedAt` + ) + RETURN v_offsetDateTime1.`timestamp` + ) + FILTER v_item13 != null + COLLECT AGGREGATE v_min1 = MIN(v_item13) + RETURN v_min1 + ), + "fullyDispatchedAt": FIRST( + FOR v_item14 + IN ( + FOR v_offsetDateTime2 + IN ( + FOR v_root8, v_edge20, v_path20 IN @var41..@var42 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root8._key != null + RETURN v_root8.`dispatchedAt` + ) + RETURN v_offsetDateTime2.`timestamp` + ) + FILTER v_item14 != null + COLLECT AGGREGATE v_max2 = MAX(v_item14) + RETURN v_max2 + ), + "allOrders": ( + FOR v_order1 + IN ( + FOR v_item15 + IN ( + FOR v_node19, v_edge21, v_path21 IN @var43..@var44 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node20, v_edge22, v_path22 IN @var45..@var46 OUTBOUND v_node19 @@deliveries_order + RETURN v_node20 + ) + FILTER v_item15 != null + COLLECT v_distinct2 = v_item15 + RETURN v_distinct2 + ) + SORT (v_order1.`orderNumber`) + RETURN { + "orderNumber": v_order1.`orderNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-aggregation.result.json b/spec/regression/collect/tests/relation-and-field-aggregation/result.json similarity index 78% rename from spec/regression/collect/tests/relation-and-field-aggregation.result.json rename to spec/regression/collect/tests/relation-and-field-aggregation/result.json index a526b3e5d..877f40a31 100644 --- a/spec/regression/collect/tests/relation-and-field-aggregation.result.json +++ b/spec/regression/collect/tests/relation-and-field-aggregation/result.json @@ -9,6 +9,9 @@ }, "d2": { "deliveryNumber": "D2" + }, + "o1": { + "orderNumber": "O1" } } }, @@ -19,8 +22,11 @@ "maxPriority": 3, "itemCount": 8, "allDeliveriesHaveOrders": false, + "allDeliveriesHaveOriginalOrders": false, "allDeliveriesArePayed": false, + "allDeliveryLocationIdentCodes": ["licD1", "licD2", "licD5"], "numberOfDeliveriesWithoutOrder": 2, + "numberOfDeliveriesWithoutOriginalOrder": 3, "numberOfDeliveriesWithoutPayedOrder": 3, "startedDispatchingAt": "2020-01-30T08:00:00Z", "fullyDispatchedAt": "2020-01-30T09:00:00Z", diff --git a/spec/regression/collect/tests/relation-and-field-aggregation.graphql b/spec/regression/collect/tests/relation-and-field-aggregation/test.graphql similarity index 80% rename from spec/regression/collect/tests/relation-and-field-aggregation.graphql rename to spec/regression/collect/tests/relation-and-field-aggregation/test.graphql index 6738f61d7..87ee0824e 100644 --- a/spec/regression/collect/tests/relation-and-field-aggregation.graphql +++ b/spec/regression/collect/tests/relation-and-field-aggregation/test.graphql @@ -18,6 +18,9 @@ mutation createEdges { d2: updateDelivery(input: { id: "@{ids/Delivery/2}", order: "@{ids/Order/2}" }) { deliveryNumber } + o1: updateOrder(input: { id: "@{ids/Order/1}", originalOrder: "@{ids/Order/2}" }) { + orderNumber + } } query fields { Shipment(shipmentNumber: "S1") { @@ -25,8 +28,11 @@ query fields { maxPriority itemCount allDeliveriesHaveOrders + allDeliveriesHaveOriginalOrders allDeliveriesArePayed + allDeliveryLocationIdentCodes numberOfDeliveriesWithoutOrder + numberOfDeliveriesWithoutOriginalOrder numberOfDeliveriesWithoutPayedOrder startedDispatchingAt fullyDispatchedAt diff --git a/spec/regression/collect/tests/relation-and-field-traversal.graphql b/spec/regression/collect/tests/relation-and-field-traversal.graphql deleted file mode 100644 index 4cfdf2182..000000000 --- a/spec/regression/collect/tests/relation-and-field-traversal.graphql +++ /dev/null @@ -1,32 +0,0 @@ -mutation createEdges { - updateShipment( - input: { - id: "@{ids/Shipment/1}" - addDeliveries: ["@{ids/Delivery/1}", "@{ids/Delivery/2}"] - } - ) { - shipmentNumber - } - updateOrder(input: { id: "@{ids/Order/1}", delivery: "@{ids/Delivery/1}" }) { - orderNumber - } -} - -query relationToNAndFields { - Shipment(shipmentNumber: "S1") { - allItems(orderBy: itemNumber_ASC) { - itemNumber - } - allDeliveryContents(orderBy: deliveryContentNumber_ASC) { - deliveryContentNumber - } - } -} - -query relationTo1AndFields { - Order(orderNumber: "O1") { - allItems(orderBy: itemNumber_ASC) { - itemNumber - } - } -} diff --git a/spec/regression/collect/tests/relation-and-field-traversal.result.json b/spec/regression/collect/tests/relation-and-field-traversal.result.json deleted file mode 100644 index 8c66f0d8b..000000000 --- a/spec/regression/collect/tests/relation-and-field-traversal.result.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "createEdges": { - "data": { - "updateShipment": { - "shipmentNumber": "S1" - }, - "updateOrder": { - "orderNumber": "O1" - } - } - }, - "relationToNAndFields": { - "data": { - "Shipment": { - "allItems": [ - { - "itemNumber": "DI1.1.1" - }, - { - "itemNumber": "DI1.1.2" - }, - { - "itemNumber": "DI1.2.1" - }, - { - "itemNumber": "DI1.2.2" - }, - { - "itemNumber": "DI2.1.1" - }, - { - "itemNumber": "DI2.1.2" - }, - { - "itemNumber": "DI2.2.1" - }, - { - "itemNumber": "DI2.2.2" - } - ], - "allDeliveryContents": [ - { - "deliveryContentNumber": "DC1.1" - }, - { - "deliveryContentNumber": "DC1.2" - }, - { - "deliveryContentNumber": "DC2.1" - }, - { - "deliveryContentNumber": "DC2.2" - } - ] - } - } - }, - "relationTo1AndFields": { - "data": { - "Order": { - "allItems": [ - { - "itemNumber": "DI1.1.1" - }, - { - "itemNumber": "DI1.1.2" - }, - { - "itemNumber": "DI1.2.1" - }, - { - "itemNumber": "DI1.2.2" - } - ] - } - } - } -} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/createEdges.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/createEdges.aql new file mode 100644 index 000000000..785d62f1a --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/createEdges.aql @@ -0,0 +1,115 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_order1 + IN @@orders + FILTER (v_order1._key == @var1) + LIMIT @var2 + RETURN v_order1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@orders + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_from1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +LET v_order1 = DOCUMENT(@@orders, @var1) +RETURN (IS_NULL(v_order1) ? null : { + "orderNumber": v_order1.`orderNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@orders +RETURN { + "updateShipment": @v_updateShipment1, + "updateOrder": @v_updateOrder1 +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN.aql new file mode 100644 index 000000000..90a931520 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN.aql @@ -0,0 +1,19 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + RETURN v_item1 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter.aql new file mode 100644 index 000000000..2d0fe41f3 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter.aql @@ -0,0 +1,19 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + RETURN v_item1 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order.aql new file mode 100644 index 000000000..2ed6477fd --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order_pagination.aql new file mode 100644 index 000000000..f01e5c6ec --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_order_pagination.aql @@ -0,0 +1,26 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + LIMIT @var7, @var8 + RETURN v_item1.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_pagination.aql new file mode 100644 index 000000000..9a32705bf --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_filter_pagination.aql @@ -0,0 +1,19 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) LIMIT @var7, @var8 RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + RETURN v_item1 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order.aql new file mode 100644 index 000000000..aa5c4e5bd --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order_pagination.aql new file mode 100644 index 000000000..c90903415 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_order_pagination.aql @@ -0,0 +1,26 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + LIMIT @var5, @var6 + RETURN v_item1.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_pagination.aql new file mode 100644 index 000000000..c90903415 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationTo1_fieldsToN_pagination.aql @@ -0,0 +1,26 @@ +WITH @@deliveries +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + LIMIT @var5, @var6 + RETURN v_item1.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN.aql new file mode 100644 index 000000000..ab98f0ad2 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN.aql @@ -0,0 +1,28 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + RETURN v_item1 + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* RETURN { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }] + RETURN v_item2 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter.aql new file mode 100644 index 000000000..7142e41a0 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter.aql @@ -0,0 +1,28 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + RETURN v_item1 + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* FILTER (RIGHT(CURRENT.`deliveryContentNumber`, LENGTH(@var9)) == @var10) RETURN { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }] + RETURN v_item2 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order.aql new file mode 100644 index 000000000..543fcc6f8 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order.aql @@ -0,0 +1,40 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* FILTER (RIGHT(CURRENT.`deliveryContentNumber`, LENGTH(@var9)) == @var10) RETURN { + value: { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }, + sortValues: [ + CURRENT.`deliveryContentNumber` + ] + }] + SORT v_item2.sortValues[0] + RETURN v_item2.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order_pagination.aql new file mode 100644 index 000000000..217454e41 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_order_pagination.aql @@ -0,0 +1,42 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + LIMIT @var7, @var8 + RETURN v_item1.value + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var9..@var10 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* FILTER (RIGHT(CURRENT.`deliveryContentNumber`, LENGTH(@var11)) == @var12) RETURN { + value: { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }, + sortValues: [ + CURRENT.`deliveryContentNumber` + ] + }] + SORT v_item2.sortValues[0] + LIMIT @var13, @var14 + RETURN v_item2.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_pagination.aql new file mode 100644 index 000000000..44496fe06 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_filter_pagination.aql @@ -0,0 +1,30 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** FILTER (RIGHT(CURRENT.`itemNumber`, LENGTH(@var5)) == @var6) RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + LIMIT @var7, @var8 + RETURN v_item1 + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var9..@var10 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* FILTER (RIGHT(CURRENT.`deliveryContentNumber`, LENGTH(@var11)) == @var12) RETURN { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }] + LIMIT @var13, @var14 + RETURN v_item2 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order.aql new file mode 100644 index 000000000..57e0e69a7 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order.aql @@ -0,0 +1,40 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* RETURN { + value: { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }, + sortValues: [ + CURRENT.`deliveryContentNumber` + ] + }] + SORT v_item2.sortValues[0] + RETURN v_item2.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order_pagination.aql new file mode 100644 index 000000000..d97995881 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_order_pagination.aql @@ -0,0 +1,42 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + LIMIT @var5, @var6 + RETURN v_item1.value + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* RETURN { + value: { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }, + sortValues: [ + CURRENT.`deliveryContentNumber` + ] + }] + SORT v_item2.sortValues[0] + LIMIT @var9, @var10 + RETURN v_item2.value + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_pagination.aql b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_pagination.aql new file mode 100644 index 000000000..797bc7e8d --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/aql/relationToN_fieldsToN_pagination.aql @@ -0,0 +1,30 @@ +WITH @@deliveries +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allItems": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[*][** RETURN { + "itemNumber": CURRENT.`itemNumber` + }] + LIMIT @var5, @var6 + RETURN v_item1 + ), + "allDeliveryContents": ( + FOR v_root2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER v_root2._key != null + FOR v_item2 IN v_root2.`deliveryContents`[* RETURN { + "deliveryContentNumber": CURRENT.`deliveryContentNumber` + }] + LIMIT @var9, @var10 + RETURN v_item2 + ) + }) +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/result.json b/spec/regression/collect/tests/relation-and-field-traversal/result.json new file mode 100644 index 000000000..58bc27207 --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/result.json @@ -0,0 +1,336 @@ +{ + "createEdges": { + "data": { + "updateShipment": { + "shipmentNumber": "S1" + }, + "updateOrder": { + "orderNumber": "O1" + } + } + }, + "relationToN_fieldsToN": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI2.1.1" + }, + { + "itemNumber": "DI2.1.2" + }, + { + "itemNumber": "DI2.2.1" + }, + { + "itemNumber": "DI2.2.2" + }, + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.2.2" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC2.1" + }, + { + "deliveryContentNumber": "DC2.2" + }, + { + "deliveryContentNumber": "DC1.1" + }, + { + "deliveryContentNumber": "DC1.2" + } + ] + } + } + }, + "relationTo1_fieldsToN": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.2.2" + } + ] + } + } + }, + "relationToN_fieldsToN_order": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.2.2" + }, + { + "itemNumber": "DI2.1.1" + }, + { + "itemNumber": "DI2.1.2" + }, + { + "itemNumber": "DI2.2.1" + }, + { + "itemNumber": "DI2.2.2" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC1.1" + }, + { + "deliveryContentNumber": "DC1.2" + }, + { + "deliveryContentNumber": "DC2.1" + }, + { + "deliveryContentNumber": "DC2.2" + } + ] + } + } + }, + "relationTo1_fieldsToN_order": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.1.2" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI1.2.2" + } + ] + } + } + }, + "relationToN_fieldsToN_order_pagination": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI1.1.2" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC1.2" + } + ] + } + } + }, + "relationTo1_fieldsToN_order_pagination": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.2" + } + ] + } + } + }, + "relationToN_fieldsToN_pagination": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI2.1.2" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC2.2" + } + ] + } + } + }, + "relationTo1_fieldsToN_pagination": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.2" + } + ] + } + } + }, + "relationToN_fieldsToN_filter": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI2.1.1" + }, + { + "itemNumber": "DI2.2.1" + }, + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.2.1" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC2.1" + }, + { + "deliveryContentNumber": "DC1.1" + } + ] + } + } + }, + "relationTo1_fieldsToN_filter": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "relationToN_fieldsToN_filter_order": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.2.1" + }, + { + "itemNumber": "DI2.1.1" + }, + { + "itemNumber": "DI2.2.1" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC1.1" + }, + { + "deliveryContentNumber": "DC2.1" + } + ] + } + } + }, + "relationTo1_fieldsToN_filter_order": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.1.1" + }, + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "relationToN_fieldsToN_filter_pagination": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI2.2.1" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC1.1" + } + ] + } + } + }, + "relationTo1_fieldsToN_filter_pagination": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + } + ] + } + } + }, + "relationToN_fieldsToN_filter_order_pagination": { + "data": { + "Shipment": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + } + ], + "allDeliveryContents": [ + { + "deliveryContentNumber": "DC2.1" + } + ] + } + } + }, + "relationTo1_fieldsToN_filter_order_pagination": { + "data": { + "Order": { + "allItems": [ + { + "itemNumber": "DI1.2.1" + } + ] + } + } + } +} diff --git a/spec/regression/collect/tests/relation-and-field-traversal/test.graphql b/spec/regression/collect/tests/relation-and-field-traversal/test.graphql new file mode 100644 index 000000000..fcf354b4f --- /dev/null +++ b/spec/regression/collect/tests/relation-and-field-traversal/test.graphql @@ -0,0 +1,183 @@ +mutation createEdges { + updateShipment( + input: { + id: "@{ids/Shipment/1}" + addDeliveries: ["@{ids/Delivery/1}", "@{ids/Delivery/2}"] + } + ) { + shipmentNumber + } + updateOrder(input: { id: "@{ids/Order/1}", delivery: "@{ids/Delivery/1}" }) { + orderNumber + } +} + +query relationToN_fieldsToN { + Shipment(shipmentNumber: "S1") { + allItems { + itemNumber + } + allDeliveryContents { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN { + Order(orderNumber: "O1") { + allItems { + itemNumber + } + } +} + +query relationToN_fieldsToN_order { + Shipment(shipmentNumber: "S1") { + allItems(orderBy: itemNumber_ASC) { + itemNumber + } + allDeliveryContents(orderBy: deliveryContentNumber_ASC) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_order { + Order(orderNumber: "O1") { + allItems(orderBy: itemNumber_ASC) { + itemNumber + } + } +} + +query relationToN_fieldsToN_order_pagination { + Shipment(shipmentNumber: "S1") { + allItems(orderBy: itemNumber_ASC, skip: 1, first: 1) { + itemNumber + } + allDeliveryContents(orderBy: deliveryContentNumber_ASC, skip: 1, first: 1) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_order_pagination { + Order(orderNumber: "O1") { + allItems(orderBy: itemNumber_ASC, skip: 1, first: 1) { + itemNumber + } + } +} + +query relationToN_fieldsToN_pagination { + Shipment(shipmentNumber: "S1") { + allItems(skip: 1, first: 1) { + itemNumber + } + allDeliveryContents(skip: 1, first: 1) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_pagination { + Order(orderNumber: "O1") { + allItems(orderBy: itemNumber_ASC, skip: 1, first: 1) { + itemNumber + } + } +} + +query relationToN_fieldsToN_filter { + Shipment(shipmentNumber: "S1") { + allItems(filter: { itemNumber_ends_with: "1" }) { + itemNumber + } + allDeliveryContents(filter: { deliveryContentNumber_ends_with: "1" }) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_filter { + Order(orderNumber: "O1") { + allItems(filter: { itemNumber_ends_with: "1" }) { + itemNumber + } + } +} + +query relationToN_fieldsToN_filter_order { + Shipment(shipmentNumber: "S1") { + allItems(filter: { itemNumber_ends_with: "1" }, orderBy: itemNumber_ASC) { + itemNumber + } + allDeliveryContents( + filter: { deliveryContentNumber_ends_with: "1" } + orderBy: deliveryContentNumber_ASC + ) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_filter_order { + Order(orderNumber: "O1") { + allItems(filter: { itemNumber_ends_with: "1" }, orderBy: itemNumber_ASC) { + itemNumber + } + } +} + +query relationToN_fieldsToN_filter_pagination { + Shipment(shipmentNumber: "S1") { + allItems(filter: { itemNumber_ends_with: "1" }, skip: 1, first: 1) { + itemNumber + } + allDeliveryContents(filter: { deliveryContentNumber_ends_with: "1" }, skip: 1, first: 1) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_filter_pagination { + Order(orderNumber: "O1") { + allItems(filter: { itemNumber_ends_with: "1" }, skip: 1, first: 1) { + itemNumber + } + } +} + +query relationToN_fieldsToN_filter_order_pagination { + Shipment(shipmentNumber: "S1") { + allItems( + filter: { itemNumber_ends_with: "1" } + orderBy: itemNumber_ASC + skip: 1 + first: 1 + ) { + itemNumber + } + allDeliveryContents( + filter: { deliveryContentNumber_ends_with: "1" } + orderBy: deliveryContentNumber_ASC + skip: 1 + first: 1 + ) { + deliveryContentNumber + } + } +} + +query relationTo1_fieldsToN_filter_order_pagination { + Order(orderNumber: "O1") { + allItems( + filter: { itemNumber_ends_with: "1" } + orderBy: itemNumber_ASC + skip: 1 + first: 1 + ) { + itemNumber + } + } +} diff --git a/spec/regression/collect/tests/relation-traversal-access-field/aql/createEdges.aql b/spec/regression/collect/tests/relation-traversal-access-field/aql/createEdges.aql new file mode 100644 index 000000000..b837e0f3d --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-field/aql/createEdges.aql @@ -0,0 +1,242 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@handlingUnits, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@handlingUnits_childHandlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@handlingUnits_childHandlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@handlingUnits_childHandlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@handlingUnits_childHandlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "handlingUnitNumber": v_handlingUnit1.`handlingUnitNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@orders, @@deliveries +RETURN { + "d1": @v_updateDelivery1, + "h1": @v_updateHandlingUnit1, + "h2": @v_updateHandlingUnit2, + "h3": @v_updateHandlingUnit3 +} diff --git a/spec/regression/collect/tests/relation-traversal-access-field/aql/queryAll.aql b/spec/regression/collect/tests/relation-traversal-access-field/aql/queryAll.aql new file mode 100644 index 000000000..8a9114db4 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-field/aql/queryAll.aql @@ -0,0 +1,21 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "number": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-field/aql/queryRestricted.aql b/spec/regression/collect/tests/relation-traversal-access-field/aql/queryRestricted.aql new file mode 100644 index 000000000..28207f329 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-field/aql/queryRestricted.aql @@ -0,0 +1,29 @@ +WITH @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN ( + FOR v_item1 + IN @@deliveries + FILTER (v_item1.`location`.`identCode` IN @var1) + RETURN v_item1 + ) + FILTER (v_delivery2.`deliveryNumber` == @var2) + LIMIT @var3 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "allHandlingUnits": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER (v_node1.`location`.`identCode` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@handlingUnits_childHandlingUnits + PRUNE !((v_node2.`location`.`identCode` IN @var9)) + FILTER v_path2.vertices[*].`location`.`identCode` ALL IN @var10 + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "number": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-field.context.json b/spec/regression/collect/tests/relation-traversal-access-field/context.json similarity index 100% rename from spec/regression/collect/tests/relation-traversal-access-field.context.json rename to spec/regression/collect/tests/relation-traversal-access-field/context.json diff --git a/spec/regression/collect/tests/relation-traversal-access-field.meta.json b/spec/regression/collect/tests/relation-traversal-access-field/meta.json similarity index 100% rename from spec/regression/collect/tests/relation-traversal-access-field.meta.json rename to spec/regression/collect/tests/relation-traversal-access-field/meta.json diff --git a/spec/regression/collect/tests/relation-traversal-access-field.result.json b/spec/regression/collect/tests/relation-traversal-access-field/result.json similarity index 73% rename from spec/regression/collect/tests/relation-traversal-access-field.result.json rename to spec/regression/collect/tests/relation-traversal-access-field/result.json index dc4c2ae62..f7ede67a0 100644 --- a/spec/regression/collect/tests/relation-traversal-access-field.result.json +++ b/spec/regression/collect/tests/relation-traversal-access-field/result.json @@ -20,16 +20,16 @@ "Delivery": { "allHandlingUnits": [ { - "handlingUnitNumber": "H1" + "number": "H1" }, { - "handlingUnitNumber": "H2" + "number": "H2" }, { - "handlingUnitNumber": "H3" + "number": "H3" }, { - "handlingUnitNumber": "H4" + "number": "H4" } ] } @@ -40,10 +40,10 @@ "Delivery": { "allHandlingUnits": [ { - "handlingUnitNumber": "H1" + "number": "H1" }, { - "handlingUnitNumber": "H4" + "number": "H4" } ] } diff --git a/spec/regression/collect/tests/relation-traversal-access-field.graphql b/spec/regression/collect/tests/relation-traversal-access-field/test.graphql similarity index 88% rename from spec/regression/collect/tests/relation-traversal-access-field.graphql rename to spec/regression/collect/tests/relation-traversal-access-field/test.graphql index 3af37b678..31afd4176 100644 --- a/spec/regression/collect/tests/relation-traversal-access-field.graphql +++ b/spec/regression/collect/tests/relation-traversal-access-field/test.graphql @@ -25,10 +25,12 @@ mutation createEdges { } } +# we have aliases here to ensure the mapping actually happens + query queryAll { Delivery(deliveryNumber: "D1") { allHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber } } } @@ -36,7 +38,7 @@ query queryAll { query queryRestricted { Delivery(deliveryNumber: "D1") { allHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber } } } diff --git a/spec/regression/collect/tests/relation-traversal-access-group/aql/createEdges.aql b/spec/regression/collect/tests/relation-traversal-access-group/aql/createEdges.aql new file mode 100644 index 000000000..1411ef803 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-group/aql/createEdges.aql @@ -0,0 +1,212 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2 +} diff --git a/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1to1_ntoN.aql b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1to1_ntoN.aql new file mode 100644 index 000000000..3e219f715 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1to1_ntoN.aql @@ -0,0 +1,28 @@ +WITH @@deliveries, @@handlingUnits +LET v_order1 = FIRST(( + FOR v_order2 + IN ( + FOR v_item1 + IN @@orders + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_order2.`orderNumber` == @var2) + LIMIT @var3 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allOuterHandlingUnits": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 INBOUND v_order1 @@deliveries_order + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER (v_node2.`accessGroup` IN @var9) + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "number": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1ToN.aql b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1ToN.aql new file mode 100644 index 000000000..fb1f861fd --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1ToN.aql @@ -0,0 +1,28 @@ +WITH @@deliveries, @@invoices +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN ( + FOR v_item1 + IN @@shipments + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_shipment2.`shipmentNumber` == @var2) + LIMIT @var3 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allInvoices": ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@deliveries_invoices + FILTER (v_node2.`accessGroup` IN @var9) + FILTER v_node2._key != null + SORT (v_node2.`invoiceNumber`) + RETURN { + "number": v_node2.`invoiceNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1to1.aql b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1to1.aql new file mode 100644 index 000000000..035b2c10f --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_1to1.aql @@ -0,0 +1,37 @@ +WITH @@deliveries, @@orders +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN ( + FOR v_item1 + IN @@shipments + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_shipment2.`shipmentNumber` == @var2) + LIMIT @var3 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOrders": ( + FOR v_order1 + IN ( + FOR v_item2 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@deliveries_order + FILTER (v_node2.`accessGroup` IN @var9) + RETURN v_node2 + ) + FILTER v_item2 != null + COLLECT v_distinct1 = v_item2 + RETURN v_distinct1 + ) + SORT (v_order1.`orderNumber`) + RETURN { + "number": v_order1.`orderNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_nToN.aql b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_nToN.aql new file mode 100644 index 000000000..77cc59088 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-access-group/aql/to_1toN_nToN.aql @@ -0,0 +1,38 @@ +WITH @@deliveries, @@handlingUnits +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN ( + FOR v_item1 + IN @@shipments + FILTER (v_item1.`accessGroup` IN @var1) + RETURN v_item1 + ) + FILTER (v_shipment2.`shipmentNumber` == @var2) + LIMIT @var3 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOuterHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_item2 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var4..@var5 OUTBOUND v_shipment1 @@shipments_deliveries + FILTER (v_node1.`accessGroup` IN @var6) + FOR v_node2, v_edge2, v_path2 IN @var7..@var8 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER (v_node2.`accessGroup` IN @var9) + FILTER v_node2._key != null + RETURN v_node2 + ) + FILTER v_item2 != null + COLLECT v_distinct1 = v_item2 + RETURN v_distinct1 + ) + SORT (v_handlingUnit1.`handlingUnitNumber`) + RETURN { + "number": v_handlingUnit1.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-access-group.context.json b/spec/regression/collect/tests/relation-traversal-access-group/context.json similarity index 100% rename from spec/regression/collect/tests/relation-traversal-access-group.context.json rename to spec/regression/collect/tests/relation-traversal-access-group/context.json diff --git a/spec/regression/collect/tests/relation-traversal-access-group.meta.json b/spec/regression/collect/tests/relation-traversal-access-group/meta.json similarity index 100% rename from spec/regression/collect/tests/relation-traversal-access-group.meta.json rename to spec/regression/collect/tests/relation-traversal-access-group/meta.json diff --git a/spec/regression/collect/tests/relation-traversal-access-group.result.json b/spec/regression/collect/tests/relation-traversal-access-group/result.json similarity index 67% rename from spec/regression/collect/tests/relation-traversal-access-group.result.json rename to spec/regression/collect/tests/relation-traversal-access-group/result.json index 0374d8b7b..9fca05728 100644 --- a/spec/regression/collect/tests/relation-traversal-access-group.result.json +++ b/spec/regression/collect/tests/relation-traversal-access-group/result.json @@ -12,37 +12,38 @@ } } }, - "toNtoN": { + "to_1toN_nToN": { "data": { "Shipment": { "allOuterHandlingUnits": [ { - "handlingUnitNumber": "H3" + "number": "H3" } ] } } }, - "toNto1": { + "to_1toN_1ToN": { "data": { "Shipment": { - "allOrders": [ - { - "orderNumber": "O2" - } - ] + "allInvoices": [] } } }, - "to1toN": { + "to_1toN_1to1": { "data": { - "Order": { - "allOuterHandlingUnits": [ + "Shipment": { + "allOrders": [ { - "handlingUnitNumber": "H3" + "number": "O2" } ] } } + }, + "to_1to1_ntoN": { + "data": { + "Order": null + } } } diff --git a/spec/regression/collect/tests/relation-traversal-access-group.graphql b/spec/regression/collect/tests/relation-traversal-access-group/test.graphql similarity index 70% rename from spec/regression/collect/tests/relation-traversal-access-group.graphql rename to spec/regression/collect/tests/relation-traversal-access-group/test.graphql index 105c17b5c..772bc0556 100644 --- a/spec/regression/collect/tests/relation-traversal-access-group.graphql +++ b/spec/regression/collect/tests/relation-traversal-access-group/test.graphql @@ -27,26 +27,36 @@ mutation createEdges { } } -query toNtoN { +# we have aliases here to ensure the mapping actually happens + +query to_1toN_nToN { Shipment(shipmentNumber: "S1") { allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber + } + } +} + +query to_1toN_1ToN { + Shipment(shipmentNumber: "S1") { + allInvoices(orderBy: invoiceNumber_ASC) { + number: invoiceNumber } } } -query toNto1 { +query to_1toN_1to1 { Shipment(shipmentNumber: "S1") { allOrders(orderBy: orderNumber_ASC) { - orderNumber + number: orderNumber } } } -query to1toN { - Order(orderNumber: "O2") { +query to_1to1_ntoN { + Order(orderNumber: "O1") { allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber } } } diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/aql/createEdges.aql b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/createEdges.aql new file mode 100644 index 000000000..56811cc8b --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/createEdges.aql @@ -0,0 +1,276 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4}, {_from: CONCAT(@var5, FIRST(@v_updatedIds1)), _to: @var6} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_invoices + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_invoices + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2 +} diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1to1_ntoN.aql b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1to1_ntoN.aql new file mode 100644 index 000000000..943d87837 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1to1_ntoN.aql @@ -0,0 +1,22 @@ +WITH @@deliveries, @@handlingUnits +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allOuterHandlingUnits": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + LIMIT @var7, @var8 + RETURN { + "number": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1ToN.aql b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1ToN.aql new file mode 100644 index 000000000..717d8e882 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1ToN.aql @@ -0,0 +1,22 @@ +WITH @@deliveries, @@invoices +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allInvoices": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_invoices + FILTER v_node2._key != null + SORT (v_node2.`invoiceNumber`) + LIMIT @var7, @var8 + RETURN { + "number": v_node2.`invoiceNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1to1.aql b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1to1.aql new file mode 100644 index 000000000..b81a88c0b --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_1to1.aql @@ -0,0 +1,31 @@ +WITH @@deliveries, @@orders +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOrders": ( + FOR v_order1 + IN ( + FOR v_item1 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_order + RETURN v_node2 + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_order1.`orderNumber`) + LIMIT @var7, @var8 + RETURN { + "number": v_order1.`orderNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_nToN.aql b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_nToN.aql new file mode 100644 index 000000000..ba0682a91 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/aql/to_1toN_nToN.aql @@ -0,0 +1,32 @@ +WITH @@deliveries, @@handlingUnits +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOuterHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_item1 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_handlingUnit1.`handlingUnitNumber`) + LIMIT @var7, @var8 + RETURN { + "number": v_handlingUnit1.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal.result.json b/spec/regression/collect/tests/relation-traversal-with-pagination/result.json similarity index 59% rename from spec/regression/collect/tests/relation-traversal.result.json rename to spec/regression/collect/tests/relation-traversal-with-pagination/result.json index f1606c6fb..7760efa44 100644 --- a/spec/regression/collect/tests/relation-traversal.result.json +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/result.json @@ -12,46 +12,45 @@ } } }, - "toNtoN": { + "to_1toN_nToN": { "data": { "Shipment": { "allOuterHandlingUnits": [ { - "handlingUnitNumber": "H1" - }, - { - "handlingUnitNumber": "H2" - }, + "number": "H2" + } + ] + } + } + }, + "to_1toN_1ToN": { + "data": { + "Shipment": { + "allInvoices": [ { - "handlingUnitNumber": "H3" + "number": "I3" } ] } } }, - "toNto1": { + "to_1toN_1to1": { "data": { "Shipment": { "allOrders": [ { - "orderNumber": "O1" - }, - { - "orderNumber": "O2" + "number": "O2" } ] } } }, - "to1toN": { + "to_1to1_ntoN": { "data": { "Order": { "allOuterHandlingUnits": [ { - "handlingUnitNumber": "H1" - }, - { - "handlingUnitNumber": "H2" + "number": "H2" } ] } diff --git a/spec/regression/collect/tests/relation-traversal-with-pagination/test.graphql b/spec/regression/collect/tests/relation-traversal-with-pagination/test.graphql new file mode 100644 index 000000000..431882b20 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal-with-pagination/test.graphql @@ -0,0 +1,68 @@ +mutation createEdges { + updateShipment( + input: { + id: "@{ids/Shipment/1}" + addDeliveries: ["@{ids/Delivery/1}", "@{ids/Delivery/2}"] + } + ) { + shipmentNumber + } + d1: updateDelivery( + input: { + id: "@{ids/Delivery/1}" + addHandlingUnits: [ + "@{ids/HandlingUnit/1}" + "@{ids/HandlingUnit/2}" + "@{ids/HandlingUnit/4}" + ] + order: "@{ids/Order/1}" + addInvoices: ["@{ids/Invoice/1}", "@{ids/Invoice/5}"] + } + ) { + deliveryNumber + } + d2: updateDelivery( + input: { + id: "@{ids/Delivery/2}" + addHandlingUnits: ["@{ids/HandlingUnit/3}"] + order: "@{ids/Order/2}" + addInvoices: ["@{ids/Invoice/3}", "@{ids/Invoice/6}"] + } + ) { + deliveryNumber + } +} + +# we have aliases here to ensure the mapping actually happens + +query to_1toN_nToN { + Shipment(shipmentNumber: "S1") { + allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC, skip: 1, first: 1) { + number: handlingUnitNumber + } + } +} + +query to_1toN_1ToN { + Shipment(shipmentNumber: "S1") { + allInvoices(orderBy: invoiceNumber_ASC, skip: 1, first: 1) { + number: invoiceNumber + } + } +} + +query to_1toN_1to1 { + Shipment(shipmentNumber: "S1") { + allOrders(orderBy: orderNumber_ASC, skip: 1, first: 1) { + number: orderNumber + } + } +} + +query to_1to1_ntoN { + Order(orderNumber: "O1") { + allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC, skip: 1, first: 1) { + number: handlingUnitNumber + } + } +} diff --git a/spec/regression/collect/tests/relation-traversal/aql/createEdges.aql b/spec/regression/collect/tests/relation-traversal/aql/createEdges.aql new file mode 100644 index 000000000..56811cc8b --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/aql/createEdges.aql @@ -0,0 +1,276 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_shipment1 + IN @@shipments + FILTER (v_shipment1._key == @var1) + LIMIT @var2 + RETURN v_shipment1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@shipments + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@shipments_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@shipments_deliveries +) + +// -------------------------------- + +WITH @@deliveries, @@shipments +LET v_shipment1 = DOCUMENT(@@shipments, @var1) +RETURN (IS_NULL(v_shipment1) ? null : { + "shipmentNumber": v_shipment1.`shipmentNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4}, {_from: CONCAT(@var5, FIRST(@v_updatedIds1)), _to: @var6} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_invoices + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@orders, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@deliveries_order + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@deliveries_order +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN DOCUMENT(@@invoices, @var1) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_invoices + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_invoices +) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@shipments, @@handlingUnits, @@orders, @@invoices +RETURN { + "updateShipment": @v_updateShipment1, + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2 +} diff --git a/spec/regression/collect/tests/relation-traversal/aql/to_1to1_ntoN.aql b/spec/regression/collect/tests/relation-traversal/aql/to_1to1_ntoN.aql new file mode 100644 index 000000000..4b452b230 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/aql/to_1to1_ntoN.aql @@ -0,0 +1,21 @@ +WITH @@deliveries, @@handlingUnits +LET v_order1 = FIRST(( + FOR v_order2 + IN @@orders + FILTER (v_order2.`orderNumber` == @var1) + LIMIT @var2 + RETURN v_order2 +)) +RETURN { + "Order": (IS_NULL(v_order1) ? null : { + "allOuterHandlingUnits": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 INBOUND v_order1 @@deliveries_order + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER v_node2._key != null + SORT (v_node2.`handlingUnitNumber`) + RETURN { + "number": v_node2.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1ToN.aql b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1ToN.aql new file mode 100644 index 000000000..0e8d06ab0 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1ToN.aql @@ -0,0 +1,21 @@ +WITH @@deliveries, @@invoices +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allInvoices": ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_invoices + FILTER v_node2._key != null + SORT (v_node2.`invoiceNumber`) + RETURN { + "number": v_node2.`invoiceNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1to1.aql b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1to1.aql new file mode 100644 index 000000000..f59516392 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_1to1.aql @@ -0,0 +1,30 @@ +WITH @@deliveries, @@orders +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOrders": ( + FOR v_order1 + IN ( + FOR v_item1 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_order + RETURN v_node2 + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_order1.`orderNumber`) + RETURN { + "number": v_order1.`orderNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal/aql/to_1toN_nToN.aql b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_nToN.aql new file mode 100644 index 000000000..a97fdadc4 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/aql/to_1toN_nToN.aql @@ -0,0 +1,31 @@ +WITH @@deliveries, @@handlingUnits +LET v_shipment1 = FIRST(( + FOR v_shipment2 + IN @@shipments + FILTER (v_shipment2.`shipmentNumber` == @var1) + LIMIT @var2 + RETURN v_shipment2 +)) +RETURN { + "Shipment": (IS_NULL(v_shipment1) ? null : { + "allOuterHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_item1 + IN ( + FOR v_node1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_shipment1 @@shipments_deliveries + FOR v_node2, v_edge2, v_path2 IN @var5..@var6 OUTBOUND v_node1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + ) + FILTER v_item1 != null + COLLECT v_distinct1 = v_item1 + RETURN v_distinct1 + ) + SORT (v_handlingUnit1.`handlingUnitNumber`) + RETURN { + "number": v_handlingUnit1.`handlingUnitNumber` + } + ) + }) +} diff --git a/spec/regression/collect/tests/relation-traversal/result.json b/spec/regression/collect/tests/relation-traversal/result.json new file mode 100644 index 000000000..65f2fd033 --- /dev/null +++ b/spec/regression/collect/tests/relation-traversal/result.json @@ -0,0 +1,86 @@ +{ + "createEdges": { + "data": { + "updateShipment": { + "shipmentNumber": "S1" + }, + "d1": { + "deliveryNumber": "D1" + }, + "d2": { + "deliveryNumber": "D2" + } + } + }, + "to_1toN_nToN": { + "data": { + "Shipment": { + "allOuterHandlingUnits": [ + { + "number": "H1" + }, + { + "number": "H2" + }, + { + "number": "H3" + }, + { + "number": "H4" + } + ] + } + } + }, + "to_1toN_1ToN": { + "data": { + "Shipment": { + "allInvoices": [ + { + "number": "I1" + }, + { + "number": "I3" + }, + { + "number": "I5" + }, + { + "number": "I6" + } + ] + } + } + }, + "to_1toN_1to1": { + "data": { + "Shipment": { + "allOrders": [ + { + "number": "O1" + }, + { + "number": "O2" + } + ] + } + } + }, + "to_1to1_ntoN": { + "data": { + "Order": { + "allOuterHandlingUnits": [ + { + "number": "H1" + }, + { + "number": "H2" + }, + { + "number": "H4" + } + ] + } + } + } +} diff --git a/spec/regression/collect/tests/relation-traversal.graphql b/spec/regression/collect/tests/relation-traversal/test.graphql similarity index 57% rename from spec/regression/collect/tests/relation-traversal.graphql rename to spec/regression/collect/tests/relation-traversal/test.graphql index d85e5c93d..778c7e151 100644 --- a/spec/regression/collect/tests/relation-traversal.graphql +++ b/spec/regression/collect/tests/relation-traversal/test.graphql @@ -10,8 +10,13 @@ mutation createEdges { d1: updateDelivery( input: { id: "@{ids/Delivery/1}" - addHandlingUnits: ["@{ids/HandlingUnit/1}", "@{ids/HandlingUnit/2}"] + addHandlingUnits: [ + "@{ids/HandlingUnit/1}" + "@{ids/HandlingUnit/2}" + "@{ids/HandlingUnit/4}" + ] order: "@{ids/Order/1}" + addInvoices: ["@{ids/Invoice/1}", "@{ids/Invoice/5}"] } ) { deliveryNumber @@ -21,32 +26,43 @@ mutation createEdges { id: "@{ids/Delivery/2}" addHandlingUnits: ["@{ids/HandlingUnit/3}"] order: "@{ids/Order/2}" + addInvoices: ["@{ids/Invoice/3}", "@{ids/Invoice/6}"] } ) { deliveryNumber } } -query toNtoN { +# we have aliases here to ensure the mapping actually happens + +query to_1toN_nToN { Shipment(shipmentNumber: "S1") { allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber + } + } +} + +query to_1toN_1ToN { + Shipment(shipmentNumber: "S1") { + allInvoices(orderBy: invoiceNumber_ASC) { + number: invoiceNumber } } } -query toNto1 { +query to_1toN_1to1 { Shipment(shipmentNumber: "S1") { allOrders(orderBy: orderNumber_ASC) { - orderNumber + number: orderNumber } } } -query to1toN { +query to_1to1_ntoN { Order(orderNumber: "O1") { allOuterHandlingUnits(orderBy: handlingUnitNumber_ASC) { - handlingUnitNumber + number: handlingUnitNumber } } } diff --git a/spec/regression/init-test-data-context.ts b/spec/regression/init-test-data-context.ts new file mode 100644 index 000000000..b6dd4ecd0 --- /dev/null +++ b/spec/regression/init-test-data-context.ts @@ -0,0 +1,55 @@ +import { DocumentNode, GraphQLSchema } from 'graphql'; +import { ExecutionResult } from 'graphql'; +import { graphql, print } from 'graphql/index'; + +export interface ExecuteGraphqlOptions { + readonly variables?: { readonly [variable: string]: unknown }; + + /** + * @default true + */ + readonly assertNoErrors?: boolean; + + readonly authRoles?: ReadonlyArray; + + readonly claims?: { readonly [variable: string]: string | ReadonlyArray }; +} + +export class InitTestDataContext { + constructor(private readonly schema: GraphQLSchema) {} + + async executeGraphql( + document: DocumentNode | string, + options: ExecuteGraphqlOptions = {}, + ): Promise { + const assertNoErrors = options.assertNoErrors ?? true; + const contextValue = { + authRoles: options.authRoles || [], + claims: options.claims, + }; + const source = + typeof document === 'string' + ? document + : (document.loc?.source.body ?? print(document)); + const operations = + typeof document === 'object' + ? document.definitions.filter((d) => d.kind === 'OperationDefinition') + : []; + const operationName = operations.length === 1 ? operations[0].name?.value : undefined; + const result = await graphql({ + schema: this.schema, + source, + rootValue: {}, + contextValue, + variableValues: options.variables, + }); + + if (assertNoErrors && result.errors) { + throw new Error( + `GraphQL error${operationName ? ` in ${operationName}` : ''}: ${JSON.stringify(result.errors)}`, + ); + } + + return result; + } +} diff --git a/spec/regression/initialization.ts b/spec/regression/initialization.ts index b4e2d89bf..e7209714f 100644 --- a/spec/regression/initialization.ts +++ b/spec/regression/initialization.ts @@ -1,9 +1,9 @@ import { Database } from 'arangojs'; -import { Collection } from 'arangojs/collection'; import { existsSync, readFileSync } from 'fs'; -import { ExecutionResult, graphql, GraphQLSchema } from 'graphql'; +import { ExecutionResult } from 'graphql'; import stripJsonComments from 'strip-json-comments'; import { ArangoDBConfig } from '../../src/database/arangodb'; +import { InitTestDataContext } from './init-test-data-context'; const DATABASE_NAME = 'cruddl-test-temp'; // arangodb only listens on ipv4, but localhost may resolve to ::1, so explicitly state 127.0.0.1 @@ -44,13 +44,20 @@ export function getTempDatabase(): Database { }); } +export function getTempDatabaseConfig(): ArangoDBConfig { + return { + url: DATABASE_URL, + databaseName: DATABASE_NAME, + }; +} + export interface TestDataEnvironment { fillTemplateStrings: (data: any) => any; } export async function initTestData( path: string, - schema: GraphQLSchema, + context: InitTestDataContext, ): Promise { if (!existsSync(path)) { return { @@ -90,9 +97,6 @@ export async function initTestData( return data; } - const context = { - authRoles: testData.roles || [], - }; for (const rootEntityName in testData.rootEntities) { const namespace = rootEntityName.split('.'); const rootEntityLocalName = namespace.pop(); @@ -101,25 +105,17 @@ export async function initTestData( dataSet = fillTemplateStrings(dataSet); const dataID = dataSet['@id']; delete dataSet['@id']; + const query = `mutation($input: Create${rootEntityLocalName}Input!) { ${wrapNamespaceForQuery( `res: create${rootEntityLocalName}(input: $input) { id }`, namespace, )} }`; - const variables = { input: dataSet }; - const result = await graphql({ - schema, - source: query, - rootValue: {}, - contextValue: context, - variableValues: variables, + + const result = await context.executeGraphql(query, { + variables: { input: dataSet }, + authRoles: testData.roles, }); - if (result.errors) { - throw new Error( - `GraphQL error while inserting ${rootEntityName}: ${JSON.stringify( - result.errors, - )}`, - ); - } + const id = retrieveIdFromResult(result, namespace); if (!id) { throw new Error( diff --git a/spec/regression/keywords/tests/escaped-keywords/aql/m.aql b/spec/regression/keywords/tests/escaped-keywords/aql/m.aql new file mode 100644 index 000000000..6840be176 --- /dev/null +++ b/spec/regression/keywords/tests/escaped-keywords/aql/m.aql @@ -0,0 +1,27 @@ +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@values + RETURN NEW._key +) + +// -------------------------------- + +WITH @@values +RETURN ( + FOR v_value1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + RETURN DOCUMENT(@@values, v_id1) + ) + RETURN { + "limit": v_value1.`limit` + } +) + +// -------------------------------- + +WITH @@values +RETURN { + "createValues": @v_createValues1 +} diff --git a/spec/regression/keywords/tests/escaped-keywords/aql/q.aql b/spec/regression/keywords/tests/escaped-keywords/aql/q.aql new file mode 100644 index 000000000..da961f439 --- /dev/null +++ b/spec/regression/keywords/tests/escaped-keywords/aql/q.aql @@ -0,0 +1,11 @@ +RETURN { + "allValues": ( + FOR v_value1 + IN @@values + FILTER (v_value1.`limit` == @var1) + SORT (v_value1.`limit`) + RETURN { + "limit": v_value1.`limit` + } + ) +} diff --git a/spec/regression/keywords/tests/escaped-keywords.result.json b/spec/regression/keywords/tests/escaped-keywords/result.json similarity index 100% rename from spec/regression/keywords/tests/escaped-keywords.result.json rename to spec/regression/keywords/tests/escaped-keywords/result.json diff --git a/spec/regression/keywords/tests/escaped-keywords.graphql b/spec/regression/keywords/tests/escaped-keywords/test.graphql similarity index 100% rename from spec/regression/keywords/tests/escaped-keywords.graphql rename to spec/regression/keywords/tests/escaped-keywords/test.graphql diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/DataCheck.aql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/DataCheck.aql new file mode 100644 index 000000000..974b2991d --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "id": v_hero1._key + } + ) +} diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/ExplicitDeleteAllFirstExceedsLimit.aql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/ExplicitDeleteAllFirstExceedsLimit.aql new file mode 100644 index 000000000..a3c84559c --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/aql/ExplicitDeleteAllFirstExceedsLimit.aql @@ -0,0 +1,3 @@ +RETURN { + "deleteAllHeroes": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.context.json b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/context.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.context.json rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/context.json diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.result.json b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/result.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.result.json rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/result.json diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.graphql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit.graphql rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first-exceeds-limit/test.graphql diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/DataCheck.aql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/DataCheck.aql new file mode 100644 index 000000000..974b2991d --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "id": v_hero1._key + } + ) +} diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/ExplicitLimitDeleteAllFirst.aql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/ExplicitLimitDeleteAllFirst.aql new file mode 100644 index 000000000..efad7a97b --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/aql/ExplicitLimitDeleteAllFirst.aql @@ -0,0 +1,20 @@ +RETURN ( + FOR v_hero1 + IN ( + FOR v_hero2 + IN @@heroes + LIMIT @var1 + REMOVE v_hero2 + IN @@heroes + RETURN OLD + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllHeroes": @v_deleteAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first.context.json b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/context.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first.context.json rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first/context.json diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first.result.json b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/result.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first.result.json rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first/result.json diff --git a/spec/regression/list-limits/tests/explicit-limit-delete-all-first.graphql b/spec/regression/list-limits/tests/explicit-limit-delete-all-first/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-delete-all-first.graphql rename to spec/regression/list-limits/tests/explicit-limit-delete-all-first/test.graphql diff --git a/spec/regression/list-limits/tests/explicit-limit-query/aql/ExplicitLimitQuery.aql b/spec/regression/list-limits/tests/explicit-limit-query/aql/ExplicitLimitQuery.aql new file mode 100644 index 000000000..01eb8a32c --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-query/aql/ExplicitLimitQuery.aql @@ -0,0 +1,11 @@ +RETURN { + "tooBigLimit": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var3 + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/explicit-limit-query.context.json b/spec/regression/list-limits/tests/explicit-limit-query/context.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-query.context.json rename to spec/regression/list-limits/tests/explicit-limit-query/context.json diff --git a/spec/regression/list-limits/tests/explicit-limit-query.result.json b/spec/regression/list-limits/tests/explicit-limit-query/result.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-query.result.json rename to spec/regression/list-limits/tests/explicit-limit-query/result.json diff --git a/spec/regression/list-limits/tests/explicit-limit-query.graphql b/spec/regression/list-limits/tests/explicit-limit-query/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-query.graphql rename to spec/regression/list-limits/tests/explicit-limit-query/test.graphql diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/DataCheck.aql b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/DataCheck.aql new file mode 100644 index 000000000..83c60c6e3 --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/ExplicitUpdateAllFirstExceedsLimit.aql b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/ExplicitUpdateAllFirstExceedsLimit.aql new file mode 100644 index 000000000..97b17dbe5 --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/aql/ExplicitUpdateAllFirstExceedsLimit.aql @@ -0,0 +1,3 @@ +RETURN { + "updateAllHeroes": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.context.json b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/context.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.context.json rename to spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/context.json diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.result.json b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/result.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.result.json rename to spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/result.json diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.graphql b/spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit.graphql rename to spec/regression/list-limits/tests/explicit-limit-update-all-first-exceeds-limit/test.graphql diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/DataCheck.aql b/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/DataCheck.aql new file mode 100644 index 000000000..d0a85cfb0 --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/DataCheck.aql @@ -0,0 +1,11 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + SORT (v_hero1._key) + LIMIT @var1 + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/ExplicitUpdateAllFirst.aql b/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/ExplicitUpdateAllFirst.aql new file mode 100644 index 000000000..4be8887c2 --- /dev/null +++ b/spec/regression/list-limits/tests/explicit-limit-update-all-first/aql/ExplicitUpdateAllFirst.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_hero1 + IN @@heroes + SORT (v_hero1._key) + LIMIT @var1 + RETURN v_hero1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var2, + "updatedAt": @var3 + } + IN @@heroes + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@heroes +RETURN ( + FOR v_hero1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@heroes, v_id1) + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +WITH @@heroes +RETURN { + "updateAllHeroes": @v_updateAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first.context.json b/spec/regression/list-limits/tests/explicit-limit-update-all-first/context.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first.context.json rename to spec/regression/list-limits/tests/explicit-limit-update-all-first/context.json diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first.result.json b/spec/regression/list-limits/tests/explicit-limit-update-all-first/result.json similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first.result.json rename to spec/regression/list-limits/tests/explicit-limit-update-all-first/result.json diff --git a/spec/regression/list-limits/tests/explicit-limit-update-all-first.graphql b/spec/regression/list-limits/tests/explicit-limit-update-all-first/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/explicit-limit-update-all-first.graphql rename to spec/regression/list-limits/tests/explicit-limit-update-all-first/test.graphql diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/DataCheck.aql b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/DataCheck.aql new file mode 100644 index 000000000..974b2991d --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "id": v_hero1._key + } + ) +} diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/ImplicitLimitDeleteAllFirst.aql b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/ImplicitLimitDeleteAllFirst.aql new file mode 100644 index 000000000..efad7a97b --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/aql/ImplicitLimitDeleteAllFirst.aql @@ -0,0 +1,20 @@ +RETURN ( + FOR v_hero1 + IN ( + FOR v_hero2 + IN @@heroes + LIMIT @var1 + REMOVE v_hero2 + IN @@heroes + RETURN OLD + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllHeroes": @v_deleteAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all-first.context.json b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/context.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all-first.context.json rename to spec/regression/list-limits/tests/implicit-limit-delete-all-first/context.json diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all-first.result.json b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/result.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all-first.result.json rename to spec/regression/list-limits/tests/implicit-limit-delete-all-first/result.json diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all-first.graphql b/spec/regression/list-limits/tests/implicit-limit-delete-all-first/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all-first.graphql rename to spec/regression/list-limits/tests/implicit-limit-delete-all-first/test.graphql diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/DataCheck.aql b/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/DataCheck.aql new file mode 100644 index 000000000..974b2991d --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "id": v_hero1._key + } + ) +} diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/ImplicitDeleteAll.aql b/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/ImplicitDeleteAll.aql new file mode 100644 index 000000000..4b7b0bf04 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-delete-all/aql/ImplicitDeleteAll.aql @@ -0,0 +1,28 @@ +RETURN ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN v_hero1 +) + +// -------------------------------- + +RETURN ( + FOR v_hero1 + IN ( + FOR v_hero2 + IN @tmp1 + REMOVE v_hero2 + IN @@heroes + RETURN OLD + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +RETURN { + "deleteAllHeroes": @v_deleteAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all.context.json b/spec/regression/list-limits/tests/implicit-limit-delete-all/context.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all.context.json rename to spec/regression/list-limits/tests/implicit-limit-delete-all/context.json diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all.result.json b/spec/regression/list-limits/tests/implicit-limit-delete-all/result.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all.result.json rename to spec/regression/list-limits/tests/implicit-limit-delete-all/result.json diff --git a/spec/regression/list-limits/tests/implicit-limit-delete-all.graphql b/spec/regression/list-limits/tests/implicit-limit-delete-all/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-delete-all.graphql rename to spec/regression/list-limits/tests/implicit-limit-delete-all/test.graphql diff --git a/spec/regression/list-limits/tests/implicit-limit-query/aql/ImplicitLimitQuery.aql b/spec/regression/list-limits/tests/implicit-limit-query/aql/ImplicitLimitQuery.aql new file mode 100644 index 000000000..46a977a15 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-query/aql/ImplicitLimitQuery.aql @@ -0,0 +1,18 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "name": v_hero1.`name` + } + ), + "withExplicitLimit": ( + FOR v_hero2 + IN @@heroes + LIMIT @var2 + RETURN { + "name": v_hero2.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/implicit-limit-query.context.json b/spec/regression/list-limits/tests/implicit-limit-query/context.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-query.context.json rename to spec/regression/list-limits/tests/implicit-limit-query/context.json diff --git a/spec/regression/list-limits/tests/implicit-limit-query.result.json b/spec/regression/list-limits/tests/implicit-limit-query/result.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-query.result.json rename to spec/regression/list-limits/tests/implicit-limit-query/result.json diff --git a/spec/regression/list-limits/tests/implicit-limit-query.graphql b/spec/regression/list-limits/tests/implicit-limit-query/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-query.graphql rename to spec/regression/list-limits/tests/implicit-limit-query/test.graphql diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/DataCheck.aql b/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/DataCheck.aql new file mode 100644 index 000000000..d0a85cfb0 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/DataCheck.aql @@ -0,0 +1,11 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + SORT (v_hero1._key) + LIMIT @var1 + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/ImplicitLimitUpdateAllFirst.aql b/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/ImplicitLimitUpdateAllFirst.aql new file mode 100644 index 000000000..4be8887c2 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-update-all-first/aql/ImplicitLimitUpdateAllFirst.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_hero1 + IN @@heroes + SORT (v_hero1._key) + LIMIT @var1 + RETURN v_hero1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var2, + "updatedAt": @var3 + } + IN @@heroes + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@heroes +RETURN ( + FOR v_hero1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@heroes, v_id1) + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +WITH @@heroes +RETURN { + "updateAllHeroes": @v_updateAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all-first.context.json b/spec/regression/list-limits/tests/implicit-limit-update-all-first/context.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all-first.context.json rename to spec/regression/list-limits/tests/implicit-limit-update-all-first/context.json diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all-first.result.json b/spec/regression/list-limits/tests/implicit-limit-update-all-first/result.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all-first.result.json rename to spec/regression/list-limits/tests/implicit-limit-update-all-first/result.json diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all-first.graphql b/spec/regression/list-limits/tests/implicit-limit-update-all-first/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all-first.graphql rename to spec/regression/list-limits/tests/implicit-limit-update-all-first/test.graphql diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all/aql/DataCheck.aql b/spec/regression/list-limits/tests/implicit-limit-update-all/aql/DataCheck.aql new file mode 100644 index 000000000..83c60c6e3 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-update-all/aql/DataCheck.aql @@ -0,0 +1,10 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all/aql/ImplicitUpdateAll.aql b/spec/regression/list-limits/tests/implicit-limit-update-all/aql/ImplicitUpdateAll.aql new file mode 100644 index 000000000..3ac0acd91 --- /dev/null +++ b/spec/regression/list-limits/tests/implicit-limit-update-all/aql/ImplicitUpdateAll.aql @@ -0,0 +1,43 @@ +RETURN ( + FOR v_hero1 + IN @@heroes + LIMIT @var1 + RETURN v_hero1 +) + +// -------------------------------- + +RETURN ( + FOR v_currentEntity1 + IN @tmp1 + UPDATE v_currentEntity1 + WITH { + "name": @var1, + "updatedAt": @var2 + } + IN @@heroes + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@heroes +RETURN ( + FOR v_hero1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@heroes, v_id1) + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +WITH @@heroes +RETURN { + "updateAllHeroes": @v_updateAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all.context.json b/spec/regression/list-limits/tests/implicit-limit-update-all/context.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all.context.json rename to spec/regression/list-limits/tests/implicit-limit-update-all/context.json diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all.result.json b/spec/regression/list-limits/tests/implicit-limit-update-all/result.json similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all.result.json rename to spec/regression/list-limits/tests/implicit-limit-update-all/result.json diff --git a/spec/regression/list-limits/tests/implicit-limit-update-all.graphql b/spec/regression/list-limits/tests/implicit-limit-update-all/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/implicit-limit-update-all.graphql rename to spec/regression/list-limits/tests/implicit-limit-update-all/test.graphql diff --git a/spec/regression/list-limits/tests/no-limits-mutation/aql/NoLimitsMutation.aql b/spec/regression/list-limits/tests/no-limits-mutation/aql/NoLimitsMutation.aql new file mode 100644 index 000000000..ee720e70e --- /dev/null +++ b/spec/regression/list-limits/tests/no-limits-mutation/aql/NoLimitsMutation.aql @@ -0,0 +1,52 @@ +RETURN ( + FOR v_currentEntity1 + IN @@heroes + UPDATE v_currentEntity1 + WITH { + "name": @var1, + "updatedAt": @var2 + } + IN @@heroes + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@heroes +RETURN ( + FOR v_hero1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@heroes, v_id1) + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +WITH @@heroes +RETURN ( + FOR v_hero1 + IN ( + FOR v_hero2 + IN @@heroes + REMOVE v_hero2 + IN @@heroes + RETURN OLD + ) + RETURN { + "name": v_hero1.`name` + } +) + +// -------------------------------- + +WITH @@heroes +RETURN { + "updateAllHeroes": @v_updateAllHeroes1, + "deleteAllHeroes": @v_deleteAllHeroes1 +} diff --git a/spec/regression/list-limits/tests/no-limits-mutation.context.json b/spec/regression/list-limits/tests/no-limits-mutation/context.json similarity index 100% rename from spec/regression/list-limits/tests/no-limits-mutation.context.json rename to spec/regression/list-limits/tests/no-limits-mutation/context.json diff --git a/spec/regression/list-limits/tests/no-limits-mutation.result.json b/spec/regression/list-limits/tests/no-limits-mutation/result.json similarity index 100% rename from spec/regression/list-limits/tests/no-limits-mutation.result.json rename to spec/regression/list-limits/tests/no-limits-mutation/result.json diff --git a/spec/regression/list-limits/tests/no-limits-mutation.graphql b/spec/regression/list-limits/tests/no-limits-mutation/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/no-limits-mutation.graphql rename to spec/regression/list-limits/tests/no-limits-mutation/test.graphql diff --git a/spec/regression/list-limits/tests/no-limits-query/aql/NoLimitsQuery.aql b/spec/regression/list-limits/tests/no-limits-query/aql/NoLimitsQuery.aql new file mode 100644 index 000000000..fc71dc34e --- /dev/null +++ b/spec/regression/list-limits/tests/no-limits-query/aql/NoLimitsQuery.aql @@ -0,0 +1,9 @@ +RETURN { + "allHeroes": ( + FOR v_hero1 + IN @@heroes + RETURN { + "name": v_hero1.`name` + } + ) +} diff --git a/spec/regression/list-limits/tests/no-limits-query.context.json b/spec/regression/list-limits/tests/no-limits-query/context.json similarity index 100% rename from spec/regression/list-limits/tests/no-limits-query.context.json rename to spec/regression/list-limits/tests/no-limits-query/context.json diff --git a/spec/regression/list-limits/tests/no-limits-query.result.json b/spec/regression/list-limits/tests/no-limits-query/result.json similarity index 100% rename from spec/regression/list-limits/tests/no-limits-query.result.json rename to spec/regression/list-limits/tests/no-limits-query/result.json diff --git a/spec/regression/list-limits/tests/no-limits-query.graphql b/spec/regression/list-limits/tests/no-limits-query/test.graphql similarity index 100% rename from spec/regression/list-limits/tests/no-limits-query.graphql rename to spec/regression/list-limits/tests/no-limits-query/test.graphql diff --git a/spec/regression/logistics/tests/add-child-entity/aql/add.aql b/spec/regression/logistics/tests/add-child-entity/aql/add.aql new file mode 100644 index 000000000..c5cb391aa --- /dev/null +++ b/spec/regression/logistics/tests/add-child-entity/aql/add.aql @@ -0,0 +1,39 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/add-child-entity/aql/query.aql b/spec/regression/logistics/tests/add-child-entity/aql/query.aql new file mode 100644 index 000000000..364daca1b --- /dev/null +++ b/spec/regression/logistics/tests/add-child-entity/aql/query.aql @@ -0,0 +1,18 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/add-child-entity.result.json b/spec/regression/logistics/tests/add-child-entity/result.json similarity index 100% rename from spec/regression/logistics/tests/add-child-entity.result.json rename to spec/regression/logistics/tests/add-child-entity/result.json diff --git a/spec/regression/logistics/tests/add-child-entity.graphql b/spec/regression/logistics/tests/add-child-entity/test.graphql similarity index 100% rename from spec/regression/logistics/tests/add-child-entity.graphql rename to spec/regression/logistics/tests/add-child-entity/test.graphql diff --git a/spec/regression/logistics/tests/add-root-entity/aql/add.aql b/spec/regression/logistics/tests/add-root-entity/aql/add.aql new file mode 100644 index 000000000..a036e4928 --- /dev/null +++ b/spec/regression/logistics/tests/add-root-entity/aql/add.aql @@ -0,0 +1,19 @@ +RETURN FIRST( + INSERT @var1 IN @@countries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@countries +LET v_country1 = DOCUMENT(@@countries, @v_newEntityId1) +RETURN (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` +}) + +// -------------------------------- + +WITH @@countries +RETURN { + "createCountry": @v_createCountry1 +} diff --git a/spec/regression/logistics/tests/add-root-entity/aql/query.aql b/spec/regression/logistics/tests/add-root-entity/aql/query.aql new file mode 100644 index 000000000..7c5549d28 --- /dev/null +++ b/spec/regression/logistics/tests/add-root-entity/aql/query.aql @@ -0,0 +1,18 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + SORT (v_country1.`isoCode`) + RETURN { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/add-root-entity.context.json b/spec/regression/logistics/tests/add-root-entity/context.json similarity index 100% rename from spec/regression/logistics/tests/add-root-entity.context.json rename to spec/regression/logistics/tests/add-root-entity/context.json diff --git a/spec/regression/logistics/tests/add-root-entity.result.json b/spec/regression/logistics/tests/add-root-entity/result.json similarity index 100% rename from spec/regression/logistics/tests/add-root-entity.result.json rename to spec/regression/logistics/tests/add-root-entity/result.json diff --git a/spec/regression/logistics/tests/add-root-entity.graphql b/spec/regression/logistics/tests/add-root-entity/test.graphql similarity index 100% rename from spec/regression/logistics/tests/add-root-entity.graphql rename to spec/regression/logistics/tests/add-root-entity/test.graphql diff --git a/spec/regression/logistics/tests/aliases.result.json b/spec/regression/logistics/tests/aliases.result.json deleted file mode 100644 index 97af12e7b..000000000 --- a/spec/regression/logistics/tests/aliases.result.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "data": { - "aDelivery": { - "nr": "1000173", - "oneItem": [ - { - "itemNumber": "1001" - } - ], - "items": [ - { - "itemNumber": "1001" - }, - { - "itemNumber": "1002" - } - ] - }, - "anotherDelivery": { - "nr": "1000521" - } - } -} diff --git a/spec/regression/logistics/tests/aliases/aql/aliases.aql b/spec/regression/logistics/tests/aliases/aql/aliases.aql new file mode 100644 index 000000000..b3c06acdb --- /dev/null +++ b/spec/regression/logistics/tests/aliases/aql/aliases.aql @@ -0,0 +1,37 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_delivery3 = FIRST(( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var3) + LIMIT @var4 + RETURN v_delivery4 +)) +RETURN { + "aDelivery": (IS_NULL(v_delivery1) ? null : { + "nr": v_delivery1.`deliveryNumber`, + "oneItem": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (v_deliveryItem1.`itemNumber` == @var5) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "items": ( + FOR v_deliveryItem2 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem2.`itemNumber` + } + ) + }), + "anotherDelivery": (IS_NULL(v_delivery3) ? null : { + "nr": v_delivery3.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/aliases/result.json b/spec/regression/logistics/tests/aliases/result.json new file mode 100644 index 000000000..763b8cd81 --- /dev/null +++ b/spec/regression/logistics/tests/aliases/result.json @@ -0,0 +1,25 @@ +{ + "aliases": { + "data": { + "aDelivery": { + "nr": "1000173", + "oneItem": [ + { + "itemNumber": "1001" + } + ], + "items": [ + { + "itemNumber": "1001" + }, + { + "itemNumber": "1002" + } + ] + }, + "anotherDelivery": { + "nr": "1000521" + } + } + } +} diff --git a/spec/regression/logistics/tests/aliases.graphql b/spec/regression/logistics/tests/aliases/test.graphql similarity index 95% rename from spec/regression/logistics/tests/aliases.graphql rename to spec/regression/logistics/tests/aliases/test.graphql index 1e68170a9..bc4cbe9fa 100644 --- a/spec/regression/logistics/tests/aliases.graphql +++ b/spec/regression/logistics/tests/aliases/test.graphql @@ -1,4 +1,4 @@ -{ +query aliases { aDelivery: Delivery(id: "@{ids/Delivery/1}") { nr: deliveryNumber oneItem: items(filter: { itemNumber: "1001" }) { diff --git a/spec/regression/logistics/tests/billing/aql/billingEntity_existing.aql b/spec/regression/logistics/tests/billing/aql/billingEntity_existing.aql new file mode 100644 index 000000000..0e24c614b --- /dev/null +++ b/spec/regression/logistics/tests/billing/aql/billingEntity_existing.aql @@ -0,0 +1,15 @@ +RETURN { + "allBillingEntities": ( + FOR v_billingEntity1 + IN @@billingEntities + FILTER ((v_billingEntity1.`key` == @var1) && (v_billingEntity1.`type` == @var2)) + RETURN { + "key": v_billingEntity1.`key`, + "type": v_billingEntity1.`type`, + "isConfirmedForExport": v_billingEntity1.`isConfirmedForExport`, + "isExported": v_billingEntity1.`isExported`, + "confirmedForExportAt": v_billingEntity1.`confirmedForExportAt`, + "exportedAt": v_billingEntity1.`exportedAt` + } + ) +} diff --git a/spec/regression/logistics/tests/billing/aql/createDelivery.aql b/spec/regression/logistics/tests/billing/aql/createDelivery.aql new file mode 100644 index 000000000..32dd4868d --- /dev/null +++ b/spec/regression/logistics/tests/billing/aql/createDelivery.aql @@ -0,0 +1,48 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/billing.result.json b/spec/regression/logistics/tests/billing/result.json similarity index 100% rename from spec/regression/logistics/tests/billing.result.json rename to spec/regression/logistics/tests/billing/result.json diff --git a/spec/regression/logistics/tests/billing.graphql b/spec/regression/logistics/tests/billing/test.graphql similarity index 100% rename from spec/regression/logistics/tests/billing.graphql rename to spec/regression/logistics/tests/billing/test.graphql diff --git a/spec/regression/logistics/tests/count.result.json b/spec/regression/logistics/tests/count.result.json deleted file mode 100644 index cfa3a7149..000000000 --- a/spec/regression/logistics/tests/count.result.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "_allDeliveriesMeta": { - "count": 3 - }, - "Delivery": { - "_itemsMeta": { - "count": 2 - } - } - } -} diff --git a/spec/regression/logistics/tests/count/aql/count.aql b/spec/regression/logistics/tests/count/aql/count.aql new file mode 100644 index 000000000..e31cfa9d8 --- /dev/null +++ b/spec/regression/logistics/tests/count/aql/count.aql @@ -0,0 +1,22 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + @var3: { + "count": LENGTH(@@deliveries) + }, + "Delivery": (IS_NULL(v_delivery1) ? null : { + @var4: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } + }) +} diff --git a/spec/regression/logistics/tests/count/result.json b/spec/regression/logistics/tests/count/result.json new file mode 100644 index 000000000..66797e597 --- /dev/null +++ b/spec/regression/logistics/tests/count/result.json @@ -0,0 +1,14 @@ +{ + "count": { + "data": { + "_allDeliveriesMeta": { + "count": 3 + }, + "Delivery": { + "_itemsMeta": { + "count": 2 + } + } + } + } +} diff --git a/spec/regression/logistics/tests/count.graphql b/spec/regression/logistics/tests/count/test.graphql similarity index 91% rename from spec/regression/logistics/tests/count.graphql rename to spec/regression/logistics/tests/count/test.graphql index 0f5da5aeb..5efdbc859 100644 --- a/spec/regression/logistics/tests/count.graphql +++ b/spec/regression/logistics/tests/count/test.graphql @@ -1,4 +1,4 @@ -query { +query count { _allDeliveriesMeta { count } diff --git a/spec/regression/logistics/tests/create-many/aql/create.aql b/spec/regression/logistics/tests/create-many/aql/create.aql new file mode 100644 index 000000000..38732e27a --- /dev/null +++ b/spec/regression/logistics/tests/create-many/aql/create.aql @@ -0,0 +1,253 @@ +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: @var3}, {_from: CONCAT(@var4, (@v_newEntityIds1)[@var5]), _to: @var6} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: @var3}, {_from: CONCAT(@var4, (@v_newEntityIds1)[@var5]), _to: @var6} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, (@v_newEntityIds1)[@var2]), _to: CONCAT(@var3, (@v_newEntityIds2)[@var4])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, (@v_newEntityIds1)[@var1]) +RETURN ( + UPSERT { + key: @var2, + type: @var3 + } + INSERT { + + key: @var4, + type: @var5, + category: null, + quantity: null, + isExported: false, + createdAt: @var6, + updatedAt: @var7, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var8, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var9 +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, (@v_newEntityIds1)[@var1]) +RETURN ( + UPSERT { + key: @var2, + type: @var3 + } + INSERT { + + key: @var4, + type: @var5, + category: null, + quantity: null, + isExported: false, + createdAt: @var6, + updatedAt: @var7, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var8, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var9 +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN ( + FOR v_delivery1 + IN ( + FOR v_id1 + IN @v_newEntityIds1 + RETURN DOCUMENT(@@deliveries, v_id1) + ) + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var1 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var2 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) + } +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "createDeliveries": @v_createDeliveries1 +} diff --git a/spec/regression/logistics/tests/create-many/aql/query.aql b/spec/regression/logistics/tests/create-many/aql/query.aql new file mode 100644 index 000000000..f3be1e2a9 --- /dev/null +++ b/spec/regression/logistics/tests/create-many/aql/query.aql @@ -0,0 +1,74 @@ +WITH @@handlingUnits +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + LIMIT @var1 + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var2 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var3 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/create-many.result.json b/spec/regression/logistics/tests/create-many/result.json similarity index 100% rename from spec/regression/logistics/tests/create-many.result.json rename to spec/regression/logistics/tests/create-many/result.json diff --git a/spec/regression/logistics/tests/create-many.graphql b/spec/regression/logistics/tests/create-many/test.graphql similarity index 100% rename from spec/regression/logistics/tests/create-many.graphql rename to spec/regression/logistics/tests/create-many/test.graphql diff --git a/spec/regression/logistics/tests/create-with-to-many-relation/aql/check.aql b/spec/regression/logistics/tests/create-with-to-many-relation/aql/check.aql new file mode 100644 index 000000000..512d59159 --- /dev/null +++ b/spec/regression/logistics/tests/create-with-to-many-relation/aql/check.aql @@ -0,0 +1,28 @@ +WITH @@deliveries, @@handlingUnits +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`deliveryNumber` == @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery2 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery2) ? null : { + "deliveryNumber": v_delivery2.`deliveryNumber` + }) + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/create-with-to-many-relation/aql/create.aql b/spec/regression/logistics/tests/create-with-to-many-relation/aql/create.aql new file mode 100644 index 000000000..768527f93 --- /dev/null +++ b/spec/regression/logistics/tests/create-with-to-many-relation/aql/create.aql @@ -0,0 +1,75 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, @v_newEntityId1), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/create-with-to-many-relation.result.json b/spec/regression/logistics/tests/create-with-to-many-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/create-with-to-many-relation.result.json rename to spec/regression/logistics/tests/create-with-to-many-relation/result.json diff --git a/spec/regression/logistics/tests/create-with-to-many-relation.graphql b/spec/regression/logistics/tests/create-with-to-many-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/create-with-to-many-relation.graphql rename to spec/regression/logistics/tests/create-with-to-many-relation/test.graphql diff --git a/spec/regression/logistics/tests/create-with-to-one-relation/aql/check.aql b/spec/regression/logistics/tests/create-with-to-one-relation/aql/check.aql new file mode 100644 index 000000000..2bca3af6a --- /dev/null +++ b/spec/regression/logistics/tests/create-with-to-one-relation/aql/check.aql @@ -0,0 +1,20 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1.`huNumber` == @var1) + LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/create-with-to-one-relation/aql/create.aql b/spec/regression/logistics/tests/create-with-to-one-relation/aql/create.aql new file mode 100644 index 000000000..84f82a7d1 --- /dev/null +++ b/spec/regression/logistics/tests/create-with-to-one-relation/aql/create.aql @@ -0,0 +1,34 @@ +RETURN FIRST( + INSERT @var1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, @v_newEntityId1)} + INSERT {_from: @var2, _to: CONCAT(@var3, @v_newEntityId1)} + UPDATE {_from: @var4, _to: CONCAT(@var5, @v_newEntityId1)} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @v_newEntityId1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "createHandlingUnit": @v_createHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/create-with-to-one-relation.result.json b/spec/regression/logistics/tests/create-with-to-one-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/create-with-to-one-relation.result.json rename to spec/regression/logistics/tests/create-with-to-one-relation/result.json diff --git a/spec/regression/logistics/tests/create-with-to-one-relation.graphql b/spec/regression/logistics/tests/create-with-to-one-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/create-with-to-one-relation.graphql rename to spec/regression/logistics/tests/create-with-to-one-relation/test.graphql diff --git a/spec/regression/logistics/tests/create/aql/create.aql b/spec/regression/logistics/tests/create/aql/create.aql new file mode 100644 index 000000000..d13568c69 --- /dev/null +++ b/spec/regression/logistics/tests/create/aql/create.aql @@ -0,0 +1,101 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var1 + RETURN v_country2 +))) +LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var2 + RETURN v_destinationCountry1 +))) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/create/aql/query.aql b/spec/regression/logistics/tests/create/aql/query.aql new file mode 100644 index 000000000..7e74b6137 --- /dev/null +++ b/spec/regression/logistics/tests/create/aql/query.aql @@ -0,0 +1,64 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`updatedAt`) DESC + LIMIT @var1 + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var2 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var3 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/create.result.json b/spec/regression/logistics/tests/create/result.json similarity index 100% rename from spec/regression/logistics/tests/create.result.json rename to spec/regression/logistics/tests/create/result.json diff --git a/spec/regression/logistics/tests/create.graphql b/spec/regression/logistics/tests/create/test.graphql similarity index 100% rename from spec/regression/logistics/tests/create.graphql rename to spec/regression/logistics/tests/create/test.graphql diff --git a/spec/regression/logistics/tests/date-time-invalid.result.json b/spec/regression/logistics/tests/date-time-invalid/result.json similarity index 100% rename from spec/regression/logistics/tests/date-time-invalid.result.json rename to spec/regression/logistics/tests/date-time-invalid/result.json diff --git a/spec/regression/logistics/tests/date-time-invalid.graphql b/spec/regression/logistics/tests/date-time-invalid/test.graphql similarity index 100% rename from spec/regression/logistics/tests/date-time-invalid.graphql rename to spec/regression/logistics/tests/date-time-invalid/test.graphql diff --git a/spec/regression/logistics/tests/date-time/aql/query.aql b/spec/regression/logistics/tests/date-time/aql/query.aql new file mode 100644 index 000000000..11d66cb95 --- /dev/null +++ b/spec/regression/logistics/tests/date-time/aql/query.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "shippedAt": v_delivery1.`shippedAt` + }) +} diff --git a/spec/regression/logistics/tests/date-time/aql/update.aql b/spec/regression/logistics/tests/date-time/aql/update.aql new file mode 100644 index 000000000..af9256144 --- /dev/null +++ b/spec/regression/logistics/tests/date-time/aql/update.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "shippedAt": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "shippedAt": v_delivery1.`shippedAt` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/date-time.result.json b/spec/regression/logistics/tests/date-time/result.json similarity index 100% rename from spec/regression/logistics/tests/date-time.result.json rename to spec/regression/logistics/tests/date-time/result.json diff --git a/spec/regression/logistics/tests/date-time.graphql b/spec/regression/logistics/tests/date-time/test.graphql similarity index 100% rename from spec/regression/logistics/tests/date-time.graphql rename to spec/regression/logistics/tests/date-time/test.graphql diff --git a/spec/regression/logistics/tests/default-value/aql/checkCreatedByInit.aql b/spec/regression/logistics/tests/default-value/aql/checkCreatedByInit.aql new file mode 100644 index 000000000..3a6f32735 --- /dev/null +++ b/spec/regression/logistics/tests/default-value/aql/checkCreatedByInit.aql @@ -0,0 +1,32 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + LET v_country1 = (IS_NULL(v_delivery1.`destination`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`destination`.`country`)) + LIMIT @var1 + RETURN v_country2 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destination": (IS_NULL(v_delivery1.`destination`) ? null : { + "street": v_delivery1.`destination`.`street`, + "city": v_delivery1.`destination`.`city`, + "zipCode": v_delivery1.`destination`.`zipCode`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + }), + "defaultValueString": v_delivery1.`defaultValueString`, + "defaultValueString2": v_delivery1.`defaultValueString2`, + "defaultValueInt": v_delivery1.`defaultValueInt`, + "defaultValueTrue": v_delivery1.`defaultValueTrue`, + "defaultValueFalse": v_delivery1.`defaultValueFalse`, + "defaultValueFloat": v_delivery1.`defaultValueFloat`, + "defaultValueEnum": v_delivery1.`defaultValueEnum` + } + ) +} diff --git a/spec/regression/logistics/tests/default-value/aql/checkFiltersByInit.aql b/spec/regression/logistics/tests/default-value/aql/checkFiltersByInit.aql new file mode 100644 index 000000000..974d0c004 --- /dev/null +++ b/spec/regression/logistics/tests/default-value/aql/checkFiltersByInit.aql @@ -0,0 +1,39 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (((((((((((v_delivery1.`destination`.`street` == @var1) && (v_delivery1.`destination`.`city` == @var2)) && (v_delivery1.`destination`.`zipCode` == @var3)) && ((IS_NULL(v_delivery1.`destination`.`country`) ? null : FIRST(( + FOR v_country1 + IN @@countries + FILTER ((v_country1.`isoCode` > NULL) && (v_country1.`isoCode` == v_delivery1.`destination`.`country`)) + LIMIT @var4 + RETURN v_country1 + ))).`isoCode` == @var5)) && (v_delivery1.`defaultValueString` == @var6)) && (v_delivery1.`defaultValueString2` == @var7)) && (v_delivery1.`defaultValueInt` == @var8)) && (v_delivery1.`defaultValueTrue` == @var9)) && (v_delivery1.`defaultValueFalse` == @var10)) && (v_delivery1.`defaultValueFloat` == @var11)) && (v_delivery1.`defaultValueEnum` == @var12)) + SORT (v_delivery1.`deliveryNumber`) + LET v_country2 = (IS_NULL(v_delivery1.`destination`.`country`) ? null : FIRST(( + FOR v_country3 + IN @@countries + FILTER ((v_country3.`isoCode` > NULL) && (v_country3.`isoCode` == v_delivery1.`destination`.`country`)) + LIMIT @var13 + RETURN v_country3 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destination": (IS_NULL(v_delivery1.`destination`) ? null : { + "street": v_delivery1.`destination`.`street`, + "city": v_delivery1.`destination`.`city`, + "zipCode": v_delivery1.`destination`.`zipCode`, + "country": (IS_NULL(v_country2) ? null : { + "isoCode": v_country2.`isoCode` + }) + }), + "defaultValueString": v_delivery1.`defaultValueString`, + "defaultValueString2": v_delivery1.`defaultValueString2`, + "defaultValueInt": v_delivery1.`defaultValueInt`, + "defaultValueTrue": v_delivery1.`defaultValueTrue`, + "defaultValueFalse": v_delivery1.`defaultValueFalse`, + "defaultValueFloat": v_delivery1.`defaultValueFloat`, + "defaultValueEnum": v_delivery1.`defaultValueEnum` + } + ) +} diff --git a/spec/regression/logistics/tests/default-value/aql/createNewWithSomeOtherValuesOverwritten.aql b/spec/regression/logistics/tests/default-value/aql/createNewWithSomeOtherValuesOverwritten.aql new file mode 100644 index 000000000..567d1b03d --- /dev/null +++ b/spec/regression/logistics/tests/default-value/aql/createNewWithSomeOtherValuesOverwritten.aql @@ -0,0 +1,70 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +LET v_country1 = (IS_NULL(v_delivery1.`destination`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`destination`.`country`)) + LIMIT @var1 + RETURN v_country2 +))) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destination": (IS_NULL(v_delivery1.`destination`) ? null : { + "street": v_delivery1.`destination`.`street`, + "city": v_delivery1.`destination`.`city`, + "zipCode": v_delivery1.`destination`.`zipCode`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + }), + "defaultValueString": v_delivery1.`defaultValueString`, + "defaultValueString2": v_delivery1.`defaultValueString2`, + "defaultValueInt": v_delivery1.`defaultValueInt`, + "defaultValueTrue": v_delivery1.`defaultValueTrue`, + "defaultValueFalse": v_delivery1.`defaultValueFalse`, + "defaultValueFloat": v_delivery1.`defaultValueFloat`, + "defaultValueEnum": v_delivery1.`defaultValueEnum` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/default-value.result.json b/spec/regression/logistics/tests/default-value/result.json similarity index 100% rename from spec/regression/logistics/tests/default-value.result.json rename to spec/regression/logistics/tests/default-value/result.json diff --git a/spec/regression/logistics/tests/default-value.graphql b/spec/regression/logistics/tests/default-value/test.graphql similarity index 100% rename from spec/regression/logistics/tests/default-value.graphql rename to spec/regression/logistics/tests/default-value/test.graphql diff --git a/spec/regression/logistics/tests/delete-all-related/aql/addRelations.aql b/spec/regression/logistics/tests/delete-all-related/aql/addRelations.aql new file mode 100644 index 000000000..96ca11329 --- /dev/null +++ b/spec/regression/logistics/tests/delete-all-related/aql/addRelations.aql @@ -0,0 +1,131 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "hu1": @v_updateHandlingUnit1, + "hu2": @v_updateHandlingUnit2, + "hu3": @v_updateHandlingUnit3 +} diff --git a/spec/regression/logistics/tests/delete-all-related/aql/deleteByDelivery.aql b/spec/regression/logistics/tests/delete-all-related/aql/deleteByDelivery.aql new file mode 100644 index 000000000..e567a61fd --- /dev/null +++ b/spec/regression/logistics/tests/delete-all-related/aql/deleteByDelivery.aql @@ -0,0 +1,47 @@ +WITH @@deliveries +RETURN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + ))._key == @var1) + SORT (v_handlingUnit1.`huNumber`) + RETURN v_handlingUnit1._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_handlingUnit1 + IN ( + FOR v_handlingUnit2 + IN @v_ids1 + REMOVE v_handlingUnit2 + IN @@handlingUnits + RETURN OLD + ) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } +) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "deleteAllHandlingUnits": @v_deleteAllHandlingUnits1 +} diff --git a/spec/regression/logistics/tests/delete-all-related/aql/deliveries.aql b/spec/regression/logistics/tests/delete-all-related/aql/deliveries.aql new file mode 100644 index 000000000..794266e73 --- /dev/null +++ b/spec/regression/logistics/tests/delete-all-related/aql/deliveries.aql @@ -0,0 +1,20 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (v_handlingUnit1.`huNumber`) + LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/delete-all-related.result.json b/spec/regression/logistics/tests/delete-all-related/result.json similarity index 100% rename from spec/regression/logistics/tests/delete-all-related.result.json rename to spec/regression/logistics/tests/delete-all-related/result.json diff --git a/spec/regression/logistics/tests/delete-all-related.graphql b/spec/regression/logistics/tests/delete-all-related/test.graphql similarity index 100% rename from spec/regression/logistics/tests/delete-all-related.graphql rename to spec/regression/logistics/tests/delete-all-related/test.graphql diff --git a/spec/regression/logistics/tests/delete-all/aql/all.aql b/spec/regression/logistics/tests/delete-all/aql/all.aql new file mode 100644 index 000000000..7204091c5 --- /dev/null +++ b/spec/regression/logistics/tests/delete-all/aql/all.aql @@ -0,0 +1,59 @@ +RETURN ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1.`deliveryNumber` == @var1) || (v_delivery1.`deliveryNumber` == @var2)) + SORT (v_delivery1.`deliveryNumber`) + RETURN v_delivery1._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@onlyRelations_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@onlyRelations_deliveries +) + +// -------------------------------- + +RETURN ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @v_ids1 + REMOVE v_delivery2 + IN @@deliveries + RETURN OLD + ) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city` + }) + } +) + +// -------------------------------- + +RETURN { + "deleteAllDeliveries": @v_deleteAllDeliveries1 +} diff --git a/spec/regression/logistics/tests/delete-all/aql/all_no_relations.aql b/spec/regression/logistics/tests/delete-all/aql/all_no_relations.aql new file mode 100644 index 000000000..1dd6a11cd --- /dev/null +++ b/spec/regression/logistics/tests/delete-all/aql/all_no_relations.aql @@ -0,0 +1,20 @@ +RETURN ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@countries + FILTER (v_country2.`isoCode` == @var1) + REMOVE v_country2 + IN @@countries + RETURN OLD + ) + RETURN { + "isoCode": v_country1.`isoCode` + } +) + +// -------------------------------- + +RETURN { + "deleteAllCountries": @v_deleteAllCountries1 +} diff --git a/spec/regression/logistics/tests/delete-all/aql/onlyFirst.aql b/spec/regression/logistics/tests/delete-all/aql/onlyFirst.aql new file mode 100644 index 000000000..f6fc53159 --- /dev/null +++ b/spec/regression/logistics/tests/delete-all/aql/onlyFirst.aql @@ -0,0 +1,60 @@ +RETURN ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1.`deliveryNumber` == @var1) || (v_delivery1.`deliveryNumber` == @var2)) + SORT (v_delivery1.`deliveryNumber`) + LIMIT @var3 + RETURN v_delivery1._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@onlyRelations_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@onlyRelations_deliveries +) + +// -------------------------------- + +RETURN ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @v_ids1 + REMOVE v_delivery2 + IN @@deliveries + RETURN OLD + ) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city` + }) + } +) + +// -------------------------------- + +RETURN { + "deleteAllDeliveries": @v_deleteAllDeliveries1 +} diff --git a/spec/regression/logistics/tests/delete-all.context.json b/spec/regression/logistics/tests/delete-all/context.json similarity index 100% rename from spec/regression/logistics/tests/delete-all.context.json rename to spec/regression/logistics/tests/delete-all/context.json diff --git a/spec/regression/logistics/tests/delete-all.result.json b/spec/regression/logistics/tests/delete-all/result.json similarity index 100% rename from spec/regression/logistics/tests/delete-all.result.json rename to spec/regression/logistics/tests/delete-all/result.json diff --git a/spec/regression/logistics/tests/delete-all.graphql b/spec/regression/logistics/tests/delete-all/test.graphql similarity index 100% rename from spec/regression/logistics/tests/delete-all.graphql rename to spec/regression/logistics/tests/delete-all/test.graphql diff --git a/spec/regression/logistics/tests/delete-many/aql/onlyFirst.aql b/spec/regression/logistics/tests/delete-many/aql/onlyFirst.aql new file mode 100644 index 000000000..f03c62405 --- /dev/null +++ b/spec/regression/logistics/tests/delete-many/aql/onlyFirst.aql @@ -0,0 +1,68 @@ +WITH @@deliveries +RETURN ( + FOR v_item1 + IN [ + DOCUMENT(@@deliveries, @var1), + DOCUMENT(@@deliveries, @var2), + DOCUMENT(@@deliveries, @var3) + ] + FILTER (v_item1 > NULL) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@onlyRelations_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@onlyRelations_deliveries +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @v_ids1 + REMOVE v_delivery2 + IN @@deliveries + RETURN OLD + ) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city` + }) + } +) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "deleteDeliveries": @v_deleteDeliveries1 +} diff --git a/spec/regression/logistics/tests/delete-many.result.json b/spec/regression/logistics/tests/delete-many/result.json similarity index 100% rename from spec/regression/logistics/tests/delete-many.result.json rename to spec/regression/logistics/tests/delete-many/result.json diff --git a/spec/regression/logistics/tests/delete-many.graphql b/spec/regression/logistics/tests/delete-many/test.graphql similarity index 100% rename from spec/regression/logistics/tests/delete-many.graphql rename to spec/regression/logistics/tests/delete-many/test.graphql diff --git a/spec/regression/logistics/tests/deprecations.result.json b/spec/regression/logistics/tests/deprecations.result.json deleted file mode 100644 index 6865980a9..000000000 --- a/spec/regression/logistics/tests/deprecations.result.json +++ /dev/null @@ -1,1163 +0,0 @@ -{ - "data": { - "Delivery": { - "name": "Delivery", - "fields": [ - { - "name": "id", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "createdAt", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "updatedAt", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "deliveryNumber", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "serialNumbers", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "consignee", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "contentInfo", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "_contentInfoMeta", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "dgInfo", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "items", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "_itemsMeta", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "handlingUnits", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "_handlingUnitsMeta", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "destinationCountry", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "destinationCountryISOCode", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "completionDate", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "originCountry", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "shippedAt", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "totalValue", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "forwarder", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "destination", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueString", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueString2", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueInt", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueTrue", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueFalse", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueFloat", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "defaultValueEnum", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": [ - { - "name": "Foo", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "Bar", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "Baz", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - }, - { - "name": "dispatchDate", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "pickupDate", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "pickupTimeStart", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "pickupTimeEnd", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "dynamicData", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "description", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "colorData", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "enumFlexSearch", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": [ - { - "name": "Foo", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "Bar", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "Baz", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - }, - { - "name": "aText", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "aNumber", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "recursion", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "processingFinished", - "isDeprecated": false, - "deprecationReason": null, - "type": { "enumValues": null } - }, - { - "name": "deprecatedField", - "isDeprecated": true, - "deprecationReason": "do not use", - "type": { - "enumValues": null - } - }, - { - "name": "enumWithDeprecation", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": [ - { - "name": "A", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "B", - "isDeprecated": true, - "deprecationReason": "do not use B" - } - ] - } - }, - { - "name": "sometimesNull", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "caseInsensitiveField", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "_cursor", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - }, - { - "name": "_revision", - "isDeprecated": false, - "deprecationReason": null, - "type": { - "enumValues": null - } - } - ] - }, - "DeliveryOrderBy": { - "name": "DeliveryOrderBy", - "enumValues": [ - { - "name": "id_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deliveryNumber_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deliveryNumber_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_street_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_street_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_city_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_city_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_zipCode_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_zipCode_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "consignee_country_id_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_id_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_createdAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_createdAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_updatedAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_updatedAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_isoCode_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_isoCode_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_descriptionI18nString_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_descriptionI18nString_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_totalInvestment_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_totalInvestment_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_someKey_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "consignee_country_someKey_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "dgInfo_unNumber_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_unNumber_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_flashpoint_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_flashpoint_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_details_expiryDate_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_details_expiryDate_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_details_comment_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dgInfo_details_comment_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destinationCountry_id_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_id_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_createdAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_createdAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_updatedAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_updatedAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_isoCode_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_isoCode_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_descriptionI18nString_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_descriptionI18nString_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_totalInvestment_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_totalInvestment_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_someKey_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountry_someKey_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destinationCountryISOCode_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "completionDate_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "completionDate_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "originCountry_id_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_id_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_createdAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_createdAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_updatedAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_updatedAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_isoCode_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_isoCode_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_descriptionI18nString_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_descriptionI18nString_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_totalInvestment_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_totalInvestment_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_someKey_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "originCountry_someKey_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "shippedAt_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippedAt_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalValue_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalValue_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "forwarder_id_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_id_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_createdAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_createdAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_updatedAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_updatedAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_name_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "forwarder_name_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_street_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_street_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_city_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_city_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_zipCode_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_zipCode_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "destination_country_id_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_id_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_createdAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_createdAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_updatedAt_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_updatedAt_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_isoCode_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_isoCode_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_descriptionI18nString_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_descriptionI18nString_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_totalInvestment_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_totalInvestment_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_someKey_ASC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "destination_country_someKey_DESC", - "isDeprecated": true, - "deprecationReason": "OrderBy values that include relations or references are deprecated" - }, - { - "name": "defaultValueString_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueString_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueString2_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueString2_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueInt_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueInt_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueTrue_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueTrue_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueFalse_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueFalse_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueFloat_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueFloat_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueEnum_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValueEnum_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dispatchDate_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dispatchDate_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupDate_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupDate_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupTimeStart_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupTimeStart_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dynamicData_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "dynamicData_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "colorData_packageColor_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "colorData_packageColor_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumFlexSearch_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumFlexSearch_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aText_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aText_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aNumber_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "aNumber_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "recursion_recursion_name_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "recursion_recursion_name_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "recursion_name_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "recursion_name_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "processingFinished_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "processingFinished_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecatedField_ASC", - "isDeprecated": true, - "deprecationReason": "do not use" - }, - { - "name": "deprecatedField_DESC", - "isDeprecated": true, - "deprecationReason": "do not use" - }, - { - "name": "enumWithDeprecation_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumWithDeprecation_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sometimesNull_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sometimesNull_DESC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_ASC", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_DESC", - "isDeprecated": false, - "deprecationReason": null - } - ] - } - } -} diff --git a/spec/regression/logistics/tests/deprecations/result.json b/spec/regression/logistics/tests/deprecations/result.json new file mode 100644 index 000000000..1f2eb1e6b --- /dev/null +++ b/spec/regression/logistics/tests/deprecations/result.json @@ -0,0 +1,1167 @@ +{ + "deprecations": { + "data": { + "Delivery": { + "name": "Delivery", + "fields": [ + { + "name": "id", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "createdAt", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "updatedAt", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "deliveryNumber", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "serialNumbers", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "consignee", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "contentInfo", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "_contentInfoMeta", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "dgInfo", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "items", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "_itemsMeta", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "handlingUnits", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "_handlingUnitsMeta", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "destinationCountry", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "destinationCountryISOCode", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "completionDate", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "originCountry", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "shippedAt", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "totalValue", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "forwarder", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "destination", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueString", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueString2", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueInt", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueTrue", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueFalse", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueFloat", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "defaultValueEnum", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": [ + { + "name": "Foo", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "Bar", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "Baz", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + }, + { + "name": "dispatchDate", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "pickupDate", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "pickupTimeStart", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "pickupTimeEnd", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "dynamicData", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "description", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "colorData", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "enumFlexSearch", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": [ + { + "name": "Foo", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "Bar", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "Baz", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + }, + { + "name": "aText", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "aNumber", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "recursion", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "processingFinished", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "deprecatedField", + "isDeprecated": true, + "deprecationReason": "do not use", + "type": { + "enumValues": null + } + }, + { + "name": "enumWithDeprecation", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": [ + { + "name": "A", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "B", + "isDeprecated": true, + "deprecationReason": "do not use B" + } + ] + } + }, + { + "name": "sometimesNull", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "caseInsensitiveField", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "_cursor", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + }, + { + "name": "_revision", + "isDeprecated": false, + "deprecationReason": null, + "type": { + "enumValues": null + } + } + ] + }, + "DeliveryOrderBy": { + "name": "DeliveryOrderBy", + "enumValues": [ + { + "name": "id_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryNumber_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryNumber_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_street_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_street_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_city_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_city_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_zipCode_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_zipCode_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consignee_country_id_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_id_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_createdAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_createdAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_updatedAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_updatedAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_isoCode_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_isoCode_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_descriptionI18nString_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_descriptionI18nString_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_totalInvestment_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_totalInvestment_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_someKey_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "consignee_country_someKey_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "dgInfo_unNumber_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_unNumber_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_flashpoint_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_flashpoint_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_details_expiryDate_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_details_expiryDate_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_details_comment_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dgInfo_details_comment_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destinationCountry_id_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_id_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_createdAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_createdAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_updatedAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_updatedAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_isoCode_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_isoCode_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_descriptionI18nString_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_descriptionI18nString_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_totalInvestment_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_totalInvestment_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_someKey_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountry_someKey_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destinationCountryISOCode_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "completionDate_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "completionDate_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "originCountry_id_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_id_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_createdAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_createdAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_updatedAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_updatedAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_isoCode_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_isoCode_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_descriptionI18nString_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_descriptionI18nString_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_totalInvestment_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_totalInvestment_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_someKey_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "originCountry_someKey_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "shippedAt_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippedAt_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalValue_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalValue_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forwarder_id_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_id_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_createdAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_createdAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_updatedAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_updatedAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_name_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "forwarder_name_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_street_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_street_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_city_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_city_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_zipCode_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_zipCode_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "destination_country_id_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_id_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_createdAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_createdAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_updatedAt_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_updatedAt_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_isoCode_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_isoCode_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_descriptionI18nString_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_descriptionI18nString_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_totalInvestment_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_totalInvestment_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_someKey_ASC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "destination_country_someKey_DESC", + "isDeprecated": true, + "deprecationReason": "OrderBy values that include relations or references are deprecated" + }, + { + "name": "defaultValueString_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueString_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueString2_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueString2_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueInt_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueInt_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueTrue_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueTrue_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueFalse_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueFalse_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueFloat_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueFloat_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueEnum_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValueEnum_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dispatchDate_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dispatchDate_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupDate_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupDate_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupTimeStart_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupTimeStart_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dynamicData_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dynamicData_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "colorData_packageColor_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "colorData_packageColor_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumFlexSearch_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumFlexSearch_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aText_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aText_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aNumber_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aNumber_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recursion_recursion_name_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recursion_recursion_name_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recursion_name_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recursion_name_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "processingFinished_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "processingFinished_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecatedField_ASC", + "isDeprecated": true, + "deprecationReason": "do not use" + }, + { + "name": "deprecatedField_DESC", + "isDeprecated": true, + "deprecationReason": "do not use" + }, + { + "name": "enumWithDeprecation_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumWithDeprecation_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sometimesNull_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sometimesNull_DESC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_ASC", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_DESC", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + } + } +} diff --git a/spec/regression/logistics/tests/deprecations.graphql b/spec/regression/logistics/tests/deprecations/test.graphql similarity index 96% rename from spec/regression/logistics/tests/deprecations.graphql rename to spec/regression/logistics/tests/deprecations/test.graphql index 3e40bb7f5..56668e9f2 100644 --- a/spec/regression/logistics/tests/deprecations.graphql +++ b/spec/regression/logistics/tests/deprecations/test.graphql @@ -1,4 +1,4 @@ -{ +query deprecations { Delivery: __type(name: "Delivery") { name fields(includeDeprecated: true) { diff --git a/spec/regression/logistics/tests/descriptions.result.json b/spec/regression/logistics/tests/descriptions.result.json deleted file mode 100644 index 01d51c6f1..000000000 --- a/spec/regression/logistics/tests/descriptions.result.json +++ /dev/null @@ -1,9719 +0,0 @@ -{ - "data": { - "__schema": { - "types": [ - { - "name": "BillingEntity", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "isConfirmedForExport", - "description": null, - "deprecationReason": null - }, - { - "name": "isExported", - "description": null, - "deprecationReason": null - }, - { - "name": "confirmedForExportAt", - "description": null, - "deprecationReason": null - }, - { - "name": "exportedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "ID", - "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", - "fields": null, - "inputFields": null - }, - { - "name": "DateTime", - "description": "The `DateTime` scalar type represents a point in time in UTC, in a format specified by ISO 8601, such as `2007-12-03T10:15:30Z` or `2007-12-03T10:15:30.123Z`.\n\nThis scalar type rejects values without timezone specifier or with a timezone other than UTC. See also `LocalDate` and `LocalTime` for values without timezone specifier. To store Date/time values with timezones other than UTC, define a value object type with the fields you need.\n\nThe *second* part is added if not specified, e.g. `2007-12-03T12:34Z` is converted to `2007-12-03T12:34:00Z`. Second fraction digits are cut off at the nearest three-digit group, e.g. `2007-12-03T00:00:00.1234Z` is converted to `2007-12-03T00:00:00.123400Z`.\n\nValues with leap seconds are shifted back by one second, but this behavior should not be relied upon.", - "fields": null, - "inputFields": null - }, - { - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null - }, - { - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null - }, - { - "name": "BillingEntityFilter", - "description": "Filter type for BillingEntity.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "key", - "description": "Checks if `key` equals a specified string, case-sensitively.\n\nIf an index exists on `key`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "key_not", - "description": "Checks if `key` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_in", - "description": "Checks if `key` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "key_not_in", - "description": "Checks if `key` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "key_lt", - "description": "Checks if `key` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "key_lte", - "description": "Checks if `key` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "key_gt", - "description": "Checks if `key` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "key_gte", - "description": "Checks if `key` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "key_contains", - "description": "Checks if `key` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_not_contains", - "description": "Checks if `key` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_starts_with", - "description": "Checks if `key` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "key_not_starts_with", - "description": "Checks if `key` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "key_ends_with", - "description": "Checks if `key` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_not_ends_with", - "description": "Checks if `key` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_like", - "description": "Matches `key` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `key`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "key_not_like", - "description": "Checks if `key` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "type", - "description": "Checks if `type` equals a specified string, case-sensitively.\n\nIf an index exists on `type`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "type_not", - "description": "Checks if `type` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "type_in", - "description": "Checks if `type` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "type_not_in", - "description": "Checks if `type` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "type_lt", - "description": "Checks if `type` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "type_lte", - "description": "Checks if `type` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "type_gt", - "description": "Checks if `type` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "type_gte", - "description": "Checks if `type` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "type_contains", - "description": "Checks if `type` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "type_not_contains", - "description": "Checks if `type` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "type_starts_with", - "description": "Checks if `type` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "type_not_starts_with", - "description": "Checks if `type` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "type_ends_with", - "description": "Checks if `type` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "type_not_ends_with", - "description": "Checks if `type` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "type_like", - "description": "Matches `type` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `type`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "type_not_like", - "description": "Checks if `type` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "isConfirmedForExport", - "description": "Checks if `isConfirmedForExport` equals a specified value.\n\nIf an index exists on `isConfirmedForExport`, it can be used.", - "deprecationReason": null - }, - { - "name": "isConfirmedForExport_not", - "description": "Checks if `isConfirmedForExport` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "isExported", - "description": "Checks if `isExported` equals a specified value.\n\nIf an index exists on `isExported`, it can be used.", - "deprecationReason": null - }, - { - "name": "isExported_not", - "description": "Checks if `isExported` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt", - "description": "Checks if `confirmedForExportAt` equals a specified value.\n\nIf an index exists on `confirmedForExportAt`, it can be used.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_not", - "description": "Checks if `confirmedForExportAt` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_in", - "description": "Checks if `confirmedForExportAt` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_not_in", - "description": "Checks if `confirmedForExportAt` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_lt", - "description": "Checks if `confirmedForExportAt` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_lte", - "description": "Checks if `confirmedForExportAt` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_gt", - "description": "Checks if `confirmedForExportAt` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "confirmedForExportAt_gte", - "description": "Checks if `confirmedForExportAt` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "exportedAt", - "description": "Checks if `exportedAt` equals a specified value.\n\nIf an index exists on `exportedAt`, it can be used.", - "deprecationReason": null - }, - { - "name": "exportedAt_not", - "description": "Checks if `exportedAt` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "exportedAt_in", - "description": "Checks if `exportedAt` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "exportedAt_not_in", - "description": "Checks if `exportedAt` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "exportedAt_lt", - "description": "Checks if `exportedAt` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "exportedAt_lte", - "description": "Checks if `exportedAt` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "exportedAt_gt", - "description": "Checks if `exportedAt` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "exportedAt_gte", - "description": "Checks if `exportedAt` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "BillingEntityOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "fields": null, - "inputFields": null - }, - { - "name": "_QueryMeta", - "description": "Provides aggregated information about a collection or list", - "fields": [ - { - "name": "count", - "description": "The number of items in the collection or list, after applying the filter if specified.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Country", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "isoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "_descriptionMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "descriptionI18nString", - "description": null, - "deprecationReason": null - }, - { - "name": "totalInvestment", - "description": null, - "deprecationReason": null - }, - { - "name": "someKey", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Translation", - "description": null, - "fields": [ - { - "name": "languageIsoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "translation", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "TranslationFilter", - "description": "Filter type for Translation.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "languageIsoCode", - "description": "Checks if `languageIsoCode` equals a specified string, case-sensitively.\n\nIf an index exists on `languageIsoCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not", - "description": "Checks if `languageIsoCode` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_in", - "description": "Checks if `languageIsoCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not_in", - "description": "Checks if `languageIsoCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_lt", - "description": "Checks if `languageIsoCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_lte", - "description": "Checks if `languageIsoCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_gt", - "description": "Checks if `languageIsoCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_gte", - "description": "Checks if `languageIsoCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_contains", - "description": "Checks if `languageIsoCode` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not_contains", - "description": "Checks if `languageIsoCode` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_starts_with", - "description": "Checks if `languageIsoCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not_starts_with", - "description": "Checks if `languageIsoCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_ends_with", - "description": "Checks if `languageIsoCode` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not_ends_with", - "description": "Checks if `languageIsoCode` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "languageIsoCode_like", - "description": "Matches `languageIsoCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `languageIsoCode`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "languageIsoCode_not_like", - "description": "Checks if `languageIsoCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "translation", - "description": "Checks if `translation` equals a specified string, case-sensitively.\n\nIf an index exists on `translation`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "translation_not", - "description": "Checks if `translation` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "translation_in", - "description": "Checks if `translation` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "translation_not_in", - "description": "Checks if `translation` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "translation_lt", - "description": "Checks if `translation` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "translation_lte", - "description": "Checks if `translation` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "translation_gt", - "description": "Checks if `translation` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "translation_gte", - "description": "Checks if `translation` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "translation_contains", - "description": "Checks if `translation` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "translation_not_contains", - "description": "Checks if `translation` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "translation_starts_with", - "description": "Checks if `translation` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "translation_not_starts_with", - "description": "Checks if `translation` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "translation_ends_with", - "description": "Checks if `translation` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "translation_not_ends_with", - "description": "Checks if `translation` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "translation_like", - "description": "Matches `translation` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `translation`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "translation_not_like", - "description": "Checks if `translation` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "TranslationOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "I18nString", - "description": "The \"I18nString\" scalar type represents an internationalized string.\n\n Structurally, the \"I18nString`\" type is equivalent to the \"StringMap\" type. Keys are ISO 639-1 language codes, and values are the localized strings. In the future, more specific features may be added to this type, so it is preferred over the \"StringMap\" type to represent internationalized strings.\n\n Values are *not* additionally JSON-encoded or JSON-parsed, so e.g. pass a raw JSON object here instead of a JSON-representation of that object.", - "fields": null, - "inputFields": null - }, - { - "name": "CountryFilter", - "description": "Filter type for Country.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "isoCode", - "description": "Checks if `isoCode` equals a specified string, case-sensitively.\n\nIf an index exists on `isoCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "isoCode_not", - "description": "Checks if `isoCode` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_in", - "description": "Checks if `isoCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "isoCode_not_in", - "description": "Checks if `isoCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "isoCode_lt", - "description": "Checks if `isoCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_lte", - "description": "Checks if `isoCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_gt", - "description": "Checks if `isoCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_gte", - "description": "Checks if `isoCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_contains", - "description": "Checks if `isoCode` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_not_contains", - "description": "Checks if `isoCode` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_starts_with", - "description": "Checks if `isoCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "isoCode_not_starts_with", - "description": "Checks if `isoCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "isoCode_ends_with", - "description": "Checks if `isoCode` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_not_ends_with", - "description": "Checks if `isoCode` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_like", - "description": "Matches `isoCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `isoCode`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "isoCode_not_like", - "description": "Checks if `isoCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "description_some", - "description": "Makes sure at least one of the items in \"description\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", - "deprecationReason": null - }, - { - "name": "description_every", - "description": "Makes sure all items in `description` match a certain filter.", - "deprecationReason": null - }, - { - "name": "description_none", - "description": "Makes sure none of the items in `description` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has no items.", - "deprecationReason": null - }, - { - "name": "description_empty", - "description": "Checks if `description` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "descriptionI18nString_some", - "description": "Makes sure at least one of the entries in \"descriptionI18nString\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `descriptionI18nString` has at least one item.", - "deprecationReason": null - }, - { - "name": "totalInvestment", - "description": "Checks if `totalInvestment` equals a specified string, case-sensitively.\n\nIf an index exists on `totalInvestment`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "totalInvestment_not", - "description": "Checks if `totalInvestment` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalInvestment_in", - "description": "Checks if `totalInvestment` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "totalInvestment_not_in", - "description": "Checks if `totalInvestment` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "totalInvestment_lt", - "description": "Checks if `totalInvestment` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "totalInvestment_lte", - "description": "Checks if `totalInvestment` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "totalInvestment_gt", - "description": "Checks if `totalInvestment` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "totalInvestment_gte", - "description": "Checks if `totalInvestment` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "totalInvestment_contains", - "description": "Checks if `totalInvestment` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalInvestment_not_contains", - "description": "Checks if `totalInvestment` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalInvestment_starts_with", - "description": "Checks if `totalInvestment` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "totalInvestment_not_starts_with", - "description": "Checks if `totalInvestment` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "totalInvestment_ends_with", - "description": "Checks if `totalInvestment` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalInvestment_not_ends_with", - "description": "Checks if `totalInvestment` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalInvestment_like", - "description": "Matches `totalInvestment` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `totalInvestment`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "totalInvestment_not_like", - "description": "Checks if `totalInvestment` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "someKey", - "description": "Checks if `someKey` equals a specified string, case-sensitively.\n\nIf an index exists on `someKey`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "someKey_not", - "description": "Checks if `someKey` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "someKey_in", - "description": "Checks if `someKey` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "someKey_not_in", - "description": "Checks if `someKey` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "someKey_lt", - "description": "Checks if `someKey` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_lte", - "description": "Checks if `someKey` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_gt", - "description": "Checks if `someKey` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_gte", - "description": "Checks if `someKey` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_contains", - "description": "Checks if `someKey` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "someKey_not_contains", - "description": "Checks if `someKey` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "someKey_starts_with", - "description": "Checks if `someKey` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "someKey_not_starts_with", - "description": "Checks if `someKey` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "someKey_ends_with", - "description": "Checks if `someKey` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "someKey_not_ends_with", - "description": "Checks if `someKey` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "someKey_like", - "description": "Matches `someKey` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `someKey`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "someKey_not_like", - "description": "Checks if `someKey` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "I18nStringEntryFilter", - "description": "Filter type for entries in a I18nString.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "language", - "description": "Checks if `language` equals a specified string, case-sensitively.\n\nIf an index exists on `language`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "language_not", - "description": "Checks if `language` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "language_in", - "description": "Checks if `language` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "language_not_in", - "description": "Checks if `language` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "language_lt", - "description": "Checks if `language` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "language_lte", - "description": "Checks if `language` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "language_gt", - "description": "Checks if `language` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "language_gte", - "description": "Checks if `language` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "language_contains", - "description": "Checks if `language` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "language_not_contains", - "description": "Checks if `language` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "language_starts_with", - "description": "Checks if `language` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "language_not_starts_with", - "description": "Checks if `language` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "language_ends_with", - "description": "Checks if `language` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "language_not_ends_with", - "description": "Checks if `language` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "language_like", - "description": "Matches `language` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `language`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "language_not_like", - "description": "Checks if `language` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "value", - "description": "Checks if `value` equals a specified string, case-sensitively.\n\nIf an index exists on `value`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "value_not", - "description": "Checks if `value` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_in", - "description": "Checks if `value` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "value_not_in", - "description": "Checks if `value` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "value_lt", - "description": "Checks if `value` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "value_lte", - "description": "Checks if `value` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "value_gt", - "description": "Checks if `value` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "value_gte", - "description": "Checks if `value` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "value_contains", - "description": "Checks if `value` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_not_contains", - "description": "Checks if `value` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_starts_with", - "description": "Checks if `value` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "value_not_starts_with", - "description": "Checks if `value` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "value_ends_with", - "description": "Checks if `value` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_not_ends_with", - "description": "Checks if `value` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_like", - "description": "Matches `value` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `value`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "value_not_like", - "description": "Checks if `value` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "CountryOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "CountryFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "isoCode", - "description": "Checks if `isoCode` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_not", - "description": "Checks if `isoCode` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_lt", - "description": "Checks if `isoCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_lte", - "description": "Checks if `isoCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_gt", - "description": "Checks if `isoCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_gte", - "description": "Checks if `isoCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "isoCode_in", - "description": "Checks if `isoCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "isoCode_not_in", - "description": "Checks if `isoCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "isoCode_starts_with", - "description": "Checks if `isoCode` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "isoCode_not_starts_with", - "description": "Checks if `isoCode` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "someKey", - "description": "Checks if `someKey` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "someKey_not", - "description": "Checks if `someKey` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "someKey_lt", - "description": "Checks if `someKey` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_lte", - "description": "Checks if `someKey` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_gt", - "description": "Checks if `someKey` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_gte", - "description": "Checks if `someKey` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "someKey_in", - "description": "Checks if `someKey` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "someKey_not_in", - "description": "Checks if `someKey` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "someKey_starts_with", - "description": "Checks if `someKey` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "someKey_not_starts_with", - "description": "Checks if `someKey` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "Delivery", - "description": "A delivery", - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "deliveryNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "serialNumbers", - "description": "The list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "The address of the delivery's consignee", - "deprecationReason": null - }, - { - "name": "contentInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "_contentInfoMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "items", - "description": null, - "deprecationReason": null - }, - { - "name": "_itemsMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "handlingUnits", - "description": "The handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "_handlingUnitsMeta", - "description": "The handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "destinationCountry", - "description": "The country to where the delivery should be shipped\n\nThis field references a `Country` by its `isoCode` field", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode", - "description": null, - "deprecationReason": null - }, - { - "name": "completionDate", - "description": null, - "deprecationReason": null - }, - { - "name": "originCountry", - "description": "This field references a `Country` by its `isoCode` field", - "deprecationReason": null - }, - { - "name": "shippedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "totalValue", - "description": null, - "deprecationReason": null - }, - { - "name": "forwarder", - "description": null, - "deprecationReason": null - }, - { - "name": "destination", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString2", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueInt", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueTrue", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFalse", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFloat", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueEnum", - "description": null, - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeStart", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd", - "description": null, - "deprecationReason": null - }, - { - "name": "dynamicData", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "colorData", - "description": null, - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": null, - "deprecationReason": null - }, - { - "name": "aText", - "description": null, - "deprecationReason": null - }, - { - "name": "aNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { "name": "processingFinished", "description": null, "deprecationReason": null }, - { - "name": "deprecatedField", - "description": null, - "deprecationReason": "do not use" - }, - { - "name": "enumWithDeprecation", - "description": null, - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": null, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Address", - "description": null, - "fields": [ - { - "name": "street", - "description": null, - "deprecationReason": null - }, - { - "name": "city", - "description": null, - "deprecationReason": null - }, - { - "name": "zipCode", - "description": null, - "deprecationReason": null - }, - { - "name": "country", - "description": "This field references a `Country` by its `isoCode` field", - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "DangerousGoodsInfo", - "description": null, - "fields": [ - { - "name": "unNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "flashpoint", - "description": null, - "deprecationReason": null - }, - { - "name": "notices", - "description": null, - "deprecationReason": null - }, - { - "name": "details", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "DangerousGoodsDetails", - "description": null, - "fields": [ - { - "name": "expiryDate", - "description": null, - "deprecationReason": null - }, - { - "name": "comment", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "LocalDate", - "description": "The `LocalDate` scalar type represents a date without time zone in a format specified by ISO 8601, such as 2007-12-03.", - "fields": null, - "inputFields": null - }, - { - "name": "DeliveryItem", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "itemNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "quantity", - "description": null, - "deprecationReason": null - }, - { - "name": "weightInKg", - "description": null, - "deprecationReason": null - }, - { - "name": "handlingUnit", - "description": "This field references a `HandlingUnit` by its `id` field", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Float", - "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", - "fields": null, - "inputFields": null - }, - { - "name": "HandlingUnit", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "huNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "delivery", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "DeliveryItemFilter", - "description": "Filter type for DeliveryItem.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "itemNumber", - "description": "Checks if `itemNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `itemNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "itemNumber_not", - "description": "Checks if `itemNumber` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "itemNumber_in", - "description": "Checks if `itemNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_in", - "description": "Checks if `itemNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "itemNumber_lt", - "description": "Checks if `itemNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "itemNumber_lte", - "description": "Checks if `itemNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "itemNumber_gt", - "description": "Checks if `itemNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "itemNumber_gte", - "description": "Checks if `itemNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "itemNumber_contains", - "description": "Checks if `itemNumber` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains", - "description": "Checks if `itemNumber` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "itemNumber_starts_with", - "description": "Checks if `itemNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_starts_with", - "description": "Checks if `itemNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "itemNumber_ends_with", - "description": "Checks if `itemNumber` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_ends_with", - "description": "Checks if `itemNumber` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "itemNumber_like", - "description": "Matches `itemNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `itemNumber`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "itemNumber_not_like", - "description": "Checks if `itemNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "quantity", - "description": "Checks if `quantity` equals a specified value.\n\nIf an index exists on `quantity`, it can be used.", - "deprecationReason": null - }, - { - "name": "quantity_not", - "description": "Checks if `quantity` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "quantity_in", - "description": "Checks if `quantity` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "quantity_not_in", - "description": "Checks if `quantity` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "quantity_lt", - "description": "Checks if `quantity` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_lte", - "description": "Checks if `quantity` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_gt", - "description": "Checks if `quantity` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_gte", - "description": "Checks if `quantity` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "weightInKg", - "description": "Checks if `weightInKg` equals a specified value.\n\nIf an index exists on `weightInKg`, it can be used.", - "deprecationReason": null - }, - { - "name": "weightInKg_not", - "description": "Checks if `weightInKg` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "weightInKg_in", - "description": "Checks if `weightInKg` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "weightInKg_not_in", - "description": "Checks if `weightInKg` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "weightInKg_lt", - "description": "Checks if `weightInKg` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "weightInKg_lte", - "description": "Checks if `weightInKg` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "weightInKg_gt", - "description": "Checks if `weightInKg` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "weightInKg_gte", - "description": "Checks if `weightInKg` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "handlingUnit", - "description": "Filters the through `id` referenced HandlingUnits that fulfills the given requirements.\n\n Checks if `handlingUnit` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "description_some", - "description": "Makes sure at least one of the entries in \"description\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "HandlingUnitFilter", - "description": "Filter type for HandlingUnit.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "huNumber", - "description": "Checks if `huNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `huNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "huNumber_not", - "description": "Checks if `huNumber` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_in", - "description": "Checks if `huNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "huNumber_not_in", - "description": "Checks if `huNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "huNumber_lt", - "description": "Checks if `huNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_lte", - "description": "Checks if `huNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_gt", - "description": "Checks if `huNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_gte", - "description": "Checks if `huNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_contains", - "description": "Checks if `huNumber` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_not_contains", - "description": "Checks if `huNumber` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_starts_with", - "description": "Checks if `huNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "huNumber_not_starts_with", - "description": "Checks if `huNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "huNumber_ends_with", - "description": "Checks if `huNumber` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_not_ends_with", - "description": "Checks if `huNumber` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_like", - "description": "Matches `huNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `huNumber`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "huNumber_not_like", - "description": "Checks if `huNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "delivery", - "description": "Checks if `delivery` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "DeliveryFilter", - "description": "Filter type for Delivery.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "deliveryNumber", - "description": "Checks if `deliveryNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `deliveryNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not", - "description": "Checks if `deliveryNumber` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_in", - "description": "Checks if `deliveryNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_in", - "description": "Checks if `deliveryNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_lt", - "description": "Checks if `deliveryNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_lte", - "description": "Checks if `deliveryNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_gt", - "description": "Checks if `deliveryNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_gte", - "description": "Checks if `deliveryNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_contains", - "description": "Checks if `deliveryNumber` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_contains", - "description": "Checks if `deliveryNumber` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_starts_with", - "description": "Checks if `deliveryNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_starts_with", - "description": "Checks if `deliveryNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_ends_with", - "description": "Checks if `deliveryNumber` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_ends_with", - "description": "Checks if `deliveryNumber` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_like", - "description": "Matches `deliveryNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `deliveryNumber`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_like", - "description": "Checks if `deliveryNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "serialNumbers_some", - "description": "Makes sure at least one of the items in \"serialNumbers\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `serialNumbers` has at least one item.", - "deprecationReason": null - }, - { - "name": "serialNumbers_every", - "description": "Makes sure all items in `serialNumbers` match a certain filter.", - "deprecationReason": null - }, - { - "name": "serialNumbers_none", - "description": "Makes sure none of the items in `serialNumbers` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `serialNumbers` has no items.", - "deprecationReason": null - }, - { - "name": "serialNumbers_empty", - "description": "Checks if `serialNumbers` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "Checks if `consignee` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "contentInfo_some", - "description": "Makes sure at least one of the items in \"contentInfo\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `contentInfo` has at least one item.", - "deprecationReason": null - }, - { - "name": "contentInfo_every", - "description": "Makes sure all items in `contentInfo` match a certain filter.", - "deprecationReason": null - }, - { - "name": "contentInfo_none", - "description": "Makes sure none of the items in `contentInfo` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `contentInfo` has no items.", - "deprecationReason": null - }, - { - "name": "contentInfo_empty", - "description": "Checks if `contentInfo` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "items_some", - "description": "Makes sure at least one of the items in \"items\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `items` has at least one item.", - "deprecationReason": null - }, - { - "name": "items_every", - "description": "Makes sure all items in `items` match a certain filter.", - "deprecationReason": null - }, - { - "name": "items_none", - "description": "Makes sure none of the items in `items` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `items` has no items.", - "deprecationReason": null - }, - { - "name": "items_empty", - "description": "Checks if `items` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "handlingUnits_some", - "description": "Makes sure at least one of the items in \"handlingUnits\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `handlingUnits` has at least one item.", - "deprecationReason": null - }, - { - "name": "handlingUnits_every", - "description": "Makes sure all items in `handlingUnits` match a certain filter.", - "deprecationReason": null - }, - { - "name": "handlingUnits_none", - "description": "Makes sure none of the items in `handlingUnits` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `handlingUnits` has no items.", - "deprecationReason": null - }, - { - "name": "handlingUnits_empty", - "description": "Checks if `handlingUnits` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "destinationCountry", - "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `destinationCountry` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode", - "description": "Checks if `destinationCountryISOCode` equals a specified string, case-sensitively.\n\nIf an index exists on `destinationCountryISOCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not", - "description": "Checks if `destinationCountryISOCode` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_in", - "description": "Checks if `destinationCountryISOCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_in", - "description": "Checks if `destinationCountryISOCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_lt", - "description": "Checks if `destinationCountryISOCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_lte", - "description": "Checks if `destinationCountryISOCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_gt", - "description": "Checks if `destinationCountryISOCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_gte", - "description": "Checks if `destinationCountryISOCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_contains", - "description": "Checks if `destinationCountryISOCode` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_contains", - "description": "Checks if `destinationCountryISOCode` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_starts_with", - "description": "Checks if `destinationCountryISOCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_starts_with", - "description": "Checks if `destinationCountryISOCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_ends_with", - "description": "Checks if `destinationCountryISOCode` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_ends_with", - "description": "Checks if `destinationCountryISOCode` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_like", - "description": "Matches `destinationCountryISOCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `destinationCountryISOCode`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_like", - "description": "Checks if `destinationCountryISOCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "completionDate", - "description": "Checks if `completionDate` equals a specified value.\n\nIf an index exists on `completionDate`, it can be used.", - "deprecationReason": null - }, - { - "name": "completionDate_not", - "description": "Checks if `completionDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "completionDate_in", - "description": "Checks if `completionDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "completionDate_not_in", - "description": "Checks if `completionDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "completionDate_lt", - "description": "Checks if `completionDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_lte", - "description": "Checks if `completionDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_gt", - "description": "Checks if `completionDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_gte", - "description": "Checks if `completionDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "originCountry", - "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `originCountry` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "shippedAt", - "description": "Checks if `shippedAt` equals a specified value.\n\nIf an index exists on `shippedAt`, it can be used.", - "deprecationReason": null - }, - { - "name": "shippedAt_not", - "description": "Checks if `shippedAt` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "shippedAt_in", - "description": "Checks if `shippedAt` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "shippedAt_not_in", - "description": "Checks if `shippedAt` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "shippedAt_lt", - "description": "Checks if `shippedAt` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "shippedAt_lte", - "description": "Checks if `shippedAt` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "shippedAt_gt", - "description": "Checks if `shippedAt` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "shippedAt_gte", - "description": "Checks if `shippedAt` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "totalValue", - "description": "Checks if `totalValue` equals a specified string, case-sensitively.\n\nIf an index exists on `totalValue`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "totalValue_not", - "description": "Checks if `totalValue` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalValue_in", - "description": "Checks if `totalValue` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "totalValue_not_in", - "description": "Checks if `totalValue` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "totalValue_lt", - "description": "Checks if `totalValue` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "totalValue_lte", - "description": "Checks if `totalValue` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "totalValue_gt", - "description": "Checks if `totalValue` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "totalValue_gte", - "description": "Checks if `totalValue` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "totalValue_contains", - "description": "Checks if `totalValue` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalValue_not_contains", - "description": "Checks if `totalValue` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalValue_starts_with", - "description": "Checks if `totalValue` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "totalValue_not_starts_with", - "description": "Checks if `totalValue` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "totalValue_ends_with", - "description": "Checks if `totalValue` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalValue_not_ends_with", - "description": "Checks if `totalValue` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "totalValue_like", - "description": "Matches `totalValue` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `totalValue`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "totalValue_not_like", - "description": "Checks if `totalValue` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "forwarder", - "description": "Checks if `forwarder` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "destination", - "description": "Checks if `destination` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "defaultValueString", - "description": "Checks if `defaultValueString` equals a specified string, case-sensitively.\n\nIf an index exists on `defaultValueString`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "defaultValueString_not", - "description": "Checks if `defaultValueString` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString_in", - "description": "Checks if `defaultValueString` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueString_not_in", - "description": "Checks if `defaultValueString` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueString_lt", - "description": "Checks if `defaultValueString` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString_lte", - "description": "Checks if `defaultValueString` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString_gt", - "description": "Checks if `defaultValueString` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString_gte", - "description": "Checks if `defaultValueString` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString_contains", - "description": "Checks if `defaultValueString` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString_not_contains", - "description": "Checks if `defaultValueString` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString_starts_with", - "description": "Checks if `defaultValueString` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "defaultValueString_not_starts_with", - "description": "Checks if `defaultValueString` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "defaultValueString_ends_with", - "description": "Checks if `defaultValueString` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString_not_ends_with", - "description": "Checks if `defaultValueString` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString_like", - "description": "Matches `defaultValueString` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `defaultValueString`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "defaultValueString_not_like", - "description": "Checks if `defaultValueString` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "defaultValueString2", - "description": "Checks if `defaultValueString2` equals a specified string, case-sensitively.\n\nIf an index exists on `defaultValueString2`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not", - "description": "Checks if `defaultValueString2` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_in", - "description": "Checks if `defaultValueString2` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not_in", - "description": "Checks if `defaultValueString2` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_lt", - "description": "Checks if `defaultValueString2` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_lte", - "description": "Checks if `defaultValueString2` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_gt", - "description": "Checks if `defaultValueString2` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_gte", - "description": "Checks if `defaultValueString2` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_contains", - "description": "Checks if `defaultValueString2` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not_contains", - "description": "Checks if `defaultValueString2` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_starts_with", - "description": "Checks if `defaultValueString2` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not_starts_with", - "description": "Checks if `defaultValueString2` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_ends_with", - "description": "Checks if `defaultValueString2` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not_ends_with", - "description": "Checks if `defaultValueString2` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "defaultValueString2_like", - "description": "Matches `defaultValueString2` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `defaultValueString2`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "defaultValueString2_not_like", - "description": "Checks if `defaultValueString2` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "defaultValueInt", - "description": "Checks if `defaultValueInt` equals a specified value.\n\nIf an index exists on `defaultValueInt`, it can be used.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_not", - "description": "Checks if `defaultValueInt` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "defaultValueInt_in", - "description": "Checks if `defaultValueInt` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_not_in", - "description": "Checks if `defaultValueInt` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_lt", - "description": "Checks if `defaultValueInt` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_lte", - "description": "Checks if `defaultValueInt` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_gt", - "description": "Checks if `defaultValueInt` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueInt_gte", - "description": "Checks if `defaultValueInt` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueTrue", - "description": "Checks if `defaultValueTrue` equals a specified value.\n\nIf an index exists on `defaultValueTrue`, it can be used.", - "deprecationReason": null - }, - { - "name": "defaultValueTrue_not", - "description": "Checks if `defaultValueTrue` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "defaultValueFalse", - "description": "Checks if `defaultValueFalse` equals a specified value.\n\nIf an index exists on `defaultValueFalse`, it can be used.", - "deprecationReason": null - }, - { - "name": "defaultValueFalse_not", - "description": "Checks if `defaultValueFalse` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "defaultValueFloat", - "description": "Checks if `defaultValueFloat` equals a specified value.\n\nIf an index exists on `defaultValueFloat`, it can be used.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_not", - "description": "Checks if `defaultValueFloat` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_in", - "description": "Checks if `defaultValueFloat` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_not_in", - "description": "Checks if `defaultValueFloat` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_lt", - "description": "Checks if `defaultValueFloat` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_lte", - "description": "Checks if `defaultValueFloat` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_gt", - "description": "Checks if `defaultValueFloat` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueFloat_gte", - "description": "Checks if `defaultValueFloat` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "defaultValueEnum", - "description": "Checks if `defaultValueEnum` equals a specified value.\n\nIf an index exists on `defaultValueEnum`, it can be used.", - "deprecationReason": null - }, - { - "name": "defaultValueEnum_not", - "description": "Checks if `defaultValueEnum` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "defaultValueEnum_in", - "description": "Checks if `defaultValueEnum` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "defaultValueEnum_not_in", - "description": "Checks if `defaultValueEnum` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": "Checks if `dispatchDate` equals a specified value.\n\nIf an index exists on `dispatchDate`, it can be used.", - "deprecationReason": null - }, - { - "name": "dispatchDate_not", - "description": "Checks if `dispatchDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "dispatchDate_in", - "description": "Checks if `dispatchDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "dispatchDate_not_in", - "description": "Checks if `dispatchDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "dispatchDate_lt", - "description": "Checks if `dispatchDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_lte", - "description": "Checks if `dispatchDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_gt", - "description": "Checks if `dispatchDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_gte", - "description": "Checks if `dispatchDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupDate", - "description": "Checks if `pickupDate` equals a specified value.\n\nIf an index exists on `pickupDate`, it can be used.", - "deprecationReason": null - }, - { - "name": "pickupDate_not", - "description": "Checks if `pickupDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "pickupDate_in", - "description": "Checks if `pickupDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupDate_not_in", - "description": "Checks if `pickupDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupDate_lt", - "description": "Checks if `pickupDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupDate_lte", - "description": "Checks if `pickupDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupDate_gt", - "description": "Checks if `pickupDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupDate_gte", - "description": "Checks if `pickupDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart", - "description": "Checks if `pickupTimeStart` equals a specified value.\n\nIf an index exists on `pickupTimeStart`, it can be used.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_not", - "description": "Checks if `pickupTimeStart` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_in", - "description": "Checks if `pickupTimeStart` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_not_in", - "description": "Checks if `pickupTimeStart` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_lt", - "description": "Checks if `pickupTimeStart` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_lte", - "description": "Checks if `pickupTimeStart` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_gt", - "description": "Checks if `pickupTimeStart` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeStart_gte", - "description": "Checks if `pickupTimeStart` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd", - "description": "Checks if `pickupTimeEnd` equals a specified value.\n\nIf an index exists on `pickupTimeEnd`, it can be used.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_not", - "description": "Checks if `pickupTimeEnd` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_in", - "description": "Checks if `pickupTimeEnd` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_not_in", - "description": "Checks if `pickupTimeEnd` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_lt", - "description": "Checks if `pickupTimeEnd` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_lte", - "description": "Checks if `pickupTimeEnd` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_gt", - "description": "Checks if `pickupTimeEnd` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "pickupTimeEnd_gte", - "description": "Checks if `pickupTimeEnd` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "description", - "description": "Checks if `description` equals a specified string, case-sensitively.\n\nIf an index exists on `description`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "description_not", - "description": "Checks if `description` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "description_in", - "description": "Checks if `description` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "description_not_in", - "description": "Checks if `description` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "description_lt", - "description": "Checks if `description` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "description_lte", - "description": "Checks if `description` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "description_gt", - "description": "Checks if `description` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "description_gte", - "description": "Checks if `description` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "description_contains", - "description": "Checks if `description` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "description_not_contains", - "description": "Checks if `description` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "description_starts_with", - "description": "Checks if `description` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "description_not_starts_with", - "description": "Checks if `description` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "description_ends_with", - "description": "Checks if `description` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "description_not_ends_with", - "description": "Checks if `description` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "description_like", - "description": "Matches `description` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `description`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "description_not_like", - "description": "Checks if `description` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "colorData", - "description": "Allows to filter on the fields of `colorData`.\n\nNote that `colorData` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": "Checks if `enumFlexSearch` equals a specified value.\n\nIf an index exists on `enumFlexSearch`, it can be used.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_not", - "description": "Checks if `enumFlexSearch` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_in", - "description": "Checks if `enumFlexSearch` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_not_in", - "description": "Checks if `enumFlexSearch` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText", - "description": "Checks if `aText` equals a specified string, case-sensitively.\n\nIf an index exists on `aText`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "aText_not", - "description": "Checks if `aText` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "aText_in", - "description": "Checks if `aText` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText_not_in", - "description": "Checks if `aText` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText_lt", - "description": "Checks if `aText` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "aText_lte", - "description": "Checks if `aText` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aText_gt", - "description": "Checks if `aText` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "aText_gte", - "description": "Checks if `aText` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aText_contains", - "description": "Checks if `aText` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "aText_not_contains", - "description": "Checks if `aText` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "aText_starts_with", - "description": "Checks if `aText` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "aText_not_starts_with", - "description": "Checks if `aText` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "aText_ends_with", - "description": "Checks if `aText` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "aText_not_ends_with", - "description": "Checks if `aText` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "aText_like", - "description": "Matches `aText` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `aText`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "aText_not_like", - "description": "Checks if `aText` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "aNumber", - "description": "Checks if `aNumber` equals a specified value.\n\nIf an index exists on `aNumber`, it can be used.", - "deprecationReason": null - }, - { - "name": "aNumber_not", - "description": "Checks if `aNumber` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "aNumber_in", - "description": "Checks if `aNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aNumber_not_in", - "description": "Checks if `aNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aNumber_lt", - "description": "Checks if `aNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_lte", - "description": "Checks if `aNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_gt", - "description": "Checks if `aNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_gte", - "description": "Checks if `aNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "recursion", - "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "processingFinished", - "description": "Checks if `processingFinished` equals a specified value.\n\nIf an index exists on `processingFinished`, it can be used.", - "deprecationReason": null - }, - { - "name": "processingFinished_not", - "description": "Checks if `processingFinished` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "deprecatedField", - "description": "Checks if `deprecatedField` equals a specified string, case-sensitively.\n\nIf an index exists on `deprecatedField`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "deprecatedField_not", - "description": "Checks if `deprecatedField` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deprecatedField_in", - "description": "Checks if `deprecatedField` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deprecatedField_not_in", - "description": "Checks if `deprecatedField` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deprecatedField_lt", - "description": "Checks if `deprecatedField` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "deprecatedField_lte", - "description": "Checks if `deprecatedField` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deprecatedField_gt", - "description": "Checks if `deprecatedField` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "deprecatedField_gte", - "description": "Checks if `deprecatedField` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deprecatedField_contains", - "description": "Checks if `deprecatedField` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deprecatedField_not_contains", - "description": "Checks if `deprecatedField` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deprecatedField_starts_with", - "description": "Checks if `deprecatedField` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "deprecatedField_not_starts_with", - "description": "Checks if `deprecatedField` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "deprecatedField_ends_with", - "description": "Checks if `deprecatedField` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deprecatedField_not_ends_with", - "description": "Checks if `deprecatedField` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "deprecatedField_like", - "description": "Matches `deprecatedField` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `deprecatedField`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "deprecatedField_not_like", - "description": "Checks if `deprecatedField` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "enumWithDeprecation", - "description": "Checks if `enumWithDeprecation` equals a specified value.\n\nIf an index exists on `enumWithDeprecation`, it can be used.", - "deprecationReason": null - }, - { - "name": "enumWithDeprecation_not", - "description": "Checks if `enumWithDeprecation` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "enumWithDeprecation_in", - "description": "Checks if `enumWithDeprecation` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "enumWithDeprecation_not_in", - "description": "Checks if `enumWithDeprecation` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": "Checks if `sometimesNull` equals a specified string, case-sensitively.\n\nIf an index exists on `sometimesNull`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not", - "description": "Checks if `sometimesNull` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_in", - "description": "Checks if `sometimesNull` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_in", - "description": "Checks if `sometimesNull` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "sometimesNull_lt", - "description": "Checks if `sometimesNull` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_lte", - "description": "Checks if `sometimesNull` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_gt", - "description": "Checks if `sometimesNull` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_gte", - "description": "Checks if `sometimesNull` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_contains", - "description": "Checks if `sometimesNull` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_contains", - "description": "Checks if `sometimesNull` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_starts_with", - "description": "Checks if `sometimesNull` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_starts_with", - "description": "Checks if `sometimesNull` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "sometimesNull_ends_with", - "description": "Checks if `sometimesNull` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_ends_with", - "description": "Checks if `sometimesNull` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_like", - "description": "Matches `sometimesNull` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `sometimesNull`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_like", - "description": "Checks if `sometimesNull` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": "Checks if `caseInsensitiveField` equals a specified string, case-sensitively.\n\nIf an index exists on `caseInsensitiveField`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not", - "description": "Checks if `caseInsensitiveField` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_in", - "description": "Checks if `caseInsensitiveField` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_in", - "description": "Checks if `caseInsensitiveField` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_lt", - "description": "Checks if `caseInsensitiveField` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_lte", - "description": "Checks if `caseInsensitiveField` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_gt", - "description": "Checks if `caseInsensitiveField` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_gte", - "description": "Checks if `caseInsensitiveField` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_contains", - "description": "Checks if `caseInsensitiveField` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_contains", - "description": "Checks if `caseInsensitiveField` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_starts_with", - "description": "Checks if `caseInsensitiveField` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_starts_with", - "description": "Checks if `caseInsensitiveField` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_ends_with", - "description": "Checks if `caseInsensitiveField` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_ends_with", - "description": "Checks if `caseInsensitiveField` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_like", - "description": "Matches `caseInsensitiveField` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `caseInsensitiveField`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_like", - "description": "Checks if `caseInsensitiveField` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "StringFilter", - "description": "Filter type for String.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "equal", - "description": "Checks if the value equals a specified string, case-sensitively.\n\nIf an index exists on the value, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "not", - "description": "Checks if the value does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "in", - "description": "Checks if the value is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "not_in", - "description": "Checks if the value is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "lt", - "description": "Checks if the value is less than a specified value.", - "deprecationReason": null - }, - { - "name": "lte", - "description": "Checks if the value is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "gt", - "description": "Checks if the value is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "gte", - "description": "Checks if the value is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "contains", - "description": "Checks if the value contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "not_contains", - "description": "Checks if the value does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "starts_with", - "description": "Checks if the value starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "not_starts_with", - "description": "Checks if the value does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "ends_with", - "description": "Checks if the value ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "not_ends_with", - "description": "Checks if the value does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "like", - "description": "Matches the value against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on the value, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "not_like", - "description": "Checks if the value does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "AddressFilter", - "description": "Filter type for Address.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "street", - "description": "Checks if `street` equals a specified string, case-sensitively.\n\nIf an index exists on `street`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "street_not", - "description": "Checks if `street` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "street_in", - "description": "Checks if `street` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "street_not_in", - "description": "Checks if `street` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "street_lt", - "description": "Checks if `street` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "street_lte", - "description": "Checks if `street` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "street_gt", - "description": "Checks if `street` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "street_gte", - "description": "Checks if `street` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "street_contains", - "description": "Checks if `street` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "street_not_contains", - "description": "Checks if `street` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "street_starts_with", - "description": "Checks if `street` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "street_not_starts_with", - "description": "Checks if `street` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "street_ends_with", - "description": "Checks if `street` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "street_not_ends_with", - "description": "Checks if `street` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "street_like", - "description": "Matches `street` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `street`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "street_not_like", - "description": "Checks if `street` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "city", - "description": "Checks if `city` equals a specified string, case-sensitively.\n\nIf an index exists on `city`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "city_not", - "description": "Checks if `city` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "city_in", - "description": "Checks if `city` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "city_not_in", - "description": "Checks if `city` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "city_lt", - "description": "Checks if `city` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "city_lte", - "description": "Checks if `city` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "city_gt", - "description": "Checks if `city` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "city_gte", - "description": "Checks if `city` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "city_contains", - "description": "Checks if `city` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "city_not_contains", - "description": "Checks if `city` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "city_starts_with", - "description": "Checks if `city` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "city_not_starts_with", - "description": "Checks if `city` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "city_ends_with", - "description": "Checks if `city` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "city_not_ends_with", - "description": "Checks if `city` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "city_like", - "description": "Matches `city` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `city`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "city_not_like", - "description": "Checks if `city` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "zipCode", - "description": "Checks if `zipCode` equals a specified string, case-sensitively.\n\nIf an index exists on `zipCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "zipCode_not", - "description": "Checks if `zipCode` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "zipCode_in", - "description": "Checks if `zipCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "zipCode_not_in", - "description": "Checks if `zipCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "zipCode_lt", - "description": "Checks if `zipCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "zipCode_lte", - "description": "Checks if `zipCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "zipCode_gt", - "description": "Checks if `zipCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "zipCode_gte", - "description": "Checks if `zipCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "zipCode_contains", - "description": "Checks if `zipCode` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "zipCode_not_contains", - "description": "Checks if `zipCode` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "zipCode_starts_with", - "description": "Checks if `zipCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "zipCode_not_starts_with", - "description": "Checks if `zipCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "zipCode_ends_with", - "description": "Checks if `zipCode` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "zipCode_not_ends_with", - "description": "Checks if `zipCode` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "zipCode_like", - "description": "Matches `zipCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `zipCode`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "zipCode_not_like", - "description": "Checks if `zipCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "country", - "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `country` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "DangerousGoodsInfoFilter", - "description": "Filter type for DangerousGoodsInfo.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "unNumber", - "description": "Checks if `unNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `unNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "unNumber_not", - "description": "Checks if `unNumber` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_in", - "description": "Checks if `unNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "unNumber_not_in", - "description": "Checks if `unNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "unNumber_lt", - "description": "Checks if `unNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_lte", - "description": "Checks if `unNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_gt", - "description": "Checks if `unNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_gte", - "description": "Checks if `unNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_contains", - "description": "Checks if `unNumber` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_not_contains", - "description": "Checks if `unNumber` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_starts_with", - "description": "Checks if `unNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "unNumber_not_starts_with", - "description": "Checks if `unNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "unNumber_ends_with", - "description": "Checks if `unNumber` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_not_ends_with", - "description": "Checks if `unNumber` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_like", - "description": "Matches `unNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `unNumber`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "unNumber_not_like", - "description": "Checks if `unNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "flashpoint", - "description": "Checks if `flashpoint` equals a specified string, case-sensitively.\n\nIf an index exists on `flashpoint`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "flashpoint_not", - "description": "Checks if `flashpoint` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "flashpoint_in", - "description": "Checks if `flashpoint` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "flashpoint_not_in", - "description": "Checks if `flashpoint` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "flashpoint_lt", - "description": "Checks if `flashpoint` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "flashpoint_lte", - "description": "Checks if `flashpoint` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "flashpoint_gt", - "description": "Checks if `flashpoint` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "flashpoint_gte", - "description": "Checks if `flashpoint` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "flashpoint_contains", - "description": "Checks if `flashpoint` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "flashpoint_not_contains", - "description": "Checks if `flashpoint` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "flashpoint_starts_with", - "description": "Checks if `flashpoint` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "flashpoint_not_starts_with", - "description": "Checks if `flashpoint` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "flashpoint_ends_with", - "description": "Checks if `flashpoint` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "flashpoint_not_ends_with", - "description": "Checks if `flashpoint` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "flashpoint_like", - "description": "Matches `flashpoint` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `flashpoint`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "flashpoint_not_like", - "description": "Checks if `flashpoint` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "notices_some", - "description": "Makes sure at least one of the items in \"notices\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `notices` has at least one item.", - "deprecationReason": null - }, - { - "name": "notices_every", - "description": "Makes sure all items in `notices` match a certain filter.", - "deprecationReason": null - }, - { - "name": "notices_none", - "description": "Makes sure none of the items in `notices` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `notices` has no items.", - "deprecationReason": null - }, - { - "name": "notices_empty", - "description": "Checks if `notices` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "details", - "description": "Allows to filter on the fields of `details`.\n\nNote that `details` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "DangerousGoodsDetailsFilter", - "description": "Filter type for DangerousGoodsDetails.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "expiryDate", - "description": "Checks if `expiryDate` equals a specified value.\n\nIf an index exists on `expiryDate`, it can be used.", - "deprecationReason": null - }, - { - "name": "expiryDate_not", - "description": "Checks if `expiryDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "expiryDate_in", - "description": "Checks if `expiryDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "expiryDate_not_in", - "description": "Checks if `expiryDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "expiryDate_lt", - "description": "Checks if `expiryDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "expiryDate_lte", - "description": "Checks if `expiryDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "expiryDate_gt", - "description": "Checks if `expiryDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "expiryDate_gte", - "description": "Checks if `expiryDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "comment", - "description": "Checks if `comment` equals a specified string, case-sensitively.\n\nIf an index exists on `comment`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "comment_not", - "description": "Checks if `comment` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "comment_in", - "description": "Checks if `comment` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "comment_not_in", - "description": "Checks if `comment` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "comment_lt", - "description": "Checks if `comment` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "comment_lte", - "description": "Checks if `comment` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "comment_gt", - "description": "Checks if `comment` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "comment_gte", - "description": "Checks if `comment` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "comment_contains", - "description": "Checks if `comment` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "comment_not_contains", - "description": "Checks if `comment` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "comment_starts_with", - "description": "Checks if `comment` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "comment_not_starts_with", - "description": "Checks if `comment` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "comment_ends_with", - "description": "Checks if `comment` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "comment_not_ends_with", - "description": "Checks if `comment` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "comment_like", - "description": "Matches `comment` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `comment`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "comment_not_like", - "description": "Checks if `comment` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "ForwarderFilter", - "description": "Filter type for Forwarder.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "name", - "description": "Checks if `name` equals a specified string, case-sensitively.\n\nIf an index exists on `name`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "name_not", - "description": "Checks if `name` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_in", - "description": "Checks if `name` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_not_in", - "description": "Checks if `name` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_lt", - "description": "Checks if `name` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "name_lte", - "description": "Checks if `name` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_gt", - "description": "Checks if `name` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "name_gte", - "description": "Checks if `name` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_contains", - "description": "Checks if `name` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_not_contains", - "description": "Checks if `name` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_starts_with", - "description": "Checks if `name` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "name_not_starts_with", - "description": "Checks if `name` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "name_ends_with", - "description": "Checks if `name` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_not_ends_with", - "description": "Checks if `name` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_like", - "description": "Matches `name` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `name`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "name_not_like", - "description": "Checks if `name` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "deliveries_some", - "description": "Makes sure at least one of the items in \"deliveries\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has at least one item.", - "deprecationReason": null - }, - { - "name": "deliveries_every", - "description": "Makes sure all items in `deliveries` match a certain filter.", - "deprecationReason": null - }, - { - "name": "deliveries_none", - "description": "Makes sure none of the items in `deliveries` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has no items.", - "deprecationReason": null - }, - { - "name": "deliveries_empty", - "description": "Checks if `deliveries` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "Foobarit", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "OffsetDateTime", - "description": "The `OffsetDateTime` scalar type represents a point in time with a timezone offset, in a format specified by ISO 8601, such as `2007-12-03T10:15:30+01:00` or `2007-12-03T10:15:30.123Z`.\n\nOnly use this type for timestamps that are inherently tied to a location and the timezone offset should be calculated eagerly. To only store a point in time, use `DateTime`.\n\nThe *second* part is added if not specified, e.g. `2007-12-03T12:34Z` is converted to `2007-12-03T12:34:00Z`. Offset specifier `Z` is accepted but will be converted to `+00:00`. Leap seconds are not supported.", - "fields": null, - "inputFields": null - }, - { - "name": "LocalTime", - "description": "The `LocalTime` scalar type represents a time without time zone in a format specified by ISO 8601, such as 10:15:30 or 17:05:03.521.\n\nThe valid range is between 00:00:00 and 23:59:59.999999999. 24:00 is not allowed to avoid bugs in clients that treat 24:00 as 0:00.\n\nThe seconds part is cut off if it is zero, e.g. 12:34:00 is converted to 12:34. Second fraction digits are cut off at the nearest three-digit group, e.g. 00:00:00.1234 is converted to 00:00:00.123400.\n\nLeap seconds can not be specified.", - "fields": null, - "inputFields": null - }, - { - "name": "ColorDataFilter", - "description": "Filter type for ColorData.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "packageColor", - "description": "Checks if `packageColor` equals a specified string, case-sensitively.\n\nIf an index exists on `packageColor`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "packageColor_not", - "description": "Checks if `packageColor` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_in", - "description": "Checks if `packageColor` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "packageColor_not_in", - "description": "Checks if `packageColor` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "packageColor_lt", - "description": "Checks if `packageColor` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_lte", - "description": "Checks if `packageColor` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_gt", - "description": "Checks if `packageColor` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_gte", - "description": "Checks if `packageColor` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_contains", - "description": "Checks if `packageColor` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_not_contains", - "description": "Checks if `packageColor` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_starts_with", - "description": "Checks if `packageColor` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "packageColor_not_starts_with", - "description": "Checks if `packageColor` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "packageColor_ends_with", - "description": "Checks if `packageColor` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_not_ends_with", - "description": "Checks if `packageColor` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_like", - "description": "Matches `packageColor` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `packageColor`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "packageColor_not_like", - "description": "Checks if `packageColor` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "RecursionFilter", - "description": "Filter type for Recursion.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "recursion", - "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "name", - "description": "Checks if `name` equals a specified string, case-sensitively.\n\nIf an index exists on `name`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "name_not", - "description": "Checks if `name` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_in", - "description": "Checks if `name` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_not_in", - "description": "Checks if `name` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_lt", - "description": "Checks if `name` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "name_lte", - "description": "Checks if `name` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_gt", - "description": "Checks if `name` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "name_gte", - "description": "Checks if `name` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_contains", - "description": "Checks if `name` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_not_contains", - "description": "Checks if `name` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_starts_with", - "description": "Checks if `name` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "name_not_starts_with", - "description": "Checks if `name` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "name_ends_with", - "description": "Checks if `name` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_not_ends_with", - "description": "Checks if `name` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "name_like", - "description": "Matches `name` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `name`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "name_not_like", - "description": "Checks if `name` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "EnumWithDeprecation", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "DeliveryItemOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "HandlingUnitOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "Forwarder", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "deliveries", - "description": null, - "deprecationReason": null - }, - { - "name": "_deliveriesMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "DeliveryOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "JSON", - "description": "The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).", - "fields": null, - "inputFields": null - }, - { - "name": "ColorData", - "description": null, - "fields": [ - { - "name": "packageColor", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Recursion", - "description": null, - "fields": [ - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "DeliveryFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "deliveryNumber", - "description": "Checks if `deliveryNumber` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not", - "description": "Checks if `deliveryNumber` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_lt", - "description": "Checks if `deliveryNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_lte", - "description": "Checks if `deliveryNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_gt", - "description": "Checks if `deliveryNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_gte", - "description": "Checks if `deliveryNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_in", - "description": "Checks if `deliveryNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_in", - "description": "Checks if `deliveryNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_starts_with", - "description": "Checks if `deliveryNumber` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "deliveryNumber_not_starts_with", - "description": "Checks if `deliveryNumber` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_equal", - "description": "Checks if `serialNumbers` equals a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_not", - "description": "Checks if `serialNumbers` does not equal a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_lt", - "description": "Checks if `serialNumbers` is less than a specified value.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_lte", - "description": "Checks if `serialNumbers` is less or equal a specified value.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_gt", - "description": "Checks if `serialNumbers` is greater than a specified value.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_gte", - "description": "Checks if `serialNumbers` is greater or equal a specified value.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_in", - "description": "Checks if `serialNumbers` is equal to one of the specified values.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_not_in", - "description": "Checks if `serialNumbers` is not equal to one of the specified values.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_starts_with", - "description": "Checks if `serialNumbers` starts with a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_aggregation_not_starts_with", - "description": "Checks if `serialNumbers` does not start with a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "serialNumbers_empty", - "description": "Checks if `serialNumbers` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "Checks if `consignee` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "itemsAggregation", - "description": "Checks if `items` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "items_empty", - "description": "Checks if `items` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode", - "description": "Checks if `destinationCountryISOCode` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not", - "description": "Checks if `destinationCountryISOCode` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_lt", - "description": "Checks if `destinationCountryISOCode` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_lte", - "description": "Checks if `destinationCountryISOCode` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_gt", - "description": "Checks if `destinationCountryISOCode` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_gte", - "description": "Checks if `destinationCountryISOCode` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_in", - "description": "Checks if `destinationCountryISOCode` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_in", - "description": "Checks if `destinationCountryISOCode` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_starts_with", - "description": "Checks if `destinationCountryISOCode` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "destinationCountryISOCode_not_starts_with", - "description": "Checks if `destinationCountryISOCode` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "completionDate", - "description": "Checks if `completionDate` equals a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_not", - "description": "Checks if `completionDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "completionDate_in", - "description": "Checks if `completionDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "completionDate_not_in", - "description": "Checks if `completionDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "completionDate_lt", - "description": "Checks if `completionDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_lte", - "description": "Checks if `completionDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_gt", - "description": "Checks if `completionDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "completionDate_gte", - "description": "Checks if `completionDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": "Checks if `dispatchDate` equals a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_not", - "description": "Checks if `dispatchDate` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "dispatchDate_in", - "description": "Checks if `dispatchDate` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "dispatchDate_not_in", - "description": "Checks if `dispatchDate` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "dispatchDate_lt", - "description": "Checks if `dispatchDate` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_lte", - "description": "Checks if `dispatchDate` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_gt", - "description": "Checks if `dispatchDate` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "dispatchDate_gte", - "description": "Checks if `dispatchDate` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "description_contains_any_word", - "description": "Tokenizes the provided string into words, and checks if `description` contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_not_contains_any_word", - "description": "Tokenizes the provided string into words, and checks if `description` contains none of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_contains_all_words", - "description": "Tokenizes the provided string into words, and checks if `description` contains all of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_not_contains_all_words", - "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in `description`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if `description` contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_not_contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if `description` does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_contains_all_prefixes", - "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in `description`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_not_contains_all_prefixes", - "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in `description`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in `description`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "description_not_contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in `description`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "colorData", - "description": "Allows to filter on the fields of `colorData`.\n\nNote that `colorData` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": "Checks if `enumFlexSearch` equals a specified value.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_not", - "description": "Checks if `enumFlexSearch` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_in", - "description": "Checks if `enumFlexSearch` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch_not_in", - "description": "Checks if `enumFlexSearch` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText", - "description": "Checks if `aText` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "aText_not", - "description": "Checks if `aText` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "aText_lt", - "description": "Checks if `aText` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "aText_lte", - "description": "Checks if `aText` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aText_gt", - "description": "Checks if `aText` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "aText_gte", - "description": "Checks if `aText` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aText_in", - "description": "Checks if `aText` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText_not_in", - "description": "Checks if `aText` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aText_starts_with", - "description": "Checks if `aText` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "aText_not_starts_with", - "description": "Checks if `aText` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "aNumber", - "description": "Checks if `aNumber` equals a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_not", - "description": "Checks if `aNumber` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "aNumber_in", - "description": "Checks if `aNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aNumber_not_in", - "description": "Checks if `aNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "aNumber_lt", - "description": "Checks if `aNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_lte", - "description": "Checks if `aNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_gt", - "description": "Checks if `aNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "aNumber_gte", - "description": "Checks if `aNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "recursion", - "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "processingFinished", - "description": "Checks if `processingFinished` equals a specified value.", - "deprecationReason": null - }, - { - "name": "processingFinished_not", - "description": "Checks if `processingFinished` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": "Checks if `sometimesNull` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not", - "description": "Checks if `sometimesNull` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_lt", - "description": "Checks if `sometimesNull` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_lte", - "description": "Checks if `sometimesNull` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_gt", - "description": "Checks if `sometimesNull` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_gte", - "description": "Checks if `sometimesNull` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "sometimesNull_in", - "description": "Checks if `sometimesNull` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_in", - "description": "Checks if `sometimesNull` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "sometimesNull_starts_with", - "description": "Checks if `sometimesNull` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "sometimesNull_not_starts_with", - "description": "Checks if `sometimesNull` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": "Checks if `caseInsensitiveField` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not", - "description": "Checks if `caseInsensitiveField` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_lt", - "description": "Checks if `caseInsensitiveField` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_lte", - "description": "Checks if `caseInsensitiveField` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_gt", - "description": "Checks if `caseInsensitiveField` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_gte", - "description": "Checks if `caseInsensitiveField` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_in", - "description": "Checks if `caseInsensitiveField` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_in", - "description": "Checks if `caseInsensitiveField` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_starts_with", - "description": "Checks if `caseInsensitiveField` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "caseInsensitiveField_not_starts_with", - "description": "Checks if `caseInsensitiveField` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "AddressFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "city", - "description": "Checks if `city` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "city_not", - "description": "Checks if `city` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "city_lt", - "description": "Checks if `city` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "city_lte", - "description": "Checks if `city` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "city_gt", - "description": "Checks if `city` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "city_gte", - "description": "Checks if `city` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "city_in", - "description": "Checks if `city` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "city_not_in", - "description": "Checks if `city` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "city_starts_with", - "description": "Checks if `city` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "city_not_starts_with", - "description": "Checks if `city` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "DeliveryItemAggregationFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time", - "deprecationReason": null - }, - { - "name": "itemNumber_contains_any_word", - "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains_any_word", - "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains none of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_contains_all_words", - "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains all of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains_all_words", - "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if `itemNumber` contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if `itemNumber` does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_contains_all_prefixes", - "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains_all_prefixes", - "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "itemNumber_not_contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "quantity", - "description": "Checks if `quantity` equals a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_not", - "description": "Checks if `quantity` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "quantity_in", - "description": "Checks if `quantity` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "quantity_not_in", - "description": "Checks if `quantity` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "quantity_lt", - "description": "Checks if `quantity` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_lte", - "description": "Checks if `quantity` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_gt", - "description": "Checks if `quantity` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "quantity_gte", - "description": "Checks if `quantity` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", - "deprecationReason": null - }, - { - "name": "description_localized", - "description": "Makes sure at least one of the entries in \"description\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", - "deprecationReason": null - } - ] - }, - { - "name": "DangerousGoodsInfoAggregationFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "unNumber", - "description": "Checks if `unNumber` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_not", - "description": "Checks if `unNumber` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_lt", - "description": "Checks if `unNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_lte", - "description": "Checks if `unNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_gt", - "description": "Checks if `unNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_gte", - "description": "Checks if `unNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "unNumber_in", - "description": "Checks if `unNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "unNumber_not_in", - "description": "Checks if `unNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "unNumber_starts_with", - "description": "Checks if `unNumber` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "unNumber_not_starts_with", - "description": "Checks if `unNumber` does not start with a specified string, case-insensitively.", - "deprecationReason": null - } - ] - }, - { - "name": "I18nStringLocalizedRegularAndFulltextFilter", - "description": "Allows to on a specific localization of an `I18nString`\n\nThe language should be provided in the special `language` field. All other fields are *and*-combined. There are no fallback rules for string localization; if there is no localization for the given language, the filter acts as if the field was `null`.", - "fields": null, - "inputFields": [ - { - "name": "language", - "description": "Sets the language to be used for the filters in this object", - "deprecationReason": null - }, - { - "name": "equal", - "description": "Checks if the value equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "not", - "description": "Checks if the value does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "lt", - "description": "Checks if the value is less than a specified value.", - "deprecationReason": null - }, - { - "name": "lte", - "description": "Checks if the value is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "gt", - "description": "Checks if the value is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "gte", - "description": "Checks if the value is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "in", - "description": "Checks if the value is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "not_in", - "description": "Checks if the value is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "starts_with", - "description": "Checks if the value starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "not_starts_with", - "description": "Checks if the value does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "contains_any_word", - "description": "Tokenizes the provided string into words, and checks if the value contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "not_contains_any_word", - "description": "Tokenizes the provided string into words, and checks if the value contains none of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "contains_all_words", - "description": "Tokenizes the provided string into words, and checks if the value contains all of them.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "not_contains_all_words", - "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in the value.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if the value contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "not_contains_any_prefix", - "description": "Tokenizes the provided string into prefixes, and checks if the value does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "contains_all_prefixes", - "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in the value.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "not_contains_all_prefixes", - "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in the value.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in the value.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - }, - { - "name": "not_contains_phrase", - "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in the value.\n Stemming (reduction of words on their base form) is applied.", - "deprecationReason": null - } - ] - }, - { - "name": "ColorDataFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "packageColor", - "description": "Checks if `packageColor` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_not", - "description": "Checks if `packageColor` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_lt", - "description": "Checks if `packageColor` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_lte", - "description": "Checks if `packageColor` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_gt", - "description": "Checks if `packageColor` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_gte", - "description": "Checks if `packageColor` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "packageColor_in", - "description": "Checks if `packageColor` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "packageColor_not_in", - "description": "Checks if `packageColor` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "packageColor_starts_with", - "description": "Checks if `packageColor` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "packageColor_not_starts_with", - "description": "Checks if `packageColor` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "RecursionFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "recursion", - "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", - "deprecationReason": null - }, - { - "name": "name", - "description": "Checks if `name` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "name_not", - "description": "Checks if `name` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "name_lt", - "description": "Checks if `name` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "name_lte", - "description": "Checks if `name` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_gt", - "description": "Checks if `name` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "name_gte", - "description": "Checks if `name` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "name_in", - "description": "Checks if `name` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_not_in", - "description": "Checks if `name` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_starts_with", - "description": "Checks if `name` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "name_not_starts_with", - "description": "Checks if `name` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "ForwarderOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "OnlyRelations", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "deliveries", - "description": null, - "deprecationReason": null - }, - { - "name": "_deliveriesMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "OnlyRelationsFilter", - "description": "Filter type for OnlyRelations.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "deliveries_some", - "description": "Makes sure at least one of the items in \"deliveries\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has at least one item.", - "deprecationReason": null - }, - { - "name": "deliveries_every", - "description": "Makes sure all items in `deliveries` match a certain filter.", - "deprecationReason": null - }, - { - "name": "deliveries_none", - "description": "Makes sure none of the items in `deliveries` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has no items.", - "deprecationReason": null - }, - { - "name": "deliveries_empty", - "description": "Checks if `deliveries` is an empty list (true) or a non-empty list (false).", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "OnlyRelationsOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "HandlingUnitFlexSearchFilter", - "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "huNumber", - "description": "Checks if `huNumber` equals a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_not", - "description": "Checks if `huNumber` does not equal a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_lt", - "description": "Checks if `huNumber` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_lte", - "description": "Checks if `huNumber` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_gt", - "description": "Checks if `huNumber` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_gte", - "description": "Checks if `huNumber` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "huNumber_in", - "description": "Checks if `huNumber` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "huNumber_not_in", - "description": "Checks if `huNumber` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "huNumber_starts_with", - "description": "Checks if `huNumber` starts with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "huNumber_not_starts_with", - "description": "Checks if `huNumber` does not start with a specified string, case-insensitively.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "NumberRange", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "number", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "NumberRangeName", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "Int53", - "description": "The Int53 scalar type represents non-fractional signed whole numeric values. Int53 can represent values between -9007199254740991 and 9007199254740991.\n\nValues of this type are serialized as numbers in GraphQL and JSON representations. The numeric range of this type corresponds to the safe integer range of an IEEE 754 double precision binary floating-point value.", - "fields": null, - "inputFields": null - }, - { - "name": "NumberRangeFilter", - "description": "Filter type for NumberRange.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "name", - "description": "Checks if `name` equals a specified value.\n\nIf an index exists on `name`, it can be used.", - "deprecationReason": null - }, - { - "name": "name_not", - "description": "Checks if `name` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "name_in", - "description": "Checks if `name` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "name_not_in", - "description": "Checks if `name` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "number", - "description": "Checks if `number` equals a specified value.\n\nIf an index exists on `number`, it can be used.", - "deprecationReason": null - }, - { - "name": "number_not", - "description": "Checks if `number` does not equal a specified value", - "deprecationReason": null - }, - { - "name": "number_in", - "description": "Checks if `number` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "number_not_in", - "description": "Checks if `number` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "number_lt", - "description": "Checks if `number` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "number_lte", - "description": "Checks if `number` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "number_gt", - "description": "Checks if `number` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "number_gte", - "description": "Checks if `number` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "NumberRangeOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "SecretKey", - "description": null, - "fields": [ - { - "name": "id", - "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "value", - "description": null, - "deprecationReason": null - }, - { - "name": "_cursor", - "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "SecretKeyFilter", - "description": "Filter type for SecretKey.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not", - "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_in", - "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_not_in", - "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lt", - "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_lte", - "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gt", - "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "id_gte", - "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not", - "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_in", - "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_not_in", - "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lt", - "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_lte", - "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gt", - "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "createdAt_gte", - "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not", - "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_in", - "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_not_in", - "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lt", - "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_lte", - "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gt", - "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "updatedAt_gte", - "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", - "deprecationReason": null - }, - { - "name": "key", - "description": "Checks if `key` equals a specified string, case-sensitively.\n\nIf an index exists on `key`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "key_not", - "description": "Checks if `key` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_in", - "description": "Checks if `key` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "key_not_in", - "description": "Checks if `key` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "key_lt", - "description": "Checks if `key` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "key_lte", - "description": "Checks if `key` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "key_gt", - "description": "Checks if `key` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "key_gte", - "description": "Checks if `key` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "key_contains", - "description": "Checks if `key` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_not_contains", - "description": "Checks if `key` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_starts_with", - "description": "Checks if `key` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "key_not_starts_with", - "description": "Checks if `key` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "key_ends_with", - "description": "Checks if `key` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_not_ends_with", - "description": "Checks if `key` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "key_like", - "description": "Matches `key` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `key`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "key_not_like", - "description": "Checks if `key` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "value", - "description": "Checks if `value` equals a specified string, case-sensitively.\n\nIf an index exists on `value`, it can be used.\n\nSee also `like` for a case-insensitive filter.", - "deprecationReason": null - }, - { - "name": "value_not", - "description": "Checks if `value` does not equal a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_in", - "description": "Checks if `value` is equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "value_not_in", - "description": "Checks if `value` is not equal to one of the specified values.", - "deprecationReason": null - }, - { - "name": "value_lt", - "description": "Checks if `value` is less than a specified value.", - "deprecationReason": null - }, - { - "name": "value_lte", - "description": "Checks if `value` is less or equal a specified value.", - "deprecationReason": null - }, - { - "name": "value_gt", - "description": "Checks if `value` is greater than a specified value.", - "deprecationReason": null - }, - { - "name": "value_gte", - "description": "Checks if `value` is greater or equal a specified value.", - "deprecationReason": null - }, - { - "name": "value_contains", - "description": "Checks if `value` contains a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_not_contains", - "description": "Checks if `value` does not contain a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_starts_with", - "description": "Checks if `value` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "value_not_starts_with", - "description": "Checks if `value` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", - "deprecationReason": null - }, - { - "name": "value_ends_with", - "description": "Checks if `value` ends with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_not_ends_with", - "description": "Checks if `value` does not end with a specified string, case-sensitively.", - "deprecationReason": null - }, - { - "name": "value_like", - "description": "Matches `value` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `value`, it can be used for the literal prefix (the part until the first placeholder).", - "deprecationReason": null - }, - { - "name": "value_not_like", - "description": "Checks if `value` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", - "deprecationReason": null - }, - { - "name": "AND", - "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", - "deprecationReason": null - }, - { - "name": "OR", - "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", - "deprecationReason": null - } - ] - }, - { - "name": "SecretKeyOrderBy", - "description": null, - "fields": null, - "inputFields": null - }, - { - "name": "CreateBillingEntityInput", - "description": "The create type for the root entity type `BillingEntity`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "isConfirmedForExport", - "description": null, - "deprecationReason": null - }, - { - "name": "isExported", - "description": null, - "deprecationReason": null - }, - { - "name": "confirmedForExportAt", - "description": null, - "deprecationReason": null - }, - { - "name": "exportedAt", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateBillingEntityInput", - "description": "The update type for the root entity type `BillingEntity`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `BillingEntity` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "isConfirmedForExport", - "description": null, - "deprecationReason": null - }, - { - "name": "isExported", - "description": null, - "deprecationReason": null - }, - { - "name": "confirmedForExportAt", - "description": null, - "deprecationReason": null - }, - { - "name": "exportedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"BillingEntity._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllBillingEntitiesInput", - "description": "The update type for the root entity type `BillingEntity`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "isConfirmedForExport", - "description": null, - "deprecationReason": null - }, - { - "name": "isExported", - "description": null, - "deprecationReason": null - }, - { - "name": "confirmedForExportAt", - "description": null, - "deprecationReason": null - }, - { - "name": "exportedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"BillingEntity._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "CreateCountryInput", - "description": "The create type for the root entity type `Country`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "isoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "descriptionI18nString", - "description": null, - "deprecationReason": null - }, - { - "name": "totalInvestment", - "description": null, - "deprecationReason": null - }, - { - "name": "someKey", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "TranslationInput", - "description": "The create/update type for the value object type `Translation`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", - "fields": null, - "inputFields": [ - { - "name": "languageIsoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "translation", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateCountryInput", - "description": "The update type for the root entity type `Country`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `Country` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "isoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "descriptionI18nString", - "description": null, - "deprecationReason": null - }, - { - "name": "totalInvestment", - "description": null, - "deprecationReason": null - }, - { - "name": "someKey", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Country._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllCountriesInput", - "description": "The update type for the root entity type `Country`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "isoCode", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "descriptionI18nString", - "description": null, - "deprecationReason": null - }, - { - "name": "totalInvestment", - "description": null, - "deprecationReason": null - }, - { - "name": "someKey", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Country._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "CreateDeliveryInput", - "description": "The create type for the root entity type `Delivery`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "deliveryNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "serialNumbers", - "description": "The list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "The address of the delivery's consignee", - "deprecationReason": null - }, - { - "name": "contentInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "items", - "description": null, - "deprecationReason": null - }, - { - "name": "handlingUnits", - "description": "Adds `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nIf one of the `HandlingUnits` is already related to a different `Delivery`, these relations are removed first.\n\nThe handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "createHandlingUnits", - "description": "Creates new `HandlingUnits` and adds `handlingUnits` relations between them and the new `Delivery`.\n\nThe handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "destinationCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": "Use \"destinationCountryISOCode\" instead." - }, - { - "name": "destinationCountryISOCode", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "completionDate", - "description": null, - "deprecationReason": null - }, - { - "name": "originCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "shippedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "totalValue", - "description": null, - "deprecationReason": null - }, - { - "name": "forwarder", - "description": "Sets the `forwarder` relation to an existing `Forwarder` by its id.", - "deprecationReason": null - }, - { - "name": "createForwarder", - "description": "Creates a new `Forwarder` and adds a `forwarder` relation between it and the new `Delivery`.", - "deprecationReason": null - }, - { - "name": "destination", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString2", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueInt", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueTrue", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFalse", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFloat", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueEnum", - "description": null, - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeStart", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd", - "description": null, - "deprecationReason": null - }, - { - "name": "dynamicData", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "colorData", - "description": null, - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": null, - "deprecationReason": null - }, - { - "name": "aText", - "description": null, - "deprecationReason": null - }, - { - "name": "aNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { - "name": "processingFinished", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecatedField", - "description": null, - "deprecationReason": null - }, - { - "name": "enumWithDeprecation", - "description": null, - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": null, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "AddressInput", - "description": "The create/update type for the value object type `Address`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", - "fields": null, - "inputFields": [ - { - "name": "street", - "description": null, - "deprecationReason": null - }, - { - "name": "city", - "description": null, - "deprecationReason": null - }, - { - "name": "zipCode", - "description": null, - "deprecationReason": null - }, - { - "name": "country", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - } - ] - }, - { - "name": "CreateDangerousGoodsInfoInput", - "description": "The create type for the entity extension type `DangerousGoodsInfo`.", - "fields": null, - "inputFields": [ - { - "name": "unNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "flashpoint", - "description": null, - "deprecationReason": null - }, - { - "name": "notices", - "description": null, - "deprecationReason": null - }, - { - "name": "details", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "CreateDangerousGoodsDetailsInput", - "description": "The create type for the entity extension type `DangerousGoodsDetails`.", - "fields": null, - "inputFields": [ - { - "name": "expiryDate", - "description": null, - "deprecationReason": null - }, - { - "name": "comment", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "CreateDeliveryItemInput", - "description": "The create type for the child entity type `DeliveryItem`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "itemNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "quantity", - "description": null, - "deprecationReason": null - }, - { - "name": "weightInKg", - "description": null, - "deprecationReason": null - }, - { - "name": "handlingUnit", - "description": "Specify the `id` of the `HandlingUnit` to be referenced", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "CreateHandlingUnitInput", - "description": "The create type for the root entity type `HandlingUnit`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "huNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "delivery", - "description": "Sets the `delivery` relation to an existing `Delivery` by its id.", - "deprecationReason": null - }, - { - "name": "createDelivery", - "description": "Creates a new `Delivery` and adds a `delivery` relation between it and the new `HandlingUnit`.", - "deprecationReason": null - } - ] - }, - { - "name": "CreateForwarderInput", - "description": "The create type for the root entity type `Forwarder`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "deliveries", - "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.\n\nIf one of the `Deliveries` is already related to a different `Forwarder`, these relations are removed first.", - "deprecationReason": null - }, - { - "name": "createDeliveries", - "description": "Creates new `Deliveries` and adds `deliveries` relations between them and the new `Forwarder`.", - "deprecationReason": null - } - ] - }, - { - "name": "CreateColorDataInput", - "description": "The create type for the entity extension type `ColorData`.", - "fields": null, - "inputFields": [ - { - "name": "packageColor", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "RecursionInput", - "description": "The create/update type for the value object type `Recursion`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", - "fields": null, - "inputFields": [ - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateDeliveryInput", - "description": "The update type for the root entity type `Delivery`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `Delivery` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "deliveryNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "serialNumbers", - "description": "The list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "The address of the delivery's consignee", - "deprecationReason": null - }, - { - "name": "contentInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - }, - { - "name": "items", - "description": "Deletes all `DeliveryItems` objects in list of `items` and replaces it with the specified objects.\n\nCannot be combined with the add/update/delete fields for the same child entity list.", - "deprecationReason": null - }, - { - "name": "addItems", - "description": "Adds new `DeliveryItems` to the list of `items`", - "deprecationReason": null - }, - { - "name": "updateItems", - "description": "Updates `DeliveryItems` in the list of `items`", - "deprecationReason": null - }, - { - "name": "removeItems", - "description": "Deletes `DeliveryItems` by ids in the list of `items`", - "deprecationReason": null - }, - { - "name": "addHandlingUnits", - "description": "Adds `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nIf one of the `HandlingUnits` is already related to a different `Delivery`, these relations are removed first.\n\nThe handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "removeHandlingUnits", - "description": "Removes `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nThe handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "createHandlingUnits", - "description": "Creates new `HandlingUnits` and adds `handlingUnits` relations between them and this `Delivery`.\n\nThe handling units the items of this delivery are packaged in", - "deprecationReason": null - }, - { - "name": "destinationCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": "Use \"destinationCountryISOCode\" instead." - }, - { - "name": "destinationCountryISOCode", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "completionDate", - "description": null, - "deprecationReason": null - }, - { - "name": "originCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "shippedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "totalValue", - "description": null, - "deprecationReason": null - }, - { - "name": "forwarder", - "description": "Sets the `forwarder` relation to an existing `Forwarder` by its id.\n\nIf this `Delivery` already has a `forwarder` relation, this relation is removed first.", - "deprecationReason": null - }, - { - "name": "createForwarder", - "description": "Creates a new `Forwarder` and sets the `forwarder` relation to the created object.\n\nIf this `Delivery` already has a `forwarder` relation, this relation is removed first.", - "deprecationReason": null - }, - { - "name": "destination", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString2", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueInt", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueTrue", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFalse", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFloat", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueEnum", - "description": null, - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeStart", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd", - "description": null, - "deprecationReason": null - }, - { - "name": "dynamicData", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "colorData", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": null, - "deprecationReason": null - }, - { - "name": "aText", - "description": null, - "deprecationReason": null - }, - { - "name": "aNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { - "name": "processingFinished", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecatedField", - "description": null, - "deprecationReason": null - }, - { - "name": "enumWithDeprecation", - "description": null, - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": null, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Delivery._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateDangerousGoodsInfoInput", - "description": "The update type for the entity extension type `DangerousGoodsInfo`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "unNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "flashpoint", - "description": null, - "deprecationReason": null - }, - { - "name": "notices", - "description": null, - "deprecationReason": null - }, - { - "name": "details", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateDangerousGoodsDetailsInput", - "description": "The update type for the entity extension type `DangerousGoodsDetails`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "expiryDate", - "description": null, - "deprecationReason": null - }, - { - "name": "comment", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateDeliveryItemInput", - "description": "The update type for the child entity type `DeliveryItem`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `DeliveryItem` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "itemNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "quantity", - "description": null, - "deprecationReason": null - }, - { - "name": "weightInKg", - "description": null, - "deprecationReason": null - }, - { - "name": "handlingUnit", - "description": "Specify the `id` of the `HandlingUnit` to be referenced", - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateColorDataInput", - "description": "The update type for the entity extension type `ColorData`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "packageColor", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllDeliveriesInput", - "description": "The update type for the root entity type `Delivery`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "deliveryNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "serialNumbers", - "description": "The list of serial numbers associated with this delivery", - "deprecationReason": null - }, - { - "name": "consignee", - "description": "The address of the delivery's consignee", - "deprecationReason": null - }, - { - "name": "contentInfo", - "description": null, - "deprecationReason": null - }, - { - "name": "dgInfo", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - }, - { - "name": "items", - "description": "Deletes all `DeliveryItems` objects in list of `items` and replaces it with the specified objects.\n\nCannot be combined with the add/update/delete fields for the same child entity list.", - "deprecationReason": null - }, - { - "name": "addItems", - "description": "Adds new `DeliveryItems` to the list of `items`", - "deprecationReason": null - }, - { - "name": "updateItems", - "description": "Updates `DeliveryItems` in the list of `items`", - "deprecationReason": null - }, - { - "name": "removeItems", - "description": "Deletes `DeliveryItems` by ids in the list of `items`", - "deprecationReason": null - }, - { - "name": "destinationCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": "Use \"destinationCountryISOCode\" instead." - }, - { - "name": "destinationCountryISOCode", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "completionDate", - "description": null, - "deprecationReason": null - }, - { - "name": "originCountry", - "description": "Specify the `isoCode` of the `Country` to be referenced", - "deprecationReason": null - }, - { - "name": "shippedAt", - "description": null, - "deprecationReason": null - }, - { - "name": "totalValue", - "description": null, - "deprecationReason": null - }, - { - "name": "destination", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueString2", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueInt", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueTrue", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFalse", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueFloat", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValueEnum", - "description": null, - "deprecationReason": null - }, - { - "name": "dispatchDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupDate", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeStart", - "description": null, - "deprecationReason": null - }, - { - "name": "pickupTimeEnd", - "description": null, - "deprecationReason": null - }, - { - "name": "dynamicData", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "colorData", - "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", - "deprecationReason": null - }, - { - "name": "enumFlexSearch", - "description": null, - "deprecationReason": null - }, - { - "name": "aText", - "description": null, - "deprecationReason": null - }, - { - "name": "aNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "recursion", - "description": null, - "deprecationReason": null - }, - { - "name": "processingFinished", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecatedField", - "description": null, - "deprecationReason": null - }, - { - "name": "enumWithDeprecation", - "description": null, - "deprecationReason": null - }, - { - "name": "sometimesNull", - "description": null, - "deprecationReason": null - }, - { - "name": "caseInsensitiveField", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Delivery._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateForwarderInput", - "description": "The update type for the root entity type `Forwarder`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `Forwarder` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "addDeliveries", - "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.\n\nIf one of the `Deliveries` is already related to a different `Forwarder`, these relations are removed first.", - "deprecationReason": null - }, - { - "name": "removeDeliveries", - "description": "Removes `deliveries` relations to existing `Deliveries` by their ids.", - "deprecationReason": null - }, - { - "name": "createDeliveries", - "description": "Creates new `Deliveries` and adds `deliveries` relations between them and this `Forwarder`.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Forwarder._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllForwardersInput", - "description": "The update type for the root entity type `Forwarder`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"Forwarder._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "CreateOnlyRelationsInput", - "description": "The create type for the root entity type `OnlyRelations`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "deliveries", - "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.", - "deprecationReason": null - }, - { - "name": "createDeliveries", - "description": "Creates new `Deliveries` and adds `deliveries` relations between them and the new `OnlyRelations`.", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateOnlyRelationsInput", - "description": "The update type for the root entity type `OnlyRelations`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `OnlyRelations` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "addDeliveries", - "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.", - "deprecationReason": null - }, - { - "name": "removeDeliveries", - "description": "Removes `deliveries` relations to existing `Deliveries` by their ids.", - "deprecationReason": null - }, - { - "name": "createDeliveries", - "description": "Creates new `Deliveries` and adds `deliveries` relations between them and this `OnlyRelations`.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"OnlyRelations._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateHandlingUnitInput", - "description": "The update type for the root entity type `HandlingUnit`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `HandlingUnit` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "huNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "delivery", - "description": "Sets the `delivery` relation to an existing `Delivery` by its id.\n\nIf this `HandlingUnit` already has a `delivery` relation, this relation is removed first.", - "deprecationReason": null - }, - { - "name": "createDelivery", - "description": "Creates a new `Delivery` and sets the `delivery` relation to the created object.\n\nIf this `HandlingUnit` already has a `delivery` relation, this relation is removed first.", - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"HandlingUnit._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllHandlingUnitsInput", - "description": "The update type for the root entity type `HandlingUnit`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "huNumber", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"HandlingUnit._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "CreateNumberRangeInput", - "description": "The create type for the root entity type `NumberRange`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "number", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateNumberRangeInput", - "description": "The update type for the root entity type `NumberRange`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `NumberRange` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "number", - "description": null, - "deprecationReason": null - }, - { - "name": "addTo_number", - "description": null, - "deprecationReason": null - }, - { - "name": "multiplyWith_number", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"NumberRange._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllNumberRangesInput", - "description": "The update type for the root entity type `NumberRange`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "number", - "description": null, - "deprecationReason": null - }, - { - "name": "addTo_number", - "description": null, - "deprecationReason": null - }, - { - "name": "multiplyWith_number", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"NumberRange._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "CreateSecretKeyInput", - "description": "The create type for the root entity type `SecretKey`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", - "fields": null, - "inputFields": [ - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "value", - "description": null, - "deprecationReason": null - } - ] - }, - { - "name": "UpdateSecretKeyInput", - "description": "The update type for the root entity type `SecretKey`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The `id` of the `SecretKey` to be updated (does not change the `id`).", - "deprecationReason": null - }, - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "value", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"SecretKey._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "UpdateAllSecretKeysInput", - "description": "The update type for the root entity type `SecretKey`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", - "fields": null, - "inputFields": [ - { - "name": "key", - "description": null, - "deprecationReason": null - }, - { - "name": "value", - "description": null, - "deprecationReason": null - }, - { - "name": "_revision", - "description": "Set this field to the value of \"SecretKey._revision\" to abort the transaction if this object has been modified in the meantime", - "deprecationReason": null - } - ] - }, - { - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "types", - "description": "A list of all types supported by this server.", - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "specifiedByURL", - "description": null, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null - }, - { - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "deprecationReason": null - }, - { - "name": "isRepeatable", - "description": null, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null - }, - { - "name": "Query", - "description": "The Query type for the root namespace", - "fields": [ - { - "name": "BillingEntity", - "description": "Finds a BillingEntity by id", - "deprecationReason": null - }, - { - "name": "allBillingEntities", - "description": null, - "deprecationReason": null - }, - { - "name": "_allBillingEntitiesMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "Country", - "description": "Finds a Country by id or isoCode.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "allCountries", - "description": null, - "deprecationReason": null - }, - { - "name": "_allCountriesMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "flexSearchCountries", - "description": "Queries for Countries using FlexSearch.", - "deprecationReason": null - }, - { - "name": "_flexSearchCountriesMeta", - "description": "Queries for Countries using FlexSearch.", - "deprecationReason": null - }, - { - "name": "Delivery", - "description": "Finds a Delivery by id or deliveryNumber.\n\nYou should pass a non-null value to exactly one of the arguments.\n\nA delivery", - "deprecationReason": null - }, - { - "name": "allDeliveries", - "description": "A delivery", - "deprecationReason": null - }, - { - "name": "_allDeliveriesMeta", - "description": "A delivery", - "deprecationReason": null - }, - { - "name": "flexSearchDeliveries", - "description": "Queries for Deliveries using FlexSearch.", - "deprecationReason": null - }, - { - "name": "_flexSearchDeliveriesMeta", - "description": "Queries for Deliveries using FlexSearch.", - "deprecationReason": null - }, - { - "name": "Forwarder", - "description": "Finds a Forwarder by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "allForwarders", - "description": null, - "deprecationReason": null - }, - { - "name": "_allForwardersMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "OnlyRelations", - "description": "Finds a OnlyRelations by id", - "deprecationReason": null - }, - { - "name": "allOnlyRelations", - "description": null, - "deprecationReason": null - }, - { - "name": "_allOnlyRelationsMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "HandlingUnit", - "description": "Finds a HandlingUnit by id or id.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "allHandlingUnits", - "description": null, - "deprecationReason": null - }, - { - "name": "_allHandlingUnitsMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "flexSearchHandlingUnits", - "description": "Queries for HandlingUnits using FlexSearch.", - "deprecationReason": null - }, - { - "name": "_flexSearchHandlingUnitsMeta", - "description": "Queries for HandlingUnits using FlexSearch.", - "deprecationReason": null - }, - { - "name": "NumberRange", - "description": "Finds a NumberRange by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "allNumberRanges", - "description": null, - "deprecationReason": null - }, - { - "name": "_allNumberRangesMeta", - "description": null, - "deprecationReason": null - }, - { - "name": "SecretKey", - "description": "Finds a SecretKey by id or key.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "allSecretKeys", - "description": null, - "deprecationReason": null - }, - { - "name": "_allSecretKeysMeta", - "description": null, - "deprecationReason": null - } - ], - "inputFields": null - }, - { - "name": "Mutation", - "description": "The Mutation type for the root namespace\n\nFields are executed serially in the order they occur in the selection set (the result of the first field does not see the changes made by the second field). All mutations are executed atomically - if any of them fail, the complete operation is rolled back.", - "fields": [ - { - "name": "createBillingEntity", - "description": "Creates a new BillingEntity", - "deprecationReason": null - }, - { - "name": "createBillingEntities", - "description": "Creates multiple new BillingEntities", - "deprecationReason": null - }, - { - "name": "updateBillingEntity", - "description": "Updates an existing BillingEntity", - "deprecationReason": null - }, - { - "name": "updateBillingEntities", - "description": "Updates multiple existing BillingEntities (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllBillingEntities", - "description": "Updates BillingEntities that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteBillingEntity", - "description": "Deletes a BillingEntity by id", - "deprecationReason": null - }, - { - "name": "deleteBillingEntities", - "description": "Deletes multiple BillingEntities by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllBillingEntities", - "description": "Deletes BillingEntities that match a specified filter", - "deprecationReason": null - }, - { - "name": "createCountry", - "description": "Creates a new Country", - "deprecationReason": null - }, - { - "name": "createCountries", - "description": "Creates multiple new Countries", - "deprecationReason": null - }, - { - "name": "updateCountry", - "description": "Updates an existing Country", - "deprecationReason": null - }, - { - "name": "updateCountries", - "description": "Updates multiple existing Countries (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllCountries", - "description": "Updates Countries that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteCountry", - "description": "Deletes a Country by id or isoCode.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteCountries", - "description": "Deletes multiple Countries by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllCountries", - "description": "Deletes Countries that match a specified filter", - "deprecationReason": null - }, - { - "name": "createDelivery", - "description": "Creates a new Delivery", - "deprecationReason": null - }, - { - "name": "createDeliveries", - "description": "Creates multiple new Deliveries", - "deprecationReason": null - }, - { - "name": "updateDelivery", - "description": "Updates an existing Delivery", - "deprecationReason": null - }, - { - "name": "updateDeliveries", - "description": "Updates multiple existing Deliveries (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllDeliveries", - "description": "Updates Deliveries that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteDelivery", - "description": "Deletes a Delivery by id or deliveryNumber.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteDeliveries", - "description": "Deletes multiple Deliveries by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllDeliveries", - "description": "Deletes Deliveries that match a specified filter", - "deprecationReason": null - }, - { - "name": "confirmBillingForDelivery", - "description": "Confirms a Delivery to be exported to billing.", - "deprecationReason": null - }, - { - "name": "createForwarder", - "description": "Creates a new Forwarder", - "deprecationReason": null - }, - { - "name": "createForwarders", - "description": "Creates multiple new Forwarders", - "deprecationReason": null - }, - { - "name": "updateForwarder", - "description": "Updates an existing Forwarder", - "deprecationReason": null - }, - { - "name": "updateForwarders", - "description": "Updates multiple existing Forwarders (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllForwarders", - "description": "Updates Forwarders that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteForwarder", - "description": "Deletes a Forwarder by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteForwarders", - "description": "Deletes multiple Forwarders by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllForwarders", - "description": "Deletes Forwarders that match a specified filter", - "deprecationReason": null - }, - { - "name": "createOnlyRelations", - "description": "Creates a new OnlyRelations", - "deprecationReason": null - }, - { - "name": "updateOnlyRelations", - "description": "Updates an existing OnlyRelations", - "deprecationReason": null - }, - { - "name": "deleteOnlyRelations", - "description": "Deletes a OnlyRelations by id", - "deprecationReason": null - }, - { - "name": "deleteAllOnlyRelations", - "description": "Deletes OnlyRelations that match a specified filter", - "deprecationReason": null - }, - { - "name": "createHandlingUnit", - "description": "Creates a new HandlingUnit", - "deprecationReason": null - }, - { - "name": "createHandlingUnits", - "description": "Creates multiple new HandlingUnits", - "deprecationReason": null - }, - { - "name": "updateHandlingUnit", - "description": "Updates an existing HandlingUnit", - "deprecationReason": null - }, - { - "name": "updateHandlingUnits", - "description": "Updates multiple existing HandlingUnits (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllHandlingUnits", - "description": "Updates HandlingUnits that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteHandlingUnit", - "description": "Deletes a HandlingUnit by id or id.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteHandlingUnits", - "description": "Deletes multiple HandlingUnits by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllHandlingUnits", - "description": "Deletes HandlingUnits that match a specified filter", - "deprecationReason": null - }, - { - "name": "createNumberRange", - "description": "Creates a new NumberRange", - "deprecationReason": null - }, - { - "name": "createNumberRanges", - "description": "Creates multiple new NumberRanges", - "deprecationReason": null - }, - { - "name": "updateNumberRange", - "description": "Updates an existing NumberRange", - "deprecationReason": null - }, - { - "name": "updateNumberRanges", - "description": "Updates multiple existing NumberRanges (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllNumberRanges", - "description": "Updates NumberRanges that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteNumberRange", - "description": "Deletes a NumberRange by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteNumberRanges", - "description": "Deletes multiple NumberRanges by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllNumberRanges", - "description": "Deletes NumberRanges that match a specified filter", - "deprecationReason": null - }, - { - "name": "createSecretKey", - "description": "Creates a new SecretKey", - "deprecationReason": null - }, - { - "name": "createSecretKeys", - "description": "Creates multiple new SecretKeys", - "deprecationReason": null - }, - { - "name": "updateSecretKey", - "description": "Updates an existing SecretKey", - "deprecationReason": null - }, - { - "name": "updateSecretKeys", - "description": "Updates multiple existing SecretKeys (referenced by their ids)", - "deprecationReason": null - }, - { - "name": "updateAllSecretKeys", - "description": "Updates SecretKeys that match a specified filter", - "deprecationReason": null - }, - { - "name": "deleteSecretKey", - "description": "Deletes a SecretKey by id or key.\n\nYou should pass a non-null value to exactly one of the arguments.", - "deprecationReason": null - }, - { - "name": "deleteSecretKeys", - "description": "Deletes multiple SecretKeys by their ids.\n\nIDs that are not found are silently ignored.", - "deprecationReason": null - }, - { - "name": "deleteAllSecretKeys", - "description": "Deletes SecretKeys that match a specified filter", - "deprecationReason": null - } - ], - "inputFields": null - } - ] - } - } -} diff --git a/spec/regression/logistics/tests/descriptions/result.json b/spec/regression/logistics/tests/descriptions/result.json new file mode 100644 index 000000000..076e92e07 --- /dev/null +++ b/spec/regression/logistics/tests/descriptions/result.json @@ -0,0 +1,9725 @@ +{ + "descriptions": { + "data": { + "__schema": { + "types": [ + { + "name": "BillingEntity", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "isConfirmedForExport", + "description": null, + "deprecationReason": null + }, + { + "name": "isExported", + "description": null, + "deprecationReason": null + }, + { + "name": "confirmedForExportAt", + "description": null, + "deprecationReason": null + }, + { + "name": "exportedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "ID", + "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", + "fields": null, + "inputFields": null + }, + { + "name": "DateTime", + "description": "The `DateTime` scalar type represents a point in time in UTC, in a format specified by ISO 8601, such as `2007-12-03T10:15:30Z` or `2007-12-03T10:15:30.123Z`.\n\nThis scalar type rejects values without timezone specifier or with a timezone other than UTC. See also `LocalDate` and `LocalTime` for values without timezone specifier. To store Date/time values with timezones other than UTC, define a value object type with the fields you need.\n\nThe *second* part is added if not specified, e.g. `2007-12-03T12:34Z` is converted to `2007-12-03T12:34:00Z`. Second fraction digits are cut off at the nearest three-digit group, e.g. `2007-12-03T00:00:00.1234Z` is converted to `2007-12-03T00:00:00.123400Z`.\n\nValues with leap seconds are shifted back by one second, but this behavior should not be relied upon.", + "fields": null, + "inputFields": null + }, + { + "name": "String", + "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null, + "inputFields": null + }, + { + "name": "Boolean", + "description": "The `Boolean` scalar type represents `true` or `false`.", + "fields": null, + "inputFields": null + }, + { + "name": "BillingEntityFilter", + "description": "Filter type for BillingEntity.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "key", + "description": "Checks if `key` equals a specified string, case-sensitively.\n\nIf an index exists on `key`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "key_not", + "description": "Checks if `key` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_in", + "description": "Checks if `key` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "key_not_in", + "description": "Checks if `key` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "key_lt", + "description": "Checks if `key` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "key_lte", + "description": "Checks if `key` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "key_gt", + "description": "Checks if `key` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "key_gte", + "description": "Checks if `key` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "key_contains", + "description": "Checks if `key` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_not_contains", + "description": "Checks if `key` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_starts_with", + "description": "Checks if `key` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "key_not_starts_with", + "description": "Checks if `key` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "key_ends_with", + "description": "Checks if `key` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_not_ends_with", + "description": "Checks if `key` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_like", + "description": "Matches `key` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `key`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "key_not_like", + "description": "Checks if `key` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "type", + "description": "Checks if `type` equals a specified string, case-sensitively.\n\nIf an index exists on `type`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "type_not", + "description": "Checks if `type` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "type_in", + "description": "Checks if `type` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "type_not_in", + "description": "Checks if `type` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "type_lt", + "description": "Checks if `type` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "type_lte", + "description": "Checks if `type` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "type_gt", + "description": "Checks if `type` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "type_gte", + "description": "Checks if `type` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "type_contains", + "description": "Checks if `type` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "type_not_contains", + "description": "Checks if `type` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "type_starts_with", + "description": "Checks if `type` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "type_not_starts_with", + "description": "Checks if `type` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "type_ends_with", + "description": "Checks if `type` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "type_not_ends_with", + "description": "Checks if `type` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "type_like", + "description": "Matches `type` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `type`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "type_not_like", + "description": "Checks if `type` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "isConfirmedForExport", + "description": "Checks if `isConfirmedForExport` equals a specified value.\n\nIf an index exists on `isConfirmedForExport`, it can be used.", + "deprecationReason": null + }, + { + "name": "isConfirmedForExport_not", + "description": "Checks if `isConfirmedForExport` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "isExported", + "description": "Checks if `isExported` equals a specified value.\n\nIf an index exists on `isExported`, it can be used.", + "deprecationReason": null + }, + { + "name": "isExported_not", + "description": "Checks if `isExported` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt", + "description": "Checks if `confirmedForExportAt` equals a specified value.\n\nIf an index exists on `confirmedForExportAt`, it can be used.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_not", + "description": "Checks if `confirmedForExportAt` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_in", + "description": "Checks if `confirmedForExportAt` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_not_in", + "description": "Checks if `confirmedForExportAt` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_lt", + "description": "Checks if `confirmedForExportAt` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_lte", + "description": "Checks if `confirmedForExportAt` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_gt", + "description": "Checks if `confirmedForExportAt` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "confirmedForExportAt_gte", + "description": "Checks if `confirmedForExportAt` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "exportedAt", + "description": "Checks if `exportedAt` equals a specified value.\n\nIf an index exists on `exportedAt`, it can be used.", + "deprecationReason": null + }, + { + "name": "exportedAt_not", + "description": "Checks if `exportedAt` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "exportedAt_in", + "description": "Checks if `exportedAt` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "exportedAt_not_in", + "description": "Checks if `exportedAt` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "exportedAt_lt", + "description": "Checks if `exportedAt` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "exportedAt_lte", + "description": "Checks if `exportedAt` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "exportedAt_gt", + "description": "Checks if `exportedAt` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "exportedAt_gte", + "description": "Checks if `exportedAt` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "BillingEntityOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "Int", + "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", + "fields": null, + "inputFields": null + }, + { + "name": "_QueryMeta", + "description": "Provides aggregated information about a collection or list", + "fields": [ + { + "name": "count", + "description": "The number of items in the collection or list, after applying the filter if specified.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Country", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "isoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "_descriptionMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "descriptionI18nString", + "description": null, + "deprecationReason": null + }, + { + "name": "totalInvestment", + "description": null, + "deprecationReason": null + }, + { + "name": "someKey", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Translation", + "description": null, + "fields": [ + { + "name": "languageIsoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "translation", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "TranslationFilter", + "description": "Filter type for Translation.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "languageIsoCode", + "description": "Checks if `languageIsoCode` equals a specified string, case-sensitively.\n\nIf an index exists on `languageIsoCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not", + "description": "Checks if `languageIsoCode` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_in", + "description": "Checks if `languageIsoCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not_in", + "description": "Checks if `languageIsoCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_lt", + "description": "Checks if `languageIsoCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_lte", + "description": "Checks if `languageIsoCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_gt", + "description": "Checks if `languageIsoCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_gte", + "description": "Checks if `languageIsoCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_contains", + "description": "Checks if `languageIsoCode` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not_contains", + "description": "Checks if `languageIsoCode` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_starts_with", + "description": "Checks if `languageIsoCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not_starts_with", + "description": "Checks if `languageIsoCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_ends_with", + "description": "Checks if `languageIsoCode` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not_ends_with", + "description": "Checks if `languageIsoCode` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "languageIsoCode_like", + "description": "Matches `languageIsoCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `languageIsoCode`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "languageIsoCode_not_like", + "description": "Checks if `languageIsoCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "translation", + "description": "Checks if `translation` equals a specified string, case-sensitively.\n\nIf an index exists on `translation`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "translation_not", + "description": "Checks if `translation` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "translation_in", + "description": "Checks if `translation` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "translation_not_in", + "description": "Checks if `translation` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "translation_lt", + "description": "Checks if `translation` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "translation_lte", + "description": "Checks if `translation` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "translation_gt", + "description": "Checks if `translation` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "translation_gte", + "description": "Checks if `translation` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "translation_contains", + "description": "Checks if `translation` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "translation_not_contains", + "description": "Checks if `translation` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "translation_starts_with", + "description": "Checks if `translation` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "translation_not_starts_with", + "description": "Checks if `translation` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "translation_ends_with", + "description": "Checks if `translation` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "translation_not_ends_with", + "description": "Checks if `translation` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "translation_like", + "description": "Matches `translation` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `translation`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "translation_not_like", + "description": "Checks if `translation` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "TranslationOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "I18nString", + "description": "The \"I18nString\" scalar type represents an internationalized string.\n\n Structurally, the \"I18nString`\" type is equivalent to the \"StringMap\" type. Keys are ISO 639-1 language codes, and values are the localized strings. In the future, more specific features may be added to this type, so it is preferred over the \"StringMap\" type to represent internationalized strings.\n\n Values are *not* additionally JSON-encoded or JSON-parsed, so e.g. pass a raw JSON object here instead of a JSON-representation of that object.", + "fields": null, + "inputFields": null + }, + { + "name": "CountryFilter", + "description": "Filter type for Country.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "isoCode", + "description": "Checks if `isoCode` equals a specified string, case-sensitively.\n\nIf an index exists on `isoCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "isoCode_not", + "description": "Checks if `isoCode` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_in", + "description": "Checks if `isoCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "isoCode_not_in", + "description": "Checks if `isoCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "isoCode_lt", + "description": "Checks if `isoCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_lte", + "description": "Checks if `isoCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_gt", + "description": "Checks if `isoCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_gte", + "description": "Checks if `isoCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_contains", + "description": "Checks if `isoCode` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_not_contains", + "description": "Checks if `isoCode` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_starts_with", + "description": "Checks if `isoCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "isoCode_not_starts_with", + "description": "Checks if `isoCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "isoCode_ends_with", + "description": "Checks if `isoCode` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_not_ends_with", + "description": "Checks if `isoCode` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_like", + "description": "Matches `isoCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `isoCode`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "isoCode_not_like", + "description": "Checks if `isoCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "description_some", + "description": "Makes sure at least one of the items in \"description\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", + "deprecationReason": null + }, + { + "name": "description_every", + "description": "Makes sure all items in `description` match a certain filter.", + "deprecationReason": null + }, + { + "name": "description_none", + "description": "Makes sure none of the items in `description` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has no items.", + "deprecationReason": null + }, + { + "name": "description_empty", + "description": "Checks if `description` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "descriptionI18nString_some", + "description": "Makes sure at least one of the entries in \"descriptionI18nString\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `descriptionI18nString` has at least one item.", + "deprecationReason": null + }, + { + "name": "totalInvestment", + "description": "Checks if `totalInvestment` equals a specified string, case-sensitively.\n\nIf an index exists on `totalInvestment`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "totalInvestment_not", + "description": "Checks if `totalInvestment` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalInvestment_in", + "description": "Checks if `totalInvestment` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "totalInvestment_not_in", + "description": "Checks if `totalInvestment` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "totalInvestment_lt", + "description": "Checks if `totalInvestment` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "totalInvestment_lte", + "description": "Checks if `totalInvestment` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "totalInvestment_gt", + "description": "Checks if `totalInvestment` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "totalInvestment_gte", + "description": "Checks if `totalInvestment` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "totalInvestment_contains", + "description": "Checks if `totalInvestment` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalInvestment_not_contains", + "description": "Checks if `totalInvestment` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalInvestment_starts_with", + "description": "Checks if `totalInvestment` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "totalInvestment_not_starts_with", + "description": "Checks if `totalInvestment` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "totalInvestment_ends_with", + "description": "Checks if `totalInvestment` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalInvestment_not_ends_with", + "description": "Checks if `totalInvestment` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalInvestment_like", + "description": "Matches `totalInvestment` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `totalInvestment`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "totalInvestment_not_like", + "description": "Checks if `totalInvestment` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "someKey", + "description": "Checks if `someKey` equals a specified string, case-sensitively.\n\nIf an index exists on `someKey`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "someKey_not", + "description": "Checks if `someKey` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "someKey_in", + "description": "Checks if `someKey` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "someKey_not_in", + "description": "Checks if `someKey` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "someKey_lt", + "description": "Checks if `someKey` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_lte", + "description": "Checks if `someKey` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_gt", + "description": "Checks if `someKey` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_gte", + "description": "Checks if `someKey` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_contains", + "description": "Checks if `someKey` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "someKey_not_contains", + "description": "Checks if `someKey` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "someKey_starts_with", + "description": "Checks if `someKey` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "someKey_not_starts_with", + "description": "Checks if `someKey` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "someKey_ends_with", + "description": "Checks if `someKey` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "someKey_not_ends_with", + "description": "Checks if `someKey` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "someKey_like", + "description": "Matches `someKey` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `someKey`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "someKey_not_like", + "description": "Checks if `someKey` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "I18nStringEntryFilter", + "description": "Filter type for entries in a I18nString.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "language", + "description": "Checks if `language` equals a specified string, case-sensitively.\n\nIf an index exists on `language`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "language_not", + "description": "Checks if `language` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "language_in", + "description": "Checks if `language` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "language_not_in", + "description": "Checks if `language` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "language_lt", + "description": "Checks if `language` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "language_lte", + "description": "Checks if `language` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "language_gt", + "description": "Checks if `language` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "language_gte", + "description": "Checks if `language` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "language_contains", + "description": "Checks if `language` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "language_not_contains", + "description": "Checks if `language` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "language_starts_with", + "description": "Checks if `language` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "language_not_starts_with", + "description": "Checks if `language` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "language_ends_with", + "description": "Checks if `language` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "language_not_ends_with", + "description": "Checks if `language` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "language_like", + "description": "Matches `language` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `language`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "language_not_like", + "description": "Checks if `language` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "value", + "description": "Checks if `value` equals a specified string, case-sensitively.\n\nIf an index exists on `value`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "value_not", + "description": "Checks if `value` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_in", + "description": "Checks if `value` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "value_not_in", + "description": "Checks if `value` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "value_lt", + "description": "Checks if `value` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "value_lte", + "description": "Checks if `value` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "value_gt", + "description": "Checks if `value` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "value_gte", + "description": "Checks if `value` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "value_contains", + "description": "Checks if `value` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_not_contains", + "description": "Checks if `value` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_starts_with", + "description": "Checks if `value` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "value_not_starts_with", + "description": "Checks if `value` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "value_ends_with", + "description": "Checks if `value` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_not_ends_with", + "description": "Checks if `value` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_like", + "description": "Matches `value` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `value`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "value_not_like", + "description": "Checks if `value` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "CountryOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "CountryFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "isoCode", + "description": "Checks if `isoCode` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_not", + "description": "Checks if `isoCode` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_lt", + "description": "Checks if `isoCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_lte", + "description": "Checks if `isoCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_gt", + "description": "Checks if `isoCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_gte", + "description": "Checks if `isoCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "isoCode_in", + "description": "Checks if `isoCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "isoCode_not_in", + "description": "Checks if `isoCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "isoCode_starts_with", + "description": "Checks if `isoCode` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "isoCode_not_starts_with", + "description": "Checks if `isoCode` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "someKey", + "description": "Checks if `someKey` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "someKey_not", + "description": "Checks if `someKey` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "someKey_lt", + "description": "Checks if `someKey` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_lte", + "description": "Checks if `someKey` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_gt", + "description": "Checks if `someKey` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_gte", + "description": "Checks if `someKey` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "someKey_in", + "description": "Checks if `someKey` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "someKey_not_in", + "description": "Checks if `someKey` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "someKey_starts_with", + "description": "Checks if `someKey` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "someKey_not_starts_with", + "description": "Checks if `someKey` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "Delivery", + "description": "A delivery", + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "deliveryNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "serialNumbers", + "description": "The list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "The address of the delivery's consignee", + "deprecationReason": null + }, + { + "name": "contentInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "_contentInfoMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "items", + "description": null, + "deprecationReason": null + }, + { + "name": "_itemsMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "handlingUnits", + "description": "The handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "_handlingUnitsMeta", + "description": "The handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "destinationCountry", + "description": "The country to where the delivery should be shipped\n\nThis field references a `Country` by its `isoCode` field", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode", + "description": null, + "deprecationReason": null + }, + { + "name": "completionDate", + "description": null, + "deprecationReason": null + }, + { + "name": "originCountry", + "description": "This field references a `Country` by its `isoCode` field", + "deprecationReason": null + }, + { + "name": "shippedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "totalValue", + "description": null, + "deprecationReason": null + }, + { + "name": "forwarder", + "description": null, + "deprecationReason": null + }, + { + "name": "destination", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString2", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueInt", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueTrue", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFalse", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFloat", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueEnum", + "description": null, + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeStart", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd", + "description": null, + "deprecationReason": null + }, + { + "name": "dynamicData", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "colorData", + "description": null, + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": null, + "deprecationReason": null + }, + { + "name": "aText", + "description": null, + "deprecationReason": null + }, + { + "name": "aNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecatedField", + "description": null, + "deprecationReason": "do not use" + }, + { + "name": "enumWithDeprecation", + "description": null, + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": null, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Address", + "description": null, + "fields": [ + { + "name": "street", + "description": null, + "deprecationReason": null + }, + { + "name": "city", + "description": null, + "deprecationReason": null + }, + { + "name": "zipCode", + "description": null, + "deprecationReason": null + }, + { + "name": "country", + "description": "This field references a `Country` by its `isoCode` field", + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "DangerousGoodsInfo", + "description": null, + "fields": [ + { + "name": "unNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "flashpoint", + "description": null, + "deprecationReason": null + }, + { + "name": "notices", + "description": null, + "deprecationReason": null + }, + { + "name": "details", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "DangerousGoodsDetails", + "description": null, + "fields": [ + { + "name": "expiryDate", + "description": null, + "deprecationReason": null + }, + { + "name": "comment", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "LocalDate", + "description": "The `LocalDate` scalar type represents a date without time zone in a format specified by ISO 8601, such as 2007-12-03.", + "fields": null, + "inputFields": null + }, + { + "name": "DeliveryItem", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "itemNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "quantity", + "description": null, + "deprecationReason": null + }, + { + "name": "weightInKg", + "description": null, + "deprecationReason": null + }, + { + "name": "handlingUnit", + "description": "This field references a `HandlingUnit` by its `id` field", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Float", + "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", + "fields": null, + "inputFields": null + }, + { + "name": "HandlingUnit", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "huNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "delivery", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "DeliveryItemFilter", + "description": "Filter type for DeliveryItem.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "itemNumber", + "description": "Checks if `itemNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `itemNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "itemNumber_not", + "description": "Checks if `itemNumber` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "itemNumber_in", + "description": "Checks if `itemNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_in", + "description": "Checks if `itemNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "itemNumber_lt", + "description": "Checks if `itemNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "itemNumber_lte", + "description": "Checks if `itemNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "itemNumber_gt", + "description": "Checks if `itemNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "itemNumber_gte", + "description": "Checks if `itemNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "itemNumber_contains", + "description": "Checks if `itemNumber` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains", + "description": "Checks if `itemNumber` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "itemNumber_starts_with", + "description": "Checks if `itemNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_starts_with", + "description": "Checks if `itemNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "itemNumber_ends_with", + "description": "Checks if `itemNumber` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_ends_with", + "description": "Checks if `itemNumber` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "itemNumber_like", + "description": "Matches `itemNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `itemNumber`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "itemNumber_not_like", + "description": "Checks if `itemNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "quantity", + "description": "Checks if `quantity` equals a specified value.\n\nIf an index exists on `quantity`, it can be used.", + "deprecationReason": null + }, + { + "name": "quantity_not", + "description": "Checks if `quantity` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "quantity_in", + "description": "Checks if `quantity` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "quantity_not_in", + "description": "Checks if `quantity` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "quantity_lt", + "description": "Checks if `quantity` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_lte", + "description": "Checks if `quantity` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_gt", + "description": "Checks if `quantity` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_gte", + "description": "Checks if `quantity` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "weightInKg", + "description": "Checks if `weightInKg` equals a specified value.\n\nIf an index exists on `weightInKg`, it can be used.", + "deprecationReason": null + }, + { + "name": "weightInKg_not", + "description": "Checks if `weightInKg` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "weightInKg_in", + "description": "Checks if `weightInKg` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "weightInKg_not_in", + "description": "Checks if `weightInKg` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "weightInKg_lt", + "description": "Checks if `weightInKg` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "weightInKg_lte", + "description": "Checks if `weightInKg` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "weightInKg_gt", + "description": "Checks if `weightInKg` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "weightInKg_gte", + "description": "Checks if `weightInKg` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "handlingUnit", + "description": "Filters the through `id` referenced HandlingUnits that fulfills the given requirements.\n\n Checks if `handlingUnit` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "description_some", + "description": "Makes sure at least one of the entries in \"description\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "HandlingUnitFilter", + "description": "Filter type for HandlingUnit.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "huNumber", + "description": "Checks if `huNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `huNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "huNumber_not", + "description": "Checks if `huNumber` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_in", + "description": "Checks if `huNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "huNumber_not_in", + "description": "Checks if `huNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "huNumber_lt", + "description": "Checks if `huNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_lte", + "description": "Checks if `huNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_gt", + "description": "Checks if `huNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_gte", + "description": "Checks if `huNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_contains", + "description": "Checks if `huNumber` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_not_contains", + "description": "Checks if `huNumber` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_starts_with", + "description": "Checks if `huNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "huNumber_not_starts_with", + "description": "Checks if `huNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "huNumber_ends_with", + "description": "Checks if `huNumber` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_not_ends_with", + "description": "Checks if `huNumber` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_like", + "description": "Matches `huNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `huNumber`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "huNumber_not_like", + "description": "Checks if `huNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "delivery", + "description": "Checks if `delivery` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "DeliveryFilter", + "description": "Filter type for Delivery.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "deliveryNumber", + "description": "Checks if `deliveryNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `deliveryNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not", + "description": "Checks if `deliveryNumber` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_in", + "description": "Checks if `deliveryNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_in", + "description": "Checks if `deliveryNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_lt", + "description": "Checks if `deliveryNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_lte", + "description": "Checks if `deliveryNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_gt", + "description": "Checks if `deliveryNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_gte", + "description": "Checks if `deliveryNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_contains", + "description": "Checks if `deliveryNumber` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_contains", + "description": "Checks if `deliveryNumber` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_starts_with", + "description": "Checks if `deliveryNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_starts_with", + "description": "Checks if `deliveryNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_ends_with", + "description": "Checks if `deliveryNumber` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_ends_with", + "description": "Checks if `deliveryNumber` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_like", + "description": "Matches `deliveryNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `deliveryNumber`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_like", + "description": "Checks if `deliveryNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "serialNumbers_some", + "description": "Makes sure at least one of the items in \"serialNumbers\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `serialNumbers` has at least one item.", + "deprecationReason": null + }, + { + "name": "serialNumbers_every", + "description": "Makes sure all items in `serialNumbers` match a certain filter.", + "deprecationReason": null + }, + { + "name": "serialNumbers_none", + "description": "Makes sure none of the items in `serialNumbers` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `serialNumbers` has no items.", + "deprecationReason": null + }, + { + "name": "serialNumbers_empty", + "description": "Checks if `serialNumbers` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "Checks if `consignee` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "contentInfo_some", + "description": "Makes sure at least one of the items in \"contentInfo\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `contentInfo` has at least one item.", + "deprecationReason": null + }, + { + "name": "contentInfo_every", + "description": "Makes sure all items in `contentInfo` match a certain filter.", + "deprecationReason": null + }, + { + "name": "contentInfo_none", + "description": "Makes sure none of the items in `contentInfo` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `contentInfo` has no items.", + "deprecationReason": null + }, + { + "name": "contentInfo_empty", + "description": "Checks if `contentInfo` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "items_some", + "description": "Makes sure at least one of the items in \"items\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `items` has at least one item.", + "deprecationReason": null + }, + { + "name": "items_every", + "description": "Makes sure all items in `items` match a certain filter.", + "deprecationReason": null + }, + { + "name": "items_none", + "description": "Makes sure none of the items in `items` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `items` has no items.", + "deprecationReason": null + }, + { + "name": "items_empty", + "description": "Checks if `items` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "handlingUnits_some", + "description": "Makes sure at least one of the items in \"handlingUnits\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `handlingUnits` has at least one item.", + "deprecationReason": null + }, + { + "name": "handlingUnits_every", + "description": "Makes sure all items in `handlingUnits` match a certain filter.", + "deprecationReason": null + }, + { + "name": "handlingUnits_none", + "description": "Makes sure none of the items in `handlingUnits` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `handlingUnits` has no items.", + "deprecationReason": null + }, + { + "name": "handlingUnits_empty", + "description": "Checks if `handlingUnits` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "destinationCountry", + "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `destinationCountry` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode", + "description": "Checks if `destinationCountryISOCode` equals a specified string, case-sensitively.\n\nIf an index exists on `destinationCountryISOCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not", + "description": "Checks if `destinationCountryISOCode` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_in", + "description": "Checks if `destinationCountryISOCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_in", + "description": "Checks if `destinationCountryISOCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_lt", + "description": "Checks if `destinationCountryISOCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_lte", + "description": "Checks if `destinationCountryISOCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_gt", + "description": "Checks if `destinationCountryISOCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_gte", + "description": "Checks if `destinationCountryISOCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_contains", + "description": "Checks if `destinationCountryISOCode` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_contains", + "description": "Checks if `destinationCountryISOCode` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_starts_with", + "description": "Checks if `destinationCountryISOCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_starts_with", + "description": "Checks if `destinationCountryISOCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_ends_with", + "description": "Checks if `destinationCountryISOCode` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_ends_with", + "description": "Checks if `destinationCountryISOCode` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_like", + "description": "Matches `destinationCountryISOCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `destinationCountryISOCode`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_like", + "description": "Checks if `destinationCountryISOCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "completionDate", + "description": "Checks if `completionDate` equals a specified value.\n\nIf an index exists on `completionDate`, it can be used.", + "deprecationReason": null + }, + { + "name": "completionDate_not", + "description": "Checks if `completionDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "completionDate_in", + "description": "Checks if `completionDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "completionDate_not_in", + "description": "Checks if `completionDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "completionDate_lt", + "description": "Checks if `completionDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_lte", + "description": "Checks if `completionDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_gt", + "description": "Checks if `completionDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_gte", + "description": "Checks if `completionDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "originCountry", + "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `originCountry` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "shippedAt", + "description": "Checks if `shippedAt` equals a specified value.\n\nIf an index exists on `shippedAt`, it can be used.", + "deprecationReason": null + }, + { + "name": "shippedAt_not", + "description": "Checks if `shippedAt` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "shippedAt_in", + "description": "Checks if `shippedAt` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "shippedAt_not_in", + "description": "Checks if `shippedAt` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "shippedAt_lt", + "description": "Checks if `shippedAt` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "shippedAt_lte", + "description": "Checks if `shippedAt` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "shippedAt_gt", + "description": "Checks if `shippedAt` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "shippedAt_gte", + "description": "Checks if `shippedAt` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "totalValue", + "description": "Checks if `totalValue` equals a specified string, case-sensitively.\n\nIf an index exists on `totalValue`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "totalValue_not", + "description": "Checks if `totalValue` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalValue_in", + "description": "Checks if `totalValue` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "totalValue_not_in", + "description": "Checks if `totalValue` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "totalValue_lt", + "description": "Checks if `totalValue` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "totalValue_lte", + "description": "Checks if `totalValue` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "totalValue_gt", + "description": "Checks if `totalValue` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "totalValue_gte", + "description": "Checks if `totalValue` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "totalValue_contains", + "description": "Checks if `totalValue` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalValue_not_contains", + "description": "Checks if `totalValue` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalValue_starts_with", + "description": "Checks if `totalValue` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "totalValue_not_starts_with", + "description": "Checks if `totalValue` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "totalValue_ends_with", + "description": "Checks if `totalValue` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalValue_not_ends_with", + "description": "Checks if `totalValue` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "totalValue_like", + "description": "Matches `totalValue` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `totalValue`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "totalValue_not_like", + "description": "Checks if `totalValue` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "forwarder", + "description": "Checks if `forwarder` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "destination", + "description": "Checks if `destination` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "defaultValueString", + "description": "Checks if `defaultValueString` equals a specified string, case-sensitively.\n\nIf an index exists on `defaultValueString`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "defaultValueString_not", + "description": "Checks if `defaultValueString` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString_in", + "description": "Checks if `defaultValueString` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueString_not_in", + "description": "Checks if `defaultValueString` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueString_lt", + "description": "Checks if `defaultValueString` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString_lte", + "description": "Checks if `defaultValueString` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString_gt", + "description": "Checks if `defaultValueString` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString_gte", + "description": "Checks if `defaultValueString` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString_contains", + "description": "Checks if `defaultValueString` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString_not_contains", + "description": "Checks if `defaultValueString` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString_starts_with", + "description": "Checks if `defaultValueString` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "defaultValueString_not_starts_with", + "description": "Checks if `defaultValueString` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "defaultValueString_ends_with", + "description": "Checks if `defaultValueString` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString_not_ends_with", + "description": "Checks if `defaultValueString` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString_like", + "description": "Matches `defaultValueString` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `defaultValueString`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "defaultValueString_not_like", + "description": "Checks if `defaultValueString` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "defaultValueString2", + "description": "Checks if `defaultValueString2` equals a specified string, case-sensitively.\n\nIf an index exists on `defaultValueString2`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not", + "description": "Checks if `defaultValueString2` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_in", + "description": "Checks if `defaultValueString2` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not_in", + "description": "Checks if `defaultValueString2` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_lt", + "description": "Checks if `defaultValueString2` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_lte", + "description": "Checks if `defaultValueString2` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_gt", + "description": "Checks if `defaultValueString2` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_gte", + "description": "Checks if `defaultValueString2` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_contains", + "description": "Checks if `defaultValueString2` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not_contains", + "description": "Checks if `defaultValueString2` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_starts_with", + "description": "Checks if `defaultValueString2` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not_starts_with", + "description": "Checks if `defaultValueString2` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_ends_with", + "description": "Checks if `defaultValueString2` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not_ends_with", + "description": "Checks if `defaultValueString2` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "defaultValueString2_like", + "description": "Matches `defaultValueString2` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `defaultValueString2`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "defaultValueString2_not_like", + "description": "Checks if `defaultValueString2` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "defaultValueInt", + "description": "Checks if `defaultValueInt` equals a specified value.\n\nIf an index exists on `defaultValueInt`, it can be used.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_not", + "description": "Checks if `defaultValueInt` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "defaultValueInt_in", + "description": "Checks if `defaultValueInt` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_not_in", + "description": "Checks if `defaultValueInt` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_lt", + "description": "Checks if `defaultValueInt` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_lte", + "description": "Checks if `defaultValueInt` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_gt", + "description": "Checks if `defaultValueInt` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueInt_gte", + "description": "Checks if `defaultValueInt` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueTrue", + "description": "Checks if `defaultValueTrue` equals a specified value.\n\nIf an index exists on `defaultValueTrue`, it can be used.", + "deprecationReason": null + }, + { + "name": "defaultValueTrue_not", + "description": "Checks if `defaultValueTrue` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "defaultValueFalse", + "description": "Checks if `defaultValueFalse` equals a specified value.\n\nIf an index exists on `defaultValueFalse`, it can be used.", + "deprecationReason": null + }, + { + "name": "defaultValueFalse_not", + "description": "Checks if `defaultValueFalse` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "defaultValueFloat", + "description": "Checks if `defaultValueFloat` equals a specified value.\n\nIf an index exists on `defaultValueFloat`, it can be used.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_not", + "description": "Checks if `defaultValueFloat` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_in", + "description": "Checks if `defaultValueFloat` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_not_in", + "description": "Checks if `defaultValueFloat` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_lt", + "description": "Checks if `defaultValueFloat` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_lte", + "description": "Checks if `defaultValueFloat` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_gt", + "description": "Checks if `defaultValueFloat` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueFloat_gte", + "description": "Checks if `defaultValueFloat` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "defaultValueEnum", + "description": "Checks if `defaultValueEnum` equals a specified value.\n\nIf an index exists on `defaultValueEnum`, it can be used.", + "deprecationReason": null + }, + { + "name": "defaultValueEnum_not", + "description": "Checks if `defaultValueEnum` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "defaultValueEnum_in", + "description": "Checks if `defaultValueEnum` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "defaultValueEnum_not_in", + "description": "Checks if `defaultValueEnum` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": "Checks if `dispatchDate` equals a specified value.\n\nIf an index exists on `dispatchDate`, it can be used.", + "deprecationReason": null + }, + { + "name": "dispatchDate_not", + "description": "Checks if `dispatchDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "dispatchDate_in", + "description": "Checks if `dispatchDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "dispatchDate_not_in", + "description": "Checks if `dispatchDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "dispatchDate_lt", + "description": "Checks if `dispatchDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_lte", + "description": "Checks if `dispatchDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_gt", + "description": "Checks if `dispatchDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_gte", + "description": "Checks if `dispatchDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupDate", + "description": "Checks if `pickupDate` equals a specified value.\n\nIf an index exists on `pickupDate`, it can be used.", + "deprecationReason": null + }, + { + "name": "pickupDate_not", + "description": "Checks if `pickupDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "pickupDate_in", + "description": "Checks if `pickupDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupDate_not_in", + "description": "Checks if `pickupDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupDate_lt", + "description": "Checks if `pickupDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupDate_lte", + "description": "Checks if `pickupDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupDate_gt", + "description": "Checks if `pickupDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupDate_gte", + "description": "Checks if `pickupDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart", + "description": "Checks if `pickupTimeStart` equals a specified value.\n\nIf an index exists on `pickupTimeStart`, it can be used.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_not", + "description": "Checks if `pickupTimeStart` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_in", + "description": "Checks if `pickupTimeStart` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_not_in", + "description": "Checks if `pickupTimeStart` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_lt", + "description": "Checks if `pickupTimeStart` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_lte", + "description": "Checks if `pickupTimeStart` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_gt", + "description": "Checks if `pickupTimeStart` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeStart_gte", + "description": "Checks if `pickupTimeStart` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd", + "description": "Checks if `pickupTimeEnd` equals a specified value.\n\nIf an index exists on `pickupTimeEnd`, it can be used.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_not", + "description": "Checks if `pickupTimeEnd` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_in", + "description": "Checks if `pickupTimeEnd` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_not_in", + "description": "Checks if `pickupTimeEnd` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_lt", + "description": "Checks if `pickupTimeEnd` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_lte", + "description": "Checks if `pickupTimeEnd` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_gt", + "description": "Checks if `pickupTimeEnd` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "pickupTimeEnd_gte", + "description": "Checks if `pickupTimeEnd` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "description", + "description": "Checks if `description` equals a specified string, case-sensitively.\n\nIf an index exists on `description`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "description_not", + "description": "Checks if `description` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "description_in", + "description": "Checks if `description` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "description_not_in", + "description": "Checks if `description` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "description_lt", + "description": "Checks if `description` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "description_lte", + "description": "Checks if `description` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "description_gt", + "description": "Checks if `description` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "description_gte", + "description": "Checks if `description` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "description_contains", + "description": "Checks if `description` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "description_not_contains", + "description": "Checks if `description` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "description_starts_with", + "description": "Checks if `description` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "description_not_starts_with", + "description": "Checks if `description` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "description_ends_with", + "description": "Checks if `description` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "description_not_ends_with", + "description": "Checks if `description` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "description_like", + "description": "Matches `description` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `description`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "description_not_like", + "description": "Checks if `description` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "colorData", + "description": "Allows to filter on the fields of `colorData`.\n\nNote that `colorData` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": "Checks if `enumFlexSearch` equals a specified value.\n\nIf an index exists on `enumFlexSearch`, it can be used.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_not", + "description": "Checks if `enumFlexSearch` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_in", + "description": "Checks if `enumFlexSearch` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_not_in", + "description": "Checks if `enumFlexSearch` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText", + "description": "Checks if `aText` equals a specified string, case-sensitively.\n\nIf an index exists on `aText`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "aText_not", + "description": "Checks if `aText` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "aText_in", + "description": "Checks if `aText` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText_not_in", + "description": "Checks if `aText` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText_lt", + "description": "Checks if `aText` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "aText_lte", + "description": "Checks if `aText` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aText_gt", + "description": "Checks if `aText` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "aText_gte", + "description": "Checks if `aText` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aText_contains", + "description": "Checks if `aText` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "aText_not_contains", + "description": "Checks if `aText` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "aText_starts_with", + "description": "Checks if `aText` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "aText_not_starts_with", + "description": "Checks if `aText` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "aText_ends_with", + "description": "Checks if `aText` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "aText_not_ends_with", + "description": "Checks if `aText` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "aText_like", + "description": "Matches `aText` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `aText`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "aText_not_like", + "description": "Checks if `aText` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "aNumber", + "description": "Checks if `aNumber` equals a specified value.\n\nIf an index exists on `aNumber`, it can be used.", + "deprecationReason": null + }, + { + "name": "aNumber_not", + "description": "Checks if `aNumber` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "aNumber_in", + "description": "Checks if `aNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aNumber_not_in", + "description": "Checks if `aNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aNumber_lt", + "description": "Checks if `aNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_lte", + "description": "Checks if `aNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_gt", + "description": "Checks if `aNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_gte", + "description": "Checks if `aNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "recursion", + "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": "Checks if `processingFinished` equals a specified value.\n\nIf an index exists on `processingFinished`, it can be used.", + "deprecationReason": null + }, + { + "name": "processingFinished_not", + "description": "Checks if `processingFinished` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "deprecatedField", + "description": "Checks if `deprecatedField` equals a specified string, case-sensitively.\n\nIf an index exists on `deprecatedField`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "deprecatedField_not", + "description": "Checks if `deprecatedField` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deprecatedField_in", + "description": "Checks if `deprecatedField` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deprecatedField_not_in", + "description": "Checks if `deprecatedField` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deprecatedField_lt", + "description": "Checks if `deprecatedField` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "deprecatedField_lte", + "description": "Checks if `deprecatedField` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deprecatedField_gt", + "description": "Checks if `deprecatedField` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "deprecatedField_gte", + "description": "Checks if `deprecatedField` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deprecatedField_contains", + "description": "Checks if `deprecatedField` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deprecatedField_not_contains", + "description": "Checks if `deprecatedField` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deprecatedField_starts_with", + "description": "Checks if `deprecatedField` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "deprecatedField_not_starts_with", + "description": "Checks if `deprecatedField` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "deprecatedField_ends_with", + "description": "Checks if `deprecatedField` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deprecatedField_not_ends_with", + "description": "Checks if `deprecatedField` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "deprecatedField_like", + "description": "Matches `deprecatedField` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `deprecatedField`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "deprecatedField_not_like", + "description": "Checks if `deprecatedField` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "enumWithDeprecation", + "description": "Checks if `enumWithDeprecation` equals a specified value.\n\nIf an index exists on `enumWithDeprecation`, it can be used.", + "deprecationReason": null + }, + { + "name": "enumWithDeprecation_not", + "description": "Checks if `enumWithDeprecation` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "enumWithDeprecation_in", + "description": "Checks if `enumWithDeprecation` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "enumWithDeprecation_not_in", + "description": "Checks if `enumWithDeprecation` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": "Checks if `sometimesNull` equals a specified string, case-sensitively.\n\nIf an index exists on `sometimesNull`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not", + "description": "Checks if `sometimesNull` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_in", + "description": "Checks if `sometimesNull` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_in", + "description": "Checks if `sometimesNull` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "sometimesNull_lt", + "description": "Checks if `sometimesNull` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_lte", + "description": "Checks if `sometimesNull` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_gt", + "description": "Checks if `sometimesNull` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_gte", + "description": "Checks if `sometimesNull` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_contains", + "description": "Checks if `sometimesNull` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_contains", + "description": "Checks if `sometimesNull` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_starts_with", + "description": "Checks if `sometimesNull` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_starts_with", + "description": "Checks if `sometimesNull` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "sometimesNull_ends_with", + "description": "Checks if `sometimesNull` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_ends_with", + "description": "Checks if `sometimesNull` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_like", + "description": "Matches `sometimesNull` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `sometimesNull`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_like", + "description": "Checks if `sometimesNull` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": "Checks if `caseInsensitiveField` equals a specified string, case-sensitively.\n\nIf an index exists on `caseInsensitiveField`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not", + "description": "Checks if `caseInsensitiveField` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_in", + "description": "Checks if `caseInsensitiveField` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_in", + "description": "Checks if `caseInsensitiveField` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_lt", + "description": "Checks if `caseInsensitiveField` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_lte", + "description": "Checks if `caseInsensitiveField` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_gt", + "description": "Checks if `caseInsensitiveField` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_gte", + "description": "Checks if `caseInsensitiveField` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_contains", + "description": "Checks if `caseInsensitiveField` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_contains", + "description": "Checks if `caseInsensitiveField` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_starts_with", + "description": "Checks if `caseInsensitiveField` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_starts_with", + "description": "Checks if `caseInsensitiveField` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_ends_with", + "description": "Checks if `caseInsensitiveField` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_ends_with", + "description": "Checks if `caseInsensitiveField` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_like", + "description": "Matches `caseInsensitiveField` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `caseInsensitiveField`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_like", + "description": "Checks if `caseInsensitiveField` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "StringFilter", + "description": "Filter type for String.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "equal", + "description": "Checks if the value equals a specified string, case-sensitively.\n\nIf an index exists on the value, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "not", + "description": "Checks if the value does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "in", + "description": "Checks if the value is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "not_in", + "description": "Checks if the value is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "lt", + "description": "Checks if the value is less than a specified value.", + "deprecationReason": null + }, + { + "name": "lte", + "description": "Checks if the value is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "gt", + "description": "Checks if the value is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "gte", + "description": "Checks if the value is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "contains", + "description": "Checks if the value contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "not_contains", + "description": "Checks if the value does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "starts_with", + "description": "Checks if the value starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "not_starts_with", + "description": "Checks if the value does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "ends_with", + "description": "Checks if the value ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "not_ends_with", + "description": "Checks if the value does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "like", + "description": "Matches the value against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on the value, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "not_like", + "description": "Checks if the value does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "AddressFilter", + "description": "Filter type for Address.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "street", + "description": "Checks if `street` equals a specified string, case-sensitively.\n\nIf an index exists on `street`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "street_not", + "description": "Checks if `street` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "street_in", + "description": "Checks if `street` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "street_not_in", + "description": "Checks if `street` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "street_lt", + "description": "Checks if `street` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "street_lte", + "description": "Checks if `street` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "street_gt", + "description": "Checks if `street` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "street_gte", + "description": "Checks if `street` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "street_contains", + "description": "Checks if `street` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "street_not_contains", + "description": "Checks if `street` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "street_starts_with", + "description": "Checks if `street` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "street_not_starts_with", + "description": "Checks if `street` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "street_ends_with", + "description": "Checks if `street` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "street_not_ends_with", + "description": "Checks if `street` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "street_like", + "description": "Matches `street` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `street`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "street_not_like", + "description": "Checks if `street` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "city", + "description": "Checks if `city` equals a specified string, case-sensitively.\n\nIf an index exists on `city`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "city_not", + "description": "Checks if `city` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "city_in", + "description": "Checks if `city` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "city_not_in", + "description": "Checks if `city` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "city_lt", + "description": "Checks if `city` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "city_lte", + "description": "Checks if `city` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "city_gt", + "description": "Checks if `city` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "city_gte", + "description": "Checks if `city` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "city_contains", + "description": "Checks if `city` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "city_not_contains", + "description": "Checks if `city` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "city_starts_with", + "description": "Checks if `city` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "city_not_starts_with", + "description": "Checks if `city` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "city_ends_with", + "description": "Checks if `city` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "city_not_ends_with", + "description": "Checks if `city` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "city_like", + "description": "Matches `city` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `city`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "city_not_like", + "description": "Checks if `city` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "zipCode", + "description": "Checks if `zipCode` equals a specified string, case-sensitively.\n\nIf an index exists on `zipCode`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "zipCode_not", + "description": "Checks if `zipCode` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "zipCode_in", + "description": "Checks if `zipCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "zipCode_not_in", + "description": "Checks if `zipCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "zipCode_lt", + "description": "Checks if `zipCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "zipCode_lte", + "description": "Checks if `zipCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "zipCode_gt", + "description": "Checks if `zipCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "zipCode_gte", + "description": "Checks if `zipCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "zipCode_contains", + "description": "Checks if `zipCode` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "zipCode_not_contains", + "description": "Checks if `zipCode` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "zipCode_starts_with", + "description": "Checks if `zipCode` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "zipCode_not_starts_with", + "description": "Checks if `zipCode` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "zipCode_ends_with", + "description": "Checks if `zipCode` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "zipCode_not_ends_with", + "description": "Checks if `zipCode` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "zipCode_like", + "description": "Matches `zipCode` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `zipCode`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "zipCode_not_like", + "description": "Checks if `zipCode` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "country", + "description": "Filters the through `isoCode` referenced Countries that fulfills the given requirements.\n\n Checks if `country` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "DangerousGoodsInfoFilter", + "description": "Filter type for DangerousGoodsInfo.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "unNumber", + "description": "Checks if `unNumber` equals a specified string, case-sensitively.\n\nIf an index exists on `unNumber`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "unNumber_not", + "description": "Checks if `unNumber` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_in", + "description": "Checks if `unNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "unNumber_not_in", + "description": "Checks if `unNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "unNumber_lt", + "description": "Checks if `unNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_lte", + "description": "Checks if `unNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_gt", + "description": "Checks if `unNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_gte", + "description": "Checks if `unNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_contains", + "description": "Checks if `unNumber` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_not_contains", + "description": "Checks if `unNumber` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_starts_with", + "description": "Checks if `unNumber` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "unNumber_not_starts_with", + "description": "Checks if `unNumber` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "unNumber_ends_with", + "description": "Checks if `unNumber` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_not_ends_with", + "description": "Checks if `unNumber` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_like", + "description": "Matches `unNumber` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `unNumber`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "unNumber_not_like", + "description": "Checks if `unNumber` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "flashpoint", + "description": "Checks if `flashpoint` equals a specified string, case-sensitively.\n\nIf an index exists on `flashpoint`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "flashpoint_not", + "description": "Checks if `flashpoint` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "flashpoint_in", + "description": "Checks if `flashpoint` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "flashpoint_not_in", + "description": "Checks if `flashpoint` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "flashpoint_lt", + "description": "Checks if `flashpoint` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "flashpoint_lte", + "description": "Checks if `flashpoint` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "flashpoint_gt", + "description": "Checks if `flashpoint` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "flashpoint_gte", + "description": "Checks if `flashpoint` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "flashpoint_contains", + "description": "Checks if `flashpoint` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "flashpoint_not_contains", + "description": "Checks if `flashpoint` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "flashpoint_starts_with", + "description": "Checks if `flashpoint` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "flashpoint_not_starts_with", + "description": "Checks if `flashpoint` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "flashpoint_ends_with", + "description": "Checks if `flashpoint` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "flashpoint_not_ends_with", + "description": "Checks if `flashpoint` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "flashpoint_like", + "description": "Matches `flashpoint` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `flashpoint`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "flashpoint_not_like", + "description": "Checks if `flashpoint` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "notices_some", + "description": "Makes sure at least one of the items in \"notices\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `notices` has at least one item.", + "deprecationReason": null + }, + { + "name": "notices_every", + "description": "Makes sure all items in `notices` match a certain filter.", + "deprecationReason": null + }, + { + "name": "notices_none", + "description": "Makes sure none of the items in `notices` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `notices` has no items.", + "deprecationReason": null + }, + { + "name": "notices_empty", + "description": "Checks if `notices` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "details", + "description": "Allows to filter on the fields of `details`.\n\nNote that `details` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "DangerousGoodsDetailsFilter", + "description": "Filter type for DangerousGoodsDetails.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "expiryDate", + "description": "Checks if `expiryDate` equals a specified value.\n\nIf an index exists on `expiryDate`, it can be used.", + "deprecationReason": null + }, + { + "name": "expiryDate_not", + "description": "Checks if `expiryDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "expiryDate_in", + "description": "Checks if `expiryDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "expiryDate_not_in", + "description": "Checks if `expiryDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "expiryDate_lt", + "description": "Checks if `expiryDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "expiryDate_lte", + "description": "Checks if `expiryDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "expiryDate_gt", + "description": "Checks if `expiryDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "expiryDate_gte", + "description": "Checks if `expiryDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "comment", + "description": "Checks if `comment` equals a specified string, case-sensitively.\n\nIf an index exists on `comment`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "comment_not", + "description": "Checks if `comment` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "comment_in", + "description": "Checks if `comment` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "comment_not_in", + "description": "Checks if `comment` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "comment_lt", + "description": "Checks if `comment` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "comment_lte", + "description": "Checks if `comment` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "comment_gt", + "description": "Checks if `comment` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "comment_gte", + "description": "Checks if `comment` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "comment_contains", + "description": "Checks if `comment` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "comment_not_contains", + "description": "Checks if `comment` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "comment_starts_with", + "description": "Checks if `comment` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "comment_not_starts_with", + "description": "Checks if `comment` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "comment_ends_with", + "description": "Checks if `comment` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "comment_not_ends_with", + "description": "Checks if `comment` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "comment_like", + "description": "Matches `comment` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `comment`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "comment_not_like", + "description": "Checks if `comment` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "ForwarderFilter", + "description": "Filter type for Forwarder.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "name", + "description": "Checks if `name` equals a specified string, case-sensitively.\n\nIf an index exists on `name`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "name_not", + "description": "Checks if `name` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_in", + "description": "Checks if `name` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_not_in", + "description": "Checks if `name` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_lt", + "description": "Checks if `name` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "name_lte", + "description": "Checks if `name` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_gt", + "description": "Checks if `name` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "name_gte", + "description": "Checks if `name` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_contains", + "description": "Checks if `name` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_not_contains", + "description": "Checks if `name` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_starts_with", + "description": "Checks if `name` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "name_not_starts_with", + "description": "Checks if `name` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "name_ends_with", + "description": "Checks if `name` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_not_ends_with", + "description": "Checks if `name` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_like", + "description": "Matches `name` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `name`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "name_not_like", + "description": "Checks if `name` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "deliveries_some", + "description": "Makes sure at least one of the items in \"deliveries\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has at least one item.", + "deprecationReason": null + }, + { + "name": "deliveries_every", + "description": "Makes sure all items in `deliveries` match a certain filter.", + "deprecationReason": null + }, + { + "name": "deliveries_none", + "description": "Makes sure none of the items in `deliveries` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has no items.", + "deprecationReason": null + }, + { + "name": "deliveries_empty", + "description": "Checks if `deliveries` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "Foobarit", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "OffsetDateTime", + "description": "The `OffsetDateTime` scalar type represents a point in time with a timezone offset, in a format specified by ISO 8601, such as `2007-12-03T10:15:30+01:00` or `2007-12-03T10:15:30.123Z`.\n\nOnly use this type for timestamps that are inherently tied to a location and the timezone offset should be calculated eagerly. To only store a point in time, use `DateTime`.\n\nThe *second* part is added if not specified, e.g. `2007-12-03T12:34Z` is converted to `2007-12-03T12:34:00Z`. Offset specifier `Z` is accepted but will be converted to `+00:00`. Leap seconds are not supported.", + "fields": null, + "inputFields": null + }, + { + "name": "LocalTime", + "description": "The `LocalTime` scalar type represents a time without time zone in a format specified by ISO 8601, such as 10:15:30 or 17:05:03.521.\n\nThe valid range is between 00:00:00 and 23:59:59.999999999. 24:00 is not allowed to avoid bugs in clients that treat 24:00 as 0:00.\n\nThe seconds part is cut off if it is zero, e.g. 12:34:00 is converted to 12:34. Second fraction digits are cut off at the nearest three-digit group, e.g. 00:00:00.1234 is converted to 00:00:00.123400.\n\nLeap seconds can not be specified.", + "fields": null, + "inputFields": null + }, + { + "name": "ColorDataFilter", + "description": "Filter type for ColorData.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "packageColor", + "description": "Checks if `packageColor` equals a specified string, case-sensitively.\n\nIf an index exists on `packageColor`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "packageColor_not", + "description": "Checks if `packageColor` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_in", + "description": "Checks if `packageColor` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "packageColor_not_in", + "description": "Checks if `packageColor` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "packageColor_lt", + "description": "Checks if `packageColor` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_lte", + "description": "Checks if `packageColor` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_gt", + "description": "Checks if `packageColor` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_gte", + "description": "Checks if `packageColor` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_contains", + "description": "Checks if `packageColor` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_not_contains", + "description": "Checks if `packageColor` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_starts_with", + "description": "Checks if `packageColor` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "packageColor_not_starts_with", + "description": "Checks if `packageColor` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "packageColor_ends_with", + "description": "Checks if `packageColor` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_not_ends_with", + "description": "Checks if `packageColor` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_like", + "description": "Matches `packageColor` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `packageColor`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "packageColor_not_like", + "description": "Checks if `packageColor` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "RecursionFilter", + "description": "Filter type for Recursion.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "recursion", + "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "name", + "description": "Checks if `name` equals a specified string, case-sensitively.\n\nIf an index exists on `name`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "name_not", + "description": "Checks if `name` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_in", + "description": "Checks if `name` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_not_in", + "description": "Checks if `name` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_lt", + "description": "Checks if `name` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "name_lte", + "description": "Checks if `name` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_gt", + "description": "Checks if `name` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "name_gte", + "description": "Checks if `name` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_contains", + "description": "Checks if `name` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_not_contains", + "description": "Checks if `name` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_starts_with", + "description": "Checks if `name` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "name_not_starts_with", + "description": "Checks if `name` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "name_ends_with", + "description": "Checks if `name` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_not_ends_with", + "description": "Checks if `name` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "name_like", + "description": "Matches `name` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `name`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "name_not_like", + "description": "Checks if `name` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "EnumWithDeprecation", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "DeliveryItemOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "HandlingUnitOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "Forwarder", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "deliveries", + "description": null, + "deprecationReason": null + }, + { + "name": "_deliveriesMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "DeliveryOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "JSON", + "description": "The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).", + "fields": null, + "inputFields": null + }, + { + "name": "ColorData", + "description": null, + "fields": [ + { + "name": "packageColor", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Recursion", + "description": null, + "fields": [ + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "DeliveryFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "deliveryNumber", + "description": "Checks if `deliveryNumber` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not", + "description": "Checks if `deliveryNumber` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_lt", + "description": "Checks if `deliveryNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_lte", + "description": "Checks if `deliveryNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_gt", + "description": "Checks if `deliveryNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_gte", + "description": "Checks if `deliveryNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_in", + "description": "Checks if `deliveryNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_in", + "description": "Checks if `deliveryNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_starts_with", + "description": "Checks if `deliveryNumber` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "deliveryNumber_not_starts_with", + "description": "Checks if `deliveryNumber` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_equal", + "description": "Checks if `serialNumbers` equals a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_not", + "description": "Checks if `serialNumbers` does not equal a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_lt", + "description": "Checks if `serialNumbers` is less than a specified value.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_lte", + "description": "Checks if `serialNumbers` is less or equal a specified value.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_gt", + "description": "Checks if `serialNumbers` is greater than a specified value.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_gte", + "description": "Checks if `serialNumbers` is greater or equal a specified value.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_in", + "description": "Checks if `serialNumbers` is equal to one of the specified values.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_not_in", + "description": "Checks if `serialNumbers` is not equal to one of the specified values.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_starts_with", + "description": "Checks if `serialNumbers` starts with a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_aggregation_not_starts_with", + "description": "Checks if `serialNumbers` does not start with a specified string, case-insensitively.\n\nThe list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "serialNumbers_empty", + "description": "Checks if `serialNumbers` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "Checks if `consignee` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "itemsAggregation", + "description": "Checks if `items` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "items_empty", + "description": "Checks if `items` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode", + "description": "Checks if `destinationCountryISOCode` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not", + "description": "Checks if `destinationCountryISOCode` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_lt", + "description": "Checks if `destinationCountryISOCode` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_lte", + "description": "Checks if `destinationCountryISOCode` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_gt", + "description": "Checks if `destinationCountryISOCode` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_gte", + "description": "Checks if `destinationCountryISOCode` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_in", + "description": "Checks if `destinationCountryISOCode` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_in", + "description": "Checks if `destinationCountryISOCode` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_starts_with", + "description": "Checks if `destinationCountryISOCode` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "destinationCountryISOCode_not_starts_with", + "description": "Checks if `destinationCountryISOCode` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "completionDate", + "description": "Checks if `completionDate` equals a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_not", + "description": "Checks if `completionDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "completionDate_in", + "description": "Checks if `completionDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "completionDate_not_in", + "description": "Checks if `completionDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "completionDate_lt", + "description": "Checks if `completionDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_lte", + "description": "Checks if `completionDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_gt", + "description": "Checks if `completionDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "completionDate_gte", + "description": "Checks if `completionDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": "Checks if `dispatchDate` equals a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_not", + "description": "Checks if `dispatchDate` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "dispatchDate_in", + "description": "Checks if `dispatchDate` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "dispatchDate_not_in", + "description": "Checks if `dispatchDate` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "dispatchDate_lt", + "description": "Checks if `dispatchDate` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_lte", + "description": "Checks if `dispatchDate` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_gt", + "description": "Checks if `dispatchDate` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "dispatchDate_gte", + "description": "Checks if `dispatchDate` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "description_contains_any_word", + "description": "Tokenizes the provided string into words, and checks if `description` contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_not_contains_any_word", + "description": "Tokenizes the provided string into words, and checks if `description` contains none of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_contains_all_words", + "description": "Tokenizes the provided string into words, and checks if `description` contains all of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_not_contains_all_words", + "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in `description`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if `description` contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_not_contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if `description` does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_contains_all_prefixes", + "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in `description`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_not_contains_all_prefixes", + "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in `description`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in `description`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "description_not_contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in `description`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "colorData", + "description": "Allows to filter on the fields of `colorData`.\n\nNote that `colorData` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": "Checks if `enumFlexSearch` equals a specified value.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_not", + "description": "Checks if `enumFlexSearch` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_in", + "description": "Checks if `enumFlexSearch` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch_not_in", + "description": "Checks if `enumFlexSearch` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText", + "description": "Checks if `aText` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "aText_not", + "description": "Checks if `aText` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "aText_lt", + "description": "Checks if `aText` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "aText_lte", + "description": "Checks if `aText` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aText_gt", + "description": "Checks if `aText` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "aText_gte", + "description": "Checks if `aText` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aText_in", + "description": "Checks if `aText` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText_not_in", + "description": "Checks if `aText` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aText_starts_with", + "description": "Checks if `aText` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "aText_not_starts_with", + "description": "Checks if `aText` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "aNumber", + "description": "Checks if `aNumber` equals a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_not", + "description": "Checks if `aNumber` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "aNumber_in", + "description": "Checks if `aNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aNumber_not_in", + "description": "Checks if `aNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "aNumber_lt", + "description": "Checks if `aNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_lte", + "description": "Checks if `aNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_gt", + "description": "Checks if `aNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "aNumber_gte", + "description": "Checks if `aNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "recursion", + "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": "Checks if `processingFinished` equals a specified value.", + "deprecationReason": null + }, + { + "name": "processingFinished_not", + "description": "Checks if `processingFinished` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": "Checks if `sometimesNull` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not", + "description": "Checks if `sometimesNull` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_lt", + "description": "Checks if `sometimesNull` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_lte", + "description": "Checks if `sometimesNull` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_gt", + "description": "Checks if `sometimesNull` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_gte", + "description": "Checks if `sometimesNull` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "sometimesNull_in", + "description": "Checks if `sometimesNull` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_in", + "description": "Checks if `sometimesNull` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "sometimesNull_starts_with", + "description": "Checks if `sometimesNull` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "sometimesNull_not_starts_with", + "description": "Checks if `sometimesNull` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": "Checks if `caseInsensitiveField` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not", + "description": "Checks if `caseInsensitiveField` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_lt", + "description": "Checks if `caseInsensitiveField` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_lte", + "description": "Checks if `caseInsensitiveField` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_gt", + "description": "Checks if `caseInsensitiveField` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_gte", + "description": "Checks if `caseInsensitiveField` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_in", + "description": "Checks if `caseInsensitiveField` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_in", + "description": "Checks if `caseInsensitiveField` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_starts_with", + "description": "Checks if `caseInsensitiveField` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "caseInsensitiveField_not_starts_with", + "description": "Checks if `caseInsensitiveField` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "AddressFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "city", + "description": "Checks if `city` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "city_not", + "description": "Checks if `city` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "city_lt", + "description": "Checks if `city` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "city_lte", + "description": "Checks if `city` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "city_gt", + "description": "Checks if `city` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "city_gte", + "description": "Checks if `city` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "city_in", + "description": "Checks if `city` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "city_not_in", + "description": "Checks if `city` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "city_starts_with", + "description": "Checks if `city` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "city_not_starts_with", + "description": "Checks if `city` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "DeliveryItemAggregationFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this child entity uniquely within this collection of child entities", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time", + "deprecationReason": null + }, + { + "name": "itemNumber_contains_any_word", + "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains_any_word", + "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains none of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_contains_all_words", + "description": "Tokenizes the provided string into words, and checks if `itemNumber` contains all of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains_all_words", + "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if `itemNumber` contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if `itemNumber` does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_contains_all_prefixes", + "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains_all_prefixes", + "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "itemNumber_not_contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in `itemNumber`.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "quantity", + "description": "Checks if `quantity` equals a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_not", + "description": "Checks if `quantity` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "quantity_in", + "description": "Checks if `quantity` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "quantity_not_in", + "description": "Checks if `quantity` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "quantity_lt", + "description": "Checks if `quantity` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_lte", + "description": "Checks if `quantity` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_gt", + "description": "Checks if `quantity` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "quantity_gte", + "description": "Checks if `quantity` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "Allows to filter on the fields of `dgInfo`.\n\nNote that `dgInfo` is an entity extension and thus can never be `null`, so specifying `null` to this filter field has no effect.", + "deprecationReason": null + }, + { + "name": "description_localized", + "description": "Makes sure at least one of the entries in \"description\" has a value that matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `description` has at least one item.", + "deprecationReason": null + } + ] + }, + { + "name": "DangerousGoodsInfoAggregationFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "unNumber", + "description": "Checks if `unNumber` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_not", + "description": "Checks if `unNumber` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_lt", + "description": "Checks if `unNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_lte", + "description": "Checks if `unNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_gt", + "description": "Checks if `unNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_gte", + "description": "Checks if `unNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "unNumber_in", + "description": "Checks if `unNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "unNumber_not_in", + "description": "Checks if `unNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "unNumber_starts_with", + "description": "Checks if `unNumber` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "unNumber_not_starts_with", + "description": "Checks if `unNumber` does not start with a specified string, case-insensitively.", + "deprecationReason": null + } + ] + }, + { + "name": "I18nStringLocalizedRegularAndFulltextFilter", + "description": "Allows to on a specific localization of an `I18nString`\n\nThe language should be provided in the special `language` field. All other fields are *and*-combined. There are no fallback rules for string localization; if there is no localization for the given language, the filter acts as if the field was `null`.", + "fields": null, + "inputFields": [ + { + "name": "language", + "description": "Sets the language to be used for the filters in this object", + "deprecationReason": null + }, + { + "name": "equal", + "description": "Checks if the value equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "not", + "description": "Checks if the value does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "lt", + "description": "Checks if the value is less than a specified value.", + "deprecationReason": null + }, + { + "name": "lte", + "description": "Checks if the value is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "gt", + "description": "Checks if the value is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "gte", + "description": "Checks if the value is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "in", + "description": "Checks if the value is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "not_in", + "description": "Checks if the value is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "starts_with", + "description": "Checks if the value starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "not_starts_with", + "description": "Checks if the value does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "contains_any_word", + "description": "Tokenizes the provided string into words, and checks if the value contains at least one of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "not_contains_any_word", + "description": "Tokenizes the provided string into words, and checks if the value contains none of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "contains_all_words", + "description": "Tokenizes the provided string into words, and checks if the value contains all of them.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "not_contains_all_words", + "description": "Tokenizes the provided string into words, and checks if at least one word is not contained in the value.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if the value contains any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "not_contains_any_prefix", + "description": "Tokenizes the provided string into prefixes, and checks if the value does not contain any word that starts with one of these prefixes.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "contains_all_prefixes", + "description": "Tokenizes the provided string into prefixes, and checks if all prefixes appears in the value.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "not_contains_all_prefixes", + "description": "Tokenizes the provided prefixes into words, and checks if there is at least one prefix that does not appear in the value.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is included in the value.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + }, + { + "name": "not_contains_phrase", + "description": "Tokenizes the provided string into words, and checks if that exact phrase (those words in excactly this order) is not included in the value.\n Stemming (reduction of words on their base form) is applied.", + "deprecationReason": null + } + ] + }, + { + "name": "ColorDataFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "packageColor", + "description": "Checks if `packageColor` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_not", + "description": "Checks if `packageColor` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_lt", + "description": "Checks if `packageColor` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_lte", + "description": "Checks if `packageColor` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_gt", + "description": "Checks if `packageColor` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_gte", + "description": "Checks if `packageColor` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "packageColor_in", + "description": "Checks if `packageColor` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "packageColor_not_in", + "description": "Checks if `packageColor` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "packageColor_starts_with", + "description": "Checks if `packageColor` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "packageColor_not_starts_with", + "description": "Checks if `packageColor` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "RecursionFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "recursion", + "description": "Checks if `recursion` is not null, and allows to filter based on its fields.", + "deprecationReason": null + }, + { + "name": "name", + "description": "Checks if `name` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "name_not", + "description": "Checks if `name` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "name_lt", + "description": "Checks if `name` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "name_lte", + "description": "Checks if `name` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_gt", + "description": "Checks if `name` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "name_gte", + "description": "Checks if `name` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "name_in", + "description": "Checks if `name` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_not_in", + "description": "Checks if `name` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_starts_with", + "description": "Checks if `name` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "name_not_starts_with", + "description": "Checks if `name` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "ForwarderOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "OnlyRelations", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "deliveries", + "description": null, + "deprecationReason": null + }, + { + "name": "_deliveriesMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "OnlyRelationsFilter", + "description": "Filter type for OnlyRelations.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "deliveries_some", + "description": "Makes sure at least one of the items in \"deliveries\" matches a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has at least one item.", + "deprecationReason": null + }, + { + "name": "deliveries_every", + "description": "Makes sure all items in `deliveries` match a certain filter.", + "deprecationReason": null + }, + { + "name": "deliveries_none", + "description": "Makes sure none of the items in `deliveries` match a certain filter.\n\nNote that you can specify the empty object for this filter to make sure `deliveries` has no items.", + "deprecationReason": null + }, + { + "name": "deliveries_empty", + "description": "Checks if `deliveries` is an empty list (true) or a non-empty list (false).", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "OnlyRelationsOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "HandlingUnitFlexSearchFilter", + "description": "An aggregation contains all values of a list. Each check in this type is true if it matches any of the values in the list.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "huNumber", + "description": "Checks if `huNumber` equals a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_not", + "description": "Checks if `huNumber` does not equal a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_lt", + "description": "Checks if `huNumber` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_lte", + "description": "Checks if `huNumber` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_gt", + "description": "Checks if `huNumber` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_gte", + "description": "Checks if `huNumber` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "huNumber_in", + "description": "Checks if `huNumber` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "huNumber_not_in", + "description": "Checks if `huNumber` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "huNumber_starts_with", + "description": "Checks if `huNumber` starts with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "huNumber_not_starts_with", + "description": "Checks if `huNumber` does not start with a specified string, case-insensitively.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "NumberRange", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "number", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "NumberRangeName", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "Int53", + "description": "The Int53 scalar type represents non-fractional signed whole numeric values. Int53 can represent values between -9007199254740991 and 9007199254740991.\n\nValues of this type are serialized as numbers in GraphQL and JSON representations. The numeric range of this type corresponds to the safe integer range of an IEEE 754 double precision binary floating-point value.", + "fields": null, + "inputFields": null + }, + { + "name": "NumberRangeFilter", + "description": "Filter type for NumberRange.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "name", + "description": "Checks if `name` equals a specified value.\n\nIf an index exists on `name`, it can be used.", + "deprecationReason": null + }, + { + "name": "name_not", + "description": "Checks if `name` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "name_in", + "description": "Checks if `name` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "name_not_in", + "description": "Checks if `name` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "number", + "description": "Checks if `number` equals a specified value.\n\nIf an index exists on `number`, it can be used.", + "deprecationReason": null + }, + { + "name": "number_not", + "description": "Checks if `number` does not equal a specified value", + "deprecationReason": null + }, + { + "name": "number_in", + "description": "Checks if `number` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "number_not_in", + "description": "Checks if `number` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "number_lt", + "description": "Checks if `number` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "number_lte", + "description": "Checks if `number` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "number_gt", + "description": "Checks if `number` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "number_gte", + "description": "Checks if `number` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "NumberRangeOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "SecretKey", + "description": null, + "fields": [ + { + "name": "id", + "description": "An auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "deprecationReason": null + }, + { + "name": "_cursor", + "description": "Provides a value that can be supplied to the `after` argument for pagination. Depends on the value of the `orderBy` argument.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "An identifier that is updated automatically on each update of this root entity (but not on relation changes)", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "SecretKeyFilter", + "description": "Filter type for SecretKey.\n\nAll fields in this type are *and*-combined; see the `or` field for *or*-combination.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "Checks if `id` equals a specified value.\n\nIf an index exists on `id`, it can be used.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not", + "description": "Checks if `id` does not equal a specified value\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_in", + "description": "Checks if `id` is equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_not_in", + "description": "Checks if `id` is not equal to one of the specified values.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lt", + "description": "Checks if `id` is less than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_lte", + "description": "Checks if `id` is less or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gt", + "description": "Checks if `id` is greater than a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "id_gte", + "description": "Checks if `id` is greater or equal a specified value.\n\nAn auto-generated string that identifies this root entity uniquely among others of the same type", + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "Checks if `createdAt` equals a specified value.\n\nIf an index exists on `createdAt`, it can be used.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not", + "description": "Checks if `createdAt` does not equal a specified value\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_in", + "description": "Checks if `createdAt` is equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_not_in", + "description": "Checks if `createdAt` is not equal to one of the specified values.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lt", + "description": "Checks if `createdAt` is less than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_lte", + "description": "Checks if `createdAt` is less or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gt", + "description": "Checks if `createdAt` is greater than a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "createdAt_gte", + "description": "Checks if `createdAt` is greater or equal a specified value.\n\nThe instant this object has been created", + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "Checks if `updatedAt` equals a specified value.\n\nIf an index exists on `updatedAt`, it can be used.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not", + "description": "Checks if `updatedAt` does not equal a specified value\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_in", + "description": "Checks if `updatedAt` is equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_not_in", + "description": "Checks if `updatedAt` is not equal to one of the specified values.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lt", + "description": "Checks if `updatedAt` is less than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_lte", + "description": "Checks if `updatedAt` is less or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gt", + "description": "Checks if `updatedAt` is greater than a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "updatedAt_gte", + "description": "Checks if `updatedAt` is greater or equal a specified value.\n\nThe instant this object has been updated the last time (not including relation updates)", + "deprecationReason": null + }, + { + "name": "key", + "description": "Checks if `key` equals a specified string, case-sensitively.\n\nIf an index exists on `key`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "key_not", + "description": "Checks if `key` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_in", + "description": "Checks if `key` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "key_not_in", + "description": "Checks if `key` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "key_lt", + "description": "Checks if `key` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "key_lte", + "description": "Checks if `key` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "key_gt", + "description": "Checks if `key` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "key_gte", + "description": "Checks if `key` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "key_contains", + "description": "Checks if `key` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_not_contains", + "description": "Checks if `key` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_starts_with", + "description": "Checks if `key` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "key_not_starts_with", + "description": "Checks if `key` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "key_ends_with", + "description": "Checks if `key` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_not_ends_with", + "description": "Checks if `key` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "key_like", + "description": "Matches `key` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `key`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "key_not_like", + "description": "Checks if `key` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "value", + "description": "Checks if `value` equals a specified string, case-sensitively.\n\nIf an index exists on `value`, it can be used.\n\nSee also `like` for a case-insensitive filter.", + "deprecationReason": null + }, + { + "name": "value_not", + "description": "Checks if `value` does not equal a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_in", + "description": "Checks if `value` is equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "value_not_in", + "description": "Checks if `value` is not equal to one of the specified values.", + "deprecationReason": null + }, + { + "name": "value_lt", + "description": "Checks if `value` is less than a specified value.", + "deprecationReason": null + }, + { + "name": "value_lte", + "description": "Checks if `value` is less or equal a specified value.", + "deprecationReason": null + }, + { + "name": "value_gt", + "description": "Checks if `value` is greater than a specified value.", + "deprecationReason": null + }, + { + "name": "value_gte", + "description": "Checks if `value` is greater or equal a specified value.", + "deprecationReason": null + }, + { + "name": "value_contains", + "description": "Checks if `value` contains a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_not_contains", + "description": "Checks if `value` does not contain a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_starts_with", + "description": "Checks if `value` starts with a specified string, case-sensitively.\n\nNever uses an index. Consider using `like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "value_not_starts_with", + "description": "Checks if `value` does not start with a specified string, case-sensitively.\n\nNever uses an index. Consider using `not_like` (with the `%` placeholder) for a case-insensitive filter that can use an index.", + "deprecationReason": null + }, + { + "name": "value_ends_with", + "description": "Checks if `value` ends with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_not_ends_with", + "description": "Checks if `value` does not end with a specified string, case-sensitively.", + "deprecationReason": null + }, + { + "name": "value_like", + "description": "Matches `value` against a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)\n\nIf an index exists on `value`, it can be used for the literal prefix (the part until the first placeholder).", + "deprecationReason": null + }, + { + "name": "value_not_like", + "description": "Checks if `value` does *not* match a pattern case-insensitively with the following placeholders:\n\n- `%` matches any sequence of characters, including the empty string\n- `_` matches exactly one character\n- `\\` can be used to escape the placeholders (use `\\\\` for a literal backslash)", + "deprecationReason": null + }, + { + "name": "AND", + "description": "A field that checks if all filters in the list apply\n\nIf the list is empty, this filter applies to all objects.", + "deprecationReason": null + }, + { + "name": "OR", + "description": "A field that checks if any of the filters in the list apply.\n\nIf the list is empty, this filter applies to no objects.\n\nNote that only the items in the list *or*-combined; this complete `OR` field is *and*-combined with outer fields in the parent filter type.", + "deprecationReason": null + } + ] + }, + { + "name": "SecretKeyOrderBy", + "description": null, + "fields": null, + "inputFields": null + }, + { + "name": "CreateBillingEntityInput", + "description": "The create type for the root entity type `BillingEntity`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "isConfirmedForExport", + "description": null, + "deprecationReason": null + }, + { + "name": "isExported", + "description": null, + "deprecationReason": null + }, + { + "name": "confirmedForExportAt", + "description": null, + "deprecationReason": null + }, + { + "name": "exportedAt", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateBillingEntityInput", + "description": "The update type for the root entity type `BillingEntity`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `BillingEntity` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "isConfirmedForExport", + "description": null, + "deprecationReason": null + }, + { + "name": "isExported", + "description": null, + "deprecationReason": null + }, + { + "name": "confirmedForExportAt", + "description": null, + "deprecationReason": null + }, + { + "name": "exportedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"BillingEntity._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllBillingEntitiesInput", + "description": "The update type for the root entity type `BillingEntity`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "isConfirmedForExport", + "description": null, + "deprecationReason": null + }, + { + "name": "isExported", + "description": null, + "deprecationReason": null + }, + { + "name": "confirmedForExportAt", + "description": null, + "deprecationReason": null + }, + { + "name": "exportedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"BillingEntity._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "CreateCountryInput", + "description": "The create type for the root entity type `Country`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "isoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "descriptionI18nString", + "description": null, + "deprecationReason": null + }, + { + "name": "totalInvestment", + "description": null, + "deprecationReason": null + }, + { + "name": "someKey", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "TranslationInput", + "description": "The create/update type for the value object type `Translation`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", + "fields": null, + "inputFields": [ + { + "name": "languageIsoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "translation", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateCountryInput", + "description": "The update type for the root entity type `Country`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `Country` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "isoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "descriptionI18nString", + "description": null, + "deprecationReason": null + }, + { + "name": "totalInvestment", + "description": null, + "deprecationReason": null + }, + { + "name": "someKey", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Country._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllCountriesInput", + "description": "The update type for the root entity type `Country`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "isoCode", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "descriptionI18nString", + "description": null, + "deprecationReason": null + }, + { + "name": "totalInvestment", + "description": null, + "deprecationReason": null + }, + { + "name": "someKey", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Country._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "CreateDeliveryInput", + "description": "The create type for the root entity type `Delivery`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "deliveryNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "serialNumbers", + "description": "The list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "The address of the delivery's consignee", + "deprecationReason": null + }, + { + "name": "contentInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "items", + "description": null, + "deprecationReason": null + }, + { + "name": "handlingUnits", + "description": "Adds `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nIf one of the `HandlingUnits` is already related to a different `Delivery`, these relations are removed first.\n\nThe handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "createHandlingUnits", + "description": "Creates new `HandlingUnits` and adds `handlingUnits` relations between them and the new `Delivery`.\n\nThe handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "destinationCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": "Use \"destinationCountryISOCode\" instead." + }, + { + "name": "destinationCountryISOCode", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "completionDate", + "description": null, + "deprecationReason": null + }, + { + "name": "originCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "shippedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "totalValue", + "description": null, + "deprecationReason": null + }, + { + "name": "forwarder", + "description": "Sets the `forwarder` relation to an existing `Forwarder` by its id.", + "deprecationReason": null + }, + { + "name": "createForwarder", + "description": "Creates a new `Forwarder` and adds a `forwarder` relation between it and the new `Delivery`.", + "deprecationReason": null + }, + { + "name": "destination", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString2", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueInt", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueTrue", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFalse", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFloat", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueEnum", + "description": null, + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeStart", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd", + "description": null, + "deprecationReason": null + }, + { + "name": "dynamicData", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "colorData", + "description": null, + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": null, + "deprecationReason": null + }, + { + "name": "aText", + "description": null, + "deprecationReason": null + }, + { + "name": "aNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecatedField", + "description": null, + "deprecationReason": null + }, + { + "name": "enumWithDeprecation", + "description": null, + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": null, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "AddressInput", + "description": "The create/update type for the value object type `Address`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", + "fields": null, + "inputFields": [ + { + "name": "street", + "description": null, + "deprecationReason": null + }, + { + "name": "city", + "description": null, + "deprecationReason": null + }, + { + "name": "zipCode", + "description": null, + "deprecationReason": null + }, + { + "name": "country", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + } + ] + }, + { + "name": "CreateDangerousGoodsInfoInput", + "description": "The create type for the entity extension type `DangerousGoodsInfo`.", + "fields": null, + "inputFields": [ + { + "name": "unNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "flashpoint", + "description": null, + "deprecationReason": null + }, + { + "name": "notices", + "description": null, + "deprecationReason": null + }, + { + "name": "details", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "CreateDangerousGoodsDetailsInput", + "description": "The create type for the entity extension type `DangerousGoodsDetails`.", + "fields": null, + "inputFields": [ + { + "name": "expiryDate", + "description": null, + "deprecationReason": null + }, + { + "name": "comment", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "CreateDeliveryItemInput", + "description": "The create type for the child entity type `DeliveryItem`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "itemNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "quantity", + "description": null, + "deprecationReason": null + }, + { + "name": "weightInKg", + "description": null, + "deprecationReason": null + }, + { + "name": "handlingUnit", + "description": "Specify the `id` of the `HandlingUnit` to be referenced", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "CreateHandlingUnitInput", + "description": "The create type for the root entity type `HandlingUnit`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "huNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "delivery", + "description": "Sets the `delivery` relation to an existing `Delivery` by its id.", + "deprecationReason": null + }, + { + "name": "createDelivery", + "description": "Creates a new `Delivery` and adds a `delivery` relation between it and the new `HandlingUnit`.", + "deprecationReason": null + } + ] + }, + { + "name": "CreateForwarderInput", + "description": "The create type for the root entity type `Forwarder`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "deliveries", + "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.\n\nIf one of the `Deliveries` is already related to a different `Forwarder`, these relations are removed first.", + "deprecationReason": null + }, + { + "name": "createDeliveries", + "description": "Creates new `Deliveries` and adds `deliveries` relations between them and the new `Forwarder`.", + "deprecationReason": null + } + ] + }, + { + "name": "CreateColorDataInput", + "description": "The create type for the entity extension type `ColorData`.", + "fields": null, + "inputFields": [ + { + "name": "packageColor", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "RecursionInput", + "description": "The create/update type for the value object type `Recursion`.\n\nIf this is used in an update mutation, missing fields are set to `null`.", + "fields": null, + "inputFields": [ + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateDeliveryInput", + "description": "The update type for the root entity type `Delivery`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `Delivery` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "deliveryNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "serialNumbers", + "description": "The list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "The address of the delivery's consignee", + "deprecationReason": null + }, + { + "name": "contentInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + }, + { + "name": "items", + "description": "Deletes all `DeliveryItems` objects in list of `items` and replaces it with the specified objects.\n\nCannot be combined with the add/update/delete fields for the same child entity list.", + "deprecationReason": null + }, + { + "name": "addItems", + "description": "Adds new `DeliveryItems` to the list of `items`", + "deprecationReason": null + }, + { + "name": "updateItems", + "description": "Updates `DeliveryItems` in the list of `items`", + "deprecationReason": null + }, + { + "name": "removeItems", + "description": "Deletes `DeliveryItems` by ids in the list of `items`", + "deprecationReason": null + }, + { + "name": "addHandlingUnits", + "description": "Adds `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nIf one of the `HandlingUnits` is already related to a different `Delivery`, these relations are removed first.\n\nThe handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "removeHandlingUnits", + "description": "Removes `handlingUnits` relations to existing `HandlingUnits` by their ids.\n\nThe handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "createHandlingUnits", + "description": "Creates new `HandlingUnits` and adds `handlingUnits` relations between them and this `Delivery`.\n\nThe handling units the items of this delivery are packaged in", + "deprecationReason": null + }, + { + "name": "destinationCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": "Use \"destinationCountryISOCode\" instead." + }, + { + "name": "destinationCountryISOCode", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "completionDate", + "description": null, + "deprecationReason": null + }, + { + "name": "originCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "shippedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "totalValue", + "description": null, + "deprecationReason": null + }, + { + "name": "forwarder", + "description": "Sets the `forwarder` relation to an existing `Forwarder` by its id.\n\nIf this `Delivery` already has a `forwarder` relation, this relation is removed first.", + "deprecationReason": null + }, + { + "name": "createForwarder", + "description": "Creates a new `Forwarder` and sets the `forwarder` relation to the created object.\n\nIf this `Delivery` already has a `forwarder` relation, this relation is removed first.", + "deprecationReason": null + }, + { + "name": "destination", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString2", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueInt", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueTrue", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFalse", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFloat", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueEnum", + "description": null, + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeStart", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd", + "description": null, + "deprecationReason": null + }, + { + "name": "dynamicData", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "colorData", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": null, + "deprecationReason": null + }, + { + "name": "aText", + "description": null, + "deprecationReason": null + }, + { + "name": "aNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecatedField", + "description": null, + "deprecationReason": null + }, + { + "name": "enumWithDeprecation", + "description": null, + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": null, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Delivery._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateDangerousGoodsInfoInput", + "description": "The update type for the entity extension type `DangerousGoodsInfo`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "unNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "flashpoint", + "description": null, + "deprecationReason": null + }, + { + "name": "notices", + "description": null, + "deprecationReason": null + }, + { + "name": "details", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateDangerousGoodsDetailsInput", + "description": "The update type for the entity extension type `DangerousGoodsDetails`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "expiryDate", + "description": null, + "deprecationReason": null + }, + { + "name": "comment", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateDeliveryItemInput", + "description": "The update type for the child entity type `DeliveryItem`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `DeliveryItem` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "itemNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "quantity", + "description": null, + "deprecationReason": null + }, + { + "name": "weightInKg", + "description": null, + "deprecationReason": null + }, + { + "name": "handlingUnit", + "description": "Specify the `id` of the `HandlingUnit` to be referenced", + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateColorDataInput", + "description": "The update type for the entity extension type `ColorData`.\n\nIf fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "packageColor", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllDeliveriesInput", + "description": "The update type for the root entity type `Delivery`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "deliveryNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "serialNumbers", + "description": "The list of serial numbers associated with this delivery", + "deprecationReason": null + }, + { + "name": "consignee", + "description": "The address of the delivery's consignee", + "deprecationReason": null + }, + { + "name": "contentInfo", + "description": null, + "deprecationReason": null + }, + { + "name": "dgInfo", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + }, + { + "name": "items", + "description": "Deletes all `DeliveryItems` objects in list of `items` and replaces it with the specified objects.\n\nCannot be combined with the add/update/delete fields for the same child entity list.", + "deprecationReason": null + }, + { + "name": "addItems", + "description": "Adds new `DeliveryItems` to the list of `items`", + "deprecationReason": null + }, + { + "name": "updateItems", + "description": "Updates `DeliveryItems` in the list of `items`", + "deprecationReason": null + }, + { + "name": "removeItems", + "description": "Deletes `DeliveryItems` by ids in the list of `items`", + "deprecationReason": null + }, + { + "name": "destinationCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": "Use \"destinationCountryISOCode\" instead." + }, + { + "name": "destinationCountryISOCode", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "completionDate", + "description": null, + "deprecationReason": null + }, + { + "name": "originCountry", + "description": "Specify the `isoCode` of the `Country` to be referenced", + "deprecationReason": null + }, + { + "name": "shippedAt", + "description": null, + "deprecationReason": null + }, + { + "name": "totalValue", + "description": null, + "deprecationReason": null + }, + { + "name": "destination", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueString2", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueInt", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueTrue", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFalse", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueFloat", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValueEnum", + "description": null, + "deprecationReason": null + }, + { + "name": "dispatchDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupDate", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeStart", + "description": null, + "deprecationReason": null + }, + { + "name": "pickupTimeEnd", + "description": null, + "deprecationReason": null + }, + { + "name": "dynamicData", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "colorData", + "description": "This field is an entity extension and thus is never 'null' - passing 'null' here does not change the field value.", + "deprecationReason": null + }, + { + "name": "enumFlexSearch", + "description": null, + "deprecationReason": null + }, + { + "name": "aText", + "description": null, + "deprecationReason": null + }, + { + "name": "aNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "recursion", + "description": null, + "deprecationReason": null + }, + { + "name": "processingFinished", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecatedField", + "description": null, + "deprecationReason": null + }, + { + "name": "enumWithDeprecation", + "description": null, + "deprecationReason": null + }, + { + "name": "sometimesNull", + "description": null, + "deprecationReason": null + }, + { + "name": "caseInsensitiveField", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Delivery._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateForwarderInput", + "description": "The update type for the root entity type `Forwarder`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `Forwarder` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "addDeliveries", + "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.\n\nIf one of the `Deliveries` is already related to a different `Forwarder`, these relations are removed first.", + "deprecationReason": null + }, + { + "name": "removeDeliveries", + "description": "Removes `deliveries` relations to existing `Deliveries` by their ids.", + "deprecationReason": null + }, + { + "name": "createDeliveries", + "description": "Creates new `Deliveries` and adds `deliveries` relations between them and this `Forwarder`.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Forwarder._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllForwardersInput", + "description": "The update type for the root entity type `Forwarder`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"Forwarder._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "CreateOnlyRelationsInput", + "description": "The create type for the root entity type `OnlyRelations`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "deliveries", + "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.", + "deprecationReason": null + }, + { + "name": "createDeliveries", + "description": "Creates new `Deliveries` and adds `deliveries` relations between them and the new `OnlyRelations`.", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateOnlyRelationsInput", + "description": "The update type for the root entity type `OnlyRelations`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `OnlyRelations` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "addDeliveries", + "description": "Adds `deliveries` relations to existing `Deliveries` by their ids.", + "deprecationReason": null + }, + { + "name": "removeDeliveries", + "description": "Removes `deliveries` relations to existing `Deliveries` by their ids.", + "deprecationReason": null + }, + { + "name": "createDeliveries", + "description": "Creates new `Deliveries` and adds `deliveries` relations between them and this `OnlyRelations`.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"OnlyRelations._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateHandlingUnitInput", + "description": "The update type for the root entity type `HandlingUnit`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `HandlingUnit` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "huNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "delivery", + "description": "Sets the `delivery` relation to an existing `Delivery` by its id.\n\nIf this `HandlingUnit` already has a `delivery` relation, this relation is removed first.", + "deprecationReason": null + }, + { + "name": "createDelivery", + "description": "Creates a new `Delivery` and sets the `delivery` relation to the created object.\n\nIf this `HandlingUnit` already has a `delivery` relation, this relation is removed first.", + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"HandlingUnit._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllHandlingUnitsInput", + "description": "The update type for the root entity type `HandlingUnit`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "huNumber", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"HandlingUnit._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "CreateNumberRangeInput", + "description": "The create type for the root entity type `NumberRange`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "number", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateNumberRangeInput", + "description": "The update type for the root entity type `NumberRange`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `NumberRange` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "number", + "description": null, + "deprecationReason": null + }, + { + "name": "addTo_number", + "description": null, + "deprecationReason": null + }, + { + "name": "multiplyWith_number", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"NumberRange._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllNumberRangesInput", + "description": "The update type for the root entity type `NumberRange`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "number", + "description": null, + "deprecationReason": null + }, + { + "name": "addTo_number", + "description": null, + "deprecationReason": null + }, + { + "name": "multiplyWith_number", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"NumberRange._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "CreateSecretKeyInput", + "description": "The create type for the root entity type `SecretKey`.\n\nThe fields `id`, `createdAt`, and `updatedAt` are set automatically.", + "fields": null, + "inputFields": [ + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "deprecationReason": null + } + ] + }, + { + "name": "UpdateSecretKeyInput", + "description": "The update type for the root entity type `SecretKey`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The `id` of the `SecretKey` to be updated (does not change the `id`).", + "deprecationReason": null + }, + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"SecretKey._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "UpdateAllSecretKeysInput", + "description": "The update type for the root entity type `SecretKey`.\n\nThe `updatedAt` field is updated automatically unless only relations are updated. If fields are omitted, their value is left unchanged. Explicitly set fields to `null` to clear their value.", + "fields": null, + "inputFields": [ + { + "name": "key", + "description": null, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "deprecationReason": null + }, + { + "name": "_revision", + "description": "Set this field to the value of \"SecretKey._revision\" to abort the transaction if this object has been modified in the meantime", + "deprecationReason": null + } + ] + }, + { + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "fields": [ + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "types", + "description": "A list of all types supported by this server.", + "deprecationReason": null + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "deprecationReason": null + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "deprecationReason": null + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "deprecationReason": null + }, + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "fields": [ + { + "name": "kind", + "description": null, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "specifiedByURL", + "description": null, + "deprecationReason": null + }, + { + "name": "fields", + "description": null, + "deprecationReason": null + }, + { + "name": "interfaces", + "description": null, + "deprecationReason": null + }, + { + "name": "possibleTypes", + "description": null, + "deprecationReason": null + }, + { + "name": "enumValues", + "description": null, + "deprecationReason": null + }, + { + "name": "inputFields", + "description": null, + "deprecationReason": null + }, + { + "name": "ofType", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is.", + "fields": null, + "inputFields": null + }, + { + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "fields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "fields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "deprecationReason": null + }, + { + "name": "defaultValue", + "description": "A GraphQL-formatted string representing the default value for this input value.", + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "fields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "fields": [ + { + "name": "name", + "description": null, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "deprecationReason": null + }, + { + "name": "isRepeatable", + "description": null, + "deprecationReason": null + }, + { + "name": "locations", + "description": null, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "fields": null, + "inputFields": null + }, + { + "name": "Query", + "description": "The Query type for the root namespace", + "fields": [ + { + "name": "BillingEntity", + "description": "Finds a BillingEntity by id", + "deprecationReason": null + }, + { + "name": "allBillingEntities", + "description": null, + "deprecationReason": null + }, + { + "name": "_allBillingEntitiesMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "Country", + "description": "Finds a Country by id or isoCode.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "allCountries", + "description": null, + "deprecationReason": null + }, + { + "name": "_allCountriesMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "flexSearchCountries", + "description": "Queries for Countries using FlexSearch.", + "deprecationReason": null + }, + { + "name": "_flexSearchCountriesMeta", + "description": "Queries for Countries using FlexSearch.", + "deprecationReason": null + }, + { + "name": "Delivery", + "description": "Finds a Delivery by id or deliveryNumber.\n\nYou should pass a non-null value to exactly one of the arguments.\n\nA delivery", + "deprecationReason": null + }, + { + "name": "allDeliveries", + "description": "A delivery", + "deprecationReason": null + }, + { + "name": "_allDeliveriesMeta", + "description": "A delivery", + "deprecationReason": null + }, + { + "name": "flexSearchDeliveries", + "description": "Queries for Deliveries using FlexSearch.", + "deprecationReason": null + }, + { + "name": "_flexSearchDeliveriesMeta", + "description": "Queries for Deliveries using FlexSearch.", + "deprecationReason": null + }, + { + "name": "Forwarder", + "description": "Finds a Forwarder by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "allForwarders", + "description": null, + "deprecationReason": null + }, + { + "name": "_allForwardersMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "OnlyRelations", + "description": "Finds a OnlyRelations by id", + "deprecationReason": null + }, + { + "name": "allOnlyRelations", + "description": null, + "deprecationReason": null + }, + { + "name": "_allOnlyRelationsMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "HandlingUnit", + "description": "Finds a HandlingUnit by id or id.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "allHandlingUnits", + "description": null, + "deprecationReason": null + }, + { + "name": "_allHandlingUnitsMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "flexSearchHandlingUnits", + "description": "Queries for HandlingUnits using FlexSearch.", + "deprecationReason": null + }, + { + "name": "_flexSearchHandlingUnitsMeta", + "description": "Queries for HandlingUnits using FlexSearch.", + "deprecationReason": null + }, + { + "name": "NumberRange", + "description": "Finds a NumberRange by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "allNumberRanges", + "description": null, + "deprecationReason": null + }, + { + "name": "_allNumberRangesMeta", + "description": null, + "deprecationReason": null + }, + { + "name": "SecretKey", + "description": "Finds a SecretKey by id or key.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "allSecretKeys", + "description": null, + "deprecationReason": null + }, + { + "name": "_allSecretKeysMeta", + "description": null, + "deprecationReason": null + } + ], + "inputFields": null + }, + { + "name": "Mutation", + "description": "The Mutation type for the root namespace\n\nFields are executed serially in the order they occur in the selection set (the result of the first field does not see the changes made by the second field). All mutations are executed atomically - if any of them fail, the complete operation is rolled back.", + "fields": [ + { + "name": "createBillingEntity", + "description": "Creates a new BillingEntity", + "deprecationReason": null + }, + { + "name": "createBillingEntities", + "description": "Creates multiple new BillingEntities", + "deprecationReason": null + }, + { + "name": "updateBillingEntity", + "description": "Updates an existing BillingEntity", + "deprecationReason": null + }, + { + "name": "updateBillingEntities", + "description": "Updates multiple existing BillingEntities (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllBillingEntities", + "description": "Updates BillingEntities that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteBillingEntity", + "description": "Deletes a BillingEntity by id", + "deprecationReason": null + }, + { + "name": "deleteBillingEntities", + "description": "Deletes multiple BillingEntities by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllBillingEntities", + "description": "Deletes BillingEntities that match a specified filter", + "deprecationReason": null + }, + { + "name": "createCountry", + "description": "Creates a new Country", + "deprecationReason": null + }, + { + "name": "createCountries", + "description": "Creates multiple new Countries", + "deprecationReason": null + }, + { + "name": "updateCountry", + "description": "Updates an existing Country", + "deprecationReason": null + }, + { + "name": "updateCountries", + "description": "Updates multiple existing Countries (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllCountries", + "description": "Updates Countries that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteCountry", + "description": "Deletes a Country by id or isoCode.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteCountries", + "description": "Deletes multiple Countries by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllCountries", + "description": "Deletes Countries that match a specified filter", + "deprecationReason": null + }, + { + "name": "createDelivery", + "description": "Creates a new Delivery", + "deprecationReason": null + }, + { + "name": "createDeliveries", + "description": "Creates multiple new Deliveries", + "deprecationReason": null + }, + { + "name": "updateDelivery", + "description": "Updates an existing Delivery", + "deprecationReason": null + }, + { + "name": "updateDeliveries", + "description": "Updates multiple existing Deliveries (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllDeliveries", + "description": "Updates Deliveries that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteDelivery", + "description": "Deletes a Delivery by id or deliveryNumber.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteDeliveries", + "description": "Deletes multiple Deliveries by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllDeliveries", + "description": "Deletes Deliveries that match a specified filter", + "deprecationReason": null + }, + { + "name": "confirmBillingForDelivery", + "description": "Confirms a Delivery to be exported to billing.", + "deprecationReason": null + }, + { + "name": "createForwarder", + "description": "Creates a new Forwarder", + "deprecationReason": null + }, + { + "name": "createForwarders", + "description": "Creates multiple new Forwarders", + "deprecationReason": null + }, + { + "name": "updateForwarder", + "description": "Updates an existing Forwarder", + "deprecationReason": null + }, + { + "name": "updateForwarders", + "description": "Updates multiple existing Forwarders (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllForwarders", + "description": "Updates Forwarders that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteForwarder", + "description": "Deletes a Forwarder by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteForwarders", + "description": "Deletes multiple Forwarders by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllForwarders", + "description": "Deletes Forwarders that match a specified filter", + "deprecationReason": null + }, + { + "name": "createOnlyRelations", + "description": "Creates a new OnlyRelations", + "deprecationReason": null + }, + { + "name": "updateOnlyRelations", + "description": "Updates an existing OnlyRelations", + "deprecationReason": null + }, + { + "name": "deleteOnlyRelations", + "description": "Deletes a OnlyRelations by id", + "deprecationReason": null + }, + { + "name": "deleteAllOnlyRelations", + "description": "Deletes OnlyRelations that match a specified filter", + "deprecationReason": null + }, + { + "name": "createHandlingUnit", + "description": "Creates a new HandlingUnit", + "deprecationReason": null + }, + { + "name": "createHandlingUnits", + "description": "Creates multiple new HandlingUnits", + "deprecationReason": null + }, + { + "name": "updateHandlingUnit", + "description": "Updates an existing HandlingUnit", + "deprecationReason": null + }, + { + "name": "updateHandlingUnits", + "description": "Updates multiple existing HandlingUnits (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllHandlingUnits", + "description": "Updates HandlingUnits that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteHandlingUnit", + "description": "Deletes a HandlingUnit by id or id.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteHandlingUnits", + "description": "Deletes multiple HandlingUnits by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllHandlingUnits", + "description": "Deletes HandlingUnits that match a specified filter", + "deprecationReason": null + }, + { + "name": "createNumberRange", + "description": "Creates a new NumberRange", + "deprecationReason": null + }, + { + "name": "createNumberRanges", + "description": "Creates multiple new NumberRanges", + "deprecationReason": null + }, + { + "name": "updateNumberRange", + "description": "Updates an existing NumberRange", + "deprecationReason": null + }, + { + "name": "updateNumberRanges", + "description": "Updates multiple existing NumberRanges (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllNumberRanges", + "description": "Updates NumberRanges that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteNumberRange", + "description": "Deletes a NumberRange by id or name.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteNumberRanges", + "description": "Deletes multiple NumberRanges by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllNumberRanges", + "description": "Deletes NumberRanges that match a specified filter", + "deprecationReason": null + }, + { + "name": "createSecretKey", + "description": "Creates a new SecretKey", + "deprecationReason": null + }, + { + "name": "createSecretKeys", + "description": "Creates multiple new SecretKeys", + "deprecationReason": null + }, + { + "name": "updateSecretKey", + "description": "Updates an existing SecretKey", + "deprecationReason": null + }, + { + "name": "updateSecretKeys", + "description": "Updates multiple existing SecretKeys (referenced by their ids)", + "deprecationReason": null + }, + { + "name": "updateAllSecretKeys", + "description": "Updates SecretKeys that match a specified filter", + "deprecationReason": null + }, + { + "name": "deleteSecretKey", + "description": "Deletes a SecretKey by id or key.\n\nYou should pass a non-null value to exactly one of the arguments.", + "deprecationReason": null + }, + { + "name": "deleteSecretKeys", + "description": "Deletes multiple SecretKeys by their ids.\n\nIDs that are not found are silently ignored.", + "deprecationReason": null + }, + { + "name": "deleteAllSecretKeys", + "description": "Deletes SecretKeys that match a specified filter", + "deprecationReason": null + } + ], + "inputFields": null + } + ] + } + } + } +} diff --git a/spec/regression/logistics/tests/descriptions.graphql b/spec/regression/logistics/tests/descriptions/test.graphql similarity index 94% rename from spec/regression/logistics/tests/descriptions.graphql rename to spec/regression/logistics/tests/descriptions/test.graphql index 269e7928a..0cfb6b2aa 100644 --- a/spec/regression/logistics/tests/descriptions.graphql +++ b/spec/regression/logistics/tests/descriptions/test.graphql @@ -1,4 +1,4 @@ -{ +query descriptions { __schema { types { name diff --git a/spec/regression/logistics/tests/entity-extensions/aql/afterUpdate.aql b/spec/regression/logistics/tests/entity-extensions/aql/afterUpdate.aql new file mode 100644 index 000000000..f24e5735d --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/afterUpdate.aql @@ -0,0 +1,15 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + } + }) +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/before.aql b/spec/regression/logistics/tests/entity-extensions/aql/before.aql new file mode 100644 index 000000000..36a6adf90 --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/before.aql @@ -0,0 +1,28 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_delivery3 = FIRST(( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var3) + LIMIT @var4 + RETURN v_delivery4 +)) +RETURN { + "withValue": (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + } + }), + "withoutValue": (IS_NULL(v_delivery3) ? null : { + "dgInfo": { + "unNumber": v_delivery3.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery3.`dgInfo`.`notices`) ? v_delivery3.`dgInfo`.`notices` : []) + } + }) +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/createWithNull.aql b/spec/regression/logistics/tests/entity-extensions/aql/createWithNull.aql new file mode 100644 index 000000000..acec0ac09 --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/createWithNull.aql @@ -0,0 +1,22 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/createWithValue.aql b/spec/regression/logistics/tests/entity-extensions/aql/createWithValue.aql new file mode 100644 index 000000000..eab2d7111 --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/createWithValue.aql @@ -0,0 +1,51 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/update.aql b/spec/regression/logistics/tests/entity-extensions/aql/update.aql new file mode 100644 index 000000000..399c1b259 --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/update.aql @@ -0,0 +1,44 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "dgInfo": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`) ? v_currentEntity1.`dgInfo` : {}), { + "unNumber": @var3, + "details": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`.`details`) ? v_currentEntity1.`dgInfo`.`details` : {}), { + "expiryDate": @var4 + }) + }), + "updatedAt": @var5 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []), + "details": { + "expiryDate": v_delivery1.`dgInfo`.`details`.`expiryDate` + } + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/updateNested.aql b/spec/regression/logistics/tests/entity-extensions/aql/updateNested.aql new file mode 100644 index 000000000..a68d68b61 --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/updateNested.aql @@ -0,0 +1,43 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "dgInfo": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`) ? v_currentEntity1.`dgInfo` : {}), { + "details": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`.`details`) ? v_currentEntity1.`dgInfo`.`details` : {}), { + "comment": @var3 + }) + }), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "details": { + "expiryDate": v_delivery1.`dgInfo`.`details`.`expiryDate`, + "comment": v_delivery1.`dgInfo`.`details`.`comment` + } + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/entity-extensions/aql/updateWithNull.aql b/spec/regression/logistics/tests/entity-extensions/aql/updateWithNull.aql new file mode 100644 index 000000000..483584d7d --- /dev/null +++ b/spec/regression/logistics/tests/entity-extensions/aql/updateWithNull.aql @@ -0,0 +1,32 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dgInfo": { + "unNumber": v_delivery1.`dgInfo`.`unNumber` + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/entity-extensions.result.json b/spec/regression/logistics/tests/entity-extensions/result.json similarity index 100% rename from spec/regression/logistics/tests/entity-extensions.result.json rename to spec/regression/logistics/tests/entity-extensions/result.json diff --git a/spec/regression/logistics/tests/entity-extensions.graphql b/spec/regression/logistics/tests/entity-extensions/test.graphql similarity index 100% rename from spec/regression/logistics/tests/entity-extensions.graphql rename to spec/regression/logistics/tests/entity-extensions/test.graphql diff --git a/spec/regression/logistics/tests/enum-key-fields/aql/EnumKey.aql b/spec/regression/logistics/tests/enum-key-fields/aql/EnumKey.aql new file mode 100644 index 000000000..ea62e0fec --- /dev/null +++ b/spec/regression/logistics/tests/enum-key-fields/aql/EnumKey.aql @@ -0,0 +1,12 @@ +LET v_numberRange1 = FIRST(( + FOR v_numberRange2 + IN @@numberRanges + FILTER (v_numberRange2.`name` == @var1) + LIMIT @var2 + RETURN v_numberRange2 +)) +RETURN { + "NumberRange": (IS_NULL(v_numberRange1) ? null : { + "name": v_numberRange1.`name` + }) +} diff --git a/spec/regression/logistics/tests/enum-key-fields.result.json b/spec/regression/logistics/tests/enum-key-fields/result.json similarity index 100% rename from spec/regression/logistics/tests/enum-key-fields.result.json rename to spec/regression/logistics/tests/enum-key-fields/result.json diff --git a/spec/regression/logistics/tests/enum-key-fields.graphql b/spec/regression/logistics/tests/enum-key-fields/test.graphql similarity index 100% rename from spec/regression/logistics/tests/enum-key-fields.graphql rename to spec/regression/logistics/tests/enum-key-fields/test.graphql diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/create.aql b/spec/regression/logistics/tests/field-permission-denied/aql/create.aql new file mode 100644 index 000000000..28b5903fa --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/create.aql @@ -0,0 +1,4 @@ +RETURN { + "createDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "createForwarder": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/delete.aql b/spec/regression/logistics/tests/field-permission-denied/aql/delete.aql new file mode 100644 index 000000000..2d5e395d7 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/delete.aql @@ -0,0 +1,3 @@ +RETURN { + "deleteForwarder": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/filter.aql b/spec/regression/logistics/tests/field-permission-denied/aql/filter.aql new file mode 100644 index 000000000..59bceffea --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/filter.aql @@ -0,0 +1,7 @@ +RETURN { + "direct": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "simple": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 }, + "startsWith": { __cruddl_runtime_error_code: @var5, __cruddl_runtime_error: @var6 }, + "throughRelation": { __cruddl_runtime_error_code: @var7, __cruddl_runtime_error: @var8 }, + "toUnaccessibleEntity": { __cruddl_runtime_error_code: @var9, __cruddl_runtime_error: @var10 } +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/prepare.aql b/spec/regression/logistics/tests/field-permission-denied/aql/prepare.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/prepare.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/select.aql b/spec/regression/logistics/tests/field-permission-denied/aql/select.aql new file mode 100644 index 000000000..594ac38b9 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/select.aql @@ -0,0 +1,54 @@ +WITH @@deliveries +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var3) + LIMIT @var4 + RETURN v_handlingUnit2 +)) +LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +LET v_country1 = FIRST(( + FOR v_country2 + IN @@countries + FILTER (v_country2.`isoCode` == @var5) + LIMIT @var6 + RETURN v_country2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var7, __cruddl_runtime_error: @var8 }, + "forwarder": { __cruddl_runtime_error_code: @var9, __cruddl_runtime_error: @var10 } + }), + "allDeliveries": ( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var11) + RETURN { + "deliveryNumber": v_delivery4.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var12, __cruddl_runtime_error: @var13 } + } + ), + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var14, __cruddl_runtime_error: @var15 } + }) + }), + "Country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "totalInvestment": { __cruddl_runtime_error_code: @var16, __cruddl_runtime_error: @var17 } + }) +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/selectMeta.aql b/spec/regression/logistics/tests/field-permission-denied/aql/selectMeta.aql new file mode 100644 index 000000000..ac60a4cc6 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/selectMeta.aql @@ -0,0 +1,6 @@ +RETURN { + "allForwarders": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + @var3: { + "count": { __cruddl_runtime_error_code: @var4, __cruddl_runtime_error: @var5 } + } +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/sort.aql b/spec/regression/logistics/tests/field-permission-denied/aql/sort.aql new file mode 100644 index 000000000..6304aff97 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/sort.aql @@ -0,0 +1,4 @@ +RETURN { + "direct": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "throughRelation": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } +} diff --git a/spec/regression/logistics/tests/field-permission-denied/aql/update.aql b/spec/regression/logistics/tests/field-permission-denied/aql/update.aql new file mode 100644 index 000000000..7eac5eb49 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-denied/aql/update.aql @@ -0,0 +1,5 @@ +RETURN { + "updateDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "updateForwarder": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 }, + "update2": { __cruddl_runtime_error_code: @var5, __cruddl_runtime_error: @var6 } +} diff --git a/spec/regression/logistics/tests/field-permission-denied.result.json b/spec/regression/logistics/tests/field-permission-denied/result.json similarity index 100% rename from spec/regression/logistics/tests/field-permission-denied.result.json rename to spec/regression/logistics/tests/field-permission-denied/result.json diff --git a/spec/regression/logistics/tests/field-permission-denied.graphql b/spec/regression/logistics/tests/field-permission-denied/test.graphql similarity index 100% rename from spec/regression/logistics/tests/field-permission-denied.graphql rename to spec/regression/logistics/tests/field-permission-denied/test.graphql diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/create.aql b/spec/regression/logistics/tests/field-permission-granted/aql/create.aql new file mode 100644 index 000000000..2c7f89a0b --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/create.aql @@ -0,0 +1,36 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN FIRST( + INSERT @var1 IN @@forwarders + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_forwarder1 = DOCUMENT(@@forwarders, @v_newEntityId1) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "createDelivery": @v_createDelivery1, + "createForwarder": @v_createForwarder1 +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/delete.aql b/spec/regression/logistics/tests/field-permission-granted/aql/delete.aql new file mode 100644 index 000000000..e7ad0438c --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/delete.aql @@ -0,0 +1,35 @@ +RETURN ( + FOR v_forwarder1 + IN @@forwarders + FILTER (v_forwarder1._key == @var1) + LIMIT @var2 + RETURN v_forwarder1._key +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +LET v_forwarder1 = FIRST(( + FOR v_forwarder2 + IN @v_ids1 + REMOVE v_forwarder2 + IN @@forwarders + RETURN OLD +)) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +RETURN { + "deleteForwarder": @v_deleteForwarder1 +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/filter.aql b/spec/regression/logistics/tests/field-permission-granted/aql/filter.aql new file mode 100644 index 000000000..f521f45d8 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/filter.aql @@ -0,0 +1,55 @@ +WITH @@deliveries, @@forwarders +LET v_secretKey1 = FIRST(( + FOR v_secretKey2 + IN @@secretKeys + FILTER (v_secretKey2.`key` == @var1) + LIMIT @var2 + RETURN v_secretKey2 +)) +RETURN { + "direct": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1._key == @var3) && (v_delivery1.`totalValue` == @var4)) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ), + "simple": (IS_NULL(v_secretKey1) ? null : { + "value": v_secretKey1.`value` + }), + "startsWith": ( + FOR v_delivery2 + IN @@deliveries + FILTER ((v_delivery2._key == @var5) && (v_delivery2.`totalValue` >= UPPER(@var6) && v_delivery2.`totalValue` < LOWER(@var7)) && (LEFT(v_delivery2.`totalValue`, LENGTH(@var8)) == @var9)) + RETURN { + "deliveryNumber": v_delivery2.`deliveryNumber` + } + ), + "throughRelation": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER ((v_handlingUnit1._key == @var10) && (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`totalValue` == @var11)) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ), + "toUnaccessibleEntity": ( + FOR v_delivery3 + IN @@deliveries + FILTER ((v_delivery3._key == @var12) && (FIRST(( + FOR v_node2 + IN OUTBOUND v_delivery3 @@deliveries_forwarder + FILTER v_node2._key != null + RETURN v_node2 + )).`name` == @var13)) + RETURN { + "deliveryNumber": v_delivery3.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/prepare.aql b/spec/regression/logistics/tests/field-permission-granted/aql/prepare.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/prepare.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/select.aql b/spec/regression/logistics/tests/field-permission-granted/aql/select.aql new file mode 100644 index 000000000..df580b6e3 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/select.aql @@ -0,0 +1,62 @@ +WITH @@forwarders, @@deliveries +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_forwarder1 = FIRST(( + FOR v_node1 + IN OUTBOUND v_delivery1 @@deliveries_forwarder + FILTER v_node1._key != null + RETURN v_node1 +)) +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var3) + LIMIT @var4 + RETURN v_handlingUnit2 +)) +LET v_delivery3 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 +)) +LET v_country1 = FIRST(( + FOR v_country2 + IN @@countries + FILTER (v_country2.`isoCode` == @var5) + LIMIT @var6 + RETURN v_country2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "totalValue": v_delivery1.`totalValue`, + "forwarder": (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` + }) + }), + "allDeliveries": ( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var7) + RETURN { + "deliveryNumber": v_delivery4.`deliveryNumber`, + "totalValue": v_delivery4.`totalValue` + } + ), + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber`, + "totalValue": v_delivery3.`totalValue` + }) + }), + "Country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "totalInvestment": v_country1.`totalInvestment` + }) +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/selectMeta.aql b/spec/regression/logistics/tests/field-permission-granted/aql/selectMeta.aql new file mode 100644 index 000000000..fd18408c4 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/selectMeta.aql @@ -0,0 +1,12 @@ +RETURN { + "allForwarders": ( + FOR v_forwarder1 + IN @@forwarders + RETURN { + "name": v_forwarder1.`name` + } + ), + @var1: { + "count": LENGTH(@@forwarders) + } +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/sort.aql b/spec/regression/logistics/tests/field-permission-granted/aql/sort.aql new file mode 100644 index 000000000..050254b9f --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/sort.aql @@ -0,0 +1,26 @@ +WITH @@deliveries +RETURN { + "direct": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + SORT (v_delivery1.`totalValue`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ), + "throughRelation": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var2) + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`totalValue`) DESC + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/field-permission-granted/aql/update.aql b/spec/regression/logistics/tests/field-permission-granted/aql/update.aql new file mode 100644 index 000000000..bef178e04 --- /dev/null +++ b/spec/regression/logistics/tests/field-permission-granted/aql/update.aql @@ -0,0 +1,124 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "totalValue": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_forwarder1 + IN @@forwarders + FILTER (v_forwarder1._key == @var1) + LIMIT @var2 + RETURN v_forwarder1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var3, + "updatedAt": @var4 + } + IN @@forwarders + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_forwarder1 = DOCUMENT(@@forwarders, @var1) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "updateDelivery": @v_updateDelivery1, + "updateForwarder": @v_updateForwarder1, + "update2": @v_updateDelivery2 +} diff --git a/spec/regression/logistics/tests/field-permission-granted.context.json b/spec/regression/logistics/tests/field-permission-granted/context.json similarity index 100% rename from spec/regression/logistics/tests/field-permission-granted.context.json rename to spec/regression/logistics/tests/field-permission-granted/context.json diff --git a/spec/regression/logistics/tests/field-permission-granted.result.json b/spec/regression/logistics/tests/field-permission-granted/result.json similarity index 100% rename from spec/regression/logistics/tests/field-permission-granted.result.json rename to spec/regression/logistics/tests/field-permission-granted/result.json diff --git a/spec/regression/logistics/tests/field-permission-granted.graphql b/spec/regression/logistics/tests/field-permission-granted/test.graphql similarity index 100% rename from spec/regression/logistics/tests/field-permission-granted.graphql rename to spec/regression/logistics/tests/field-permission-granted/test.graphql diff --git a/spec/regression/logistics/tests/filter-by-relation/aql/addRelation1.aql b/spec/regression/logistics/tests/filter-by-relation/aql/addRelation1.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/filter-by-relation/aql/addRelation1.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/filter-by-relation/aql/addRelation2.aql b/spec/regression/logistics/tests/filter-by-relation/aql/addRelation2.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/filter-by-relation/aql/addRelation2.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/filter-by-relation/aql/q.aql b/spec/regression/logistics/tests/filter-by-relation/aql/q.aql new file mode 100644 index 000000000..38919a649 --- /dev/null +++ b/spec/regression/logistics/tests/filter-by-relation/aql/q.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber` == @var1) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/filter-by-relation.result.json b/spec/regression/logistics/tests/filter-by-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/filter-by-relation.result.json rename to spec/regression/logistics/tests/filter-by-relation/result.json diff --git a/spec/regression/logistics/tests/filter-by-relation.graphql b/spec/regression/logistics/tests/filter-by-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-by-relation.graphql rename to spec/regression/logistics/tests/filter-by-relation/test.graphql diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list/aql/empty.aql b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/empty.aql new file mode 100644 index 000000000..3e4036e58 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/empty.aql @@ -0,0 +1,12 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (LENGTH(v_delivery1.`serialNumbers`) == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list/aql/init.aql b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/init.aql new file mode 100644 index 000000000..2aa1fe7dc --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/init.aql @@ -0,0 +1,34 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "serialNumbers": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list/aql/none.aql b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/none.aql new file mode 100644 index 000000000..e2002afea --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/none.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_serialNumbers1 + IN (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + RETURN v_serialNumbers1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list/aql/not_empty.aql b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/not_empty.aql new file mode 100644 index 000000000..3d9854dff --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/not_empty.aql @@ -0,0 +1,12 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (LENGTH(v_delivery1.`serialNumbers`) > @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list/aql/some.aql b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/some.aql new file mode 100644 index 000000000..d1f8892b7 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/aql/some.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_serialNumbers1 + IN (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + RETURN v_serialNumbers1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list.result.json b/spec/regression/logistics/tests/filter-empty-scalar-list/result.json similarity index 84% rename from spec/regression/logistics/tests/filter-empty-scalar-list.result.json rename to spec/regression/logistics/tests/filter-empty-scalar-list/result.json index 0408fe3d7..0ae0a48fa 100644 --- a/spec/regression/logistics/tests/filter-empty-scalar-list.result.json +++ b/spec/regression/logistics/tests/filter-empty-scalar-list/result.json @@ -40,10 +40,7 @@ "allDeliveries": [ { "deliveryNumber": "1000173", - "serialNumbers": [ - "12345", - "67890" - ] + "serialNumbers": ["12345", "67890"] } ] } @@ -53,12 +50,9 @@ "allDeliveries": [ { "deliveryNumber": "1000173", - "serialNumbers": [ - "12345", - "67890" - ] + "serialNumbers": ["12345", "67890"] } ] } } -} \ No newline at end of file +} diff --git a/spec/regression/logistics/tests/filter-empty-scalar-list.graphql b/spec/regression/logistics/tests/filter-empty-scalar-list/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-empty-scalar-list.graphql rename to spec/regression/logistics/tests/filter-empty-scalar-list/test.graphql diff --git a/spec/regression/logistics/tests/filter-empty/aql/empty.aql b/spec/regression/logistics/tests/filter-empty/aql/empty.aql new file mode 100644 index 000000000..3199b1f16 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty/aql/empty.aql @@ -0,0 +1,18 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (LENGTH(v_delivery1.`items`) == @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty/aql/empty_one_list.aql b/spec/regression/logistics/tests/filter-empty/aql/empty_one_list.aql new file mode 100644 index 000000000..c227172dd --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty/aql/empty_one_list.aql @@ -0,0 +1,41 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/filter-empty/aql/none.aql b/spec/regression/logistics/tests/filter-empty/aql/none.aql new file mode 100644 index 000000000..56a456a38 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty/aql/none.aql @@ -0,0 +1,27 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_items1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN v_items1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) == @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item2 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + } + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty/aql/not_empty.aql b/spec/regression/logistics/tests/filter-empty/aql/not_empty.aql new file mode 100644 index 000000000..52859ca78 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty/aql/not_empty.aql @@ -0,0 +1,18 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (LENGTH(v_delivery1.`items`) > @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty/aql/some.aql b/spec/regression/logistics/tests/filter-empty/aql/some.aql new file mode 100644 index 000000000..b75f3e6c7 --- /dev/null +++ b/spec/regression/logistics/tests/filter-empty/aql/some.aql @@ -0,0 +1,27 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_items1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN v_items1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item2 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + } + } + ) +} diff --git a/spec/regression/logistics/tests/filter-empty.result.json b/spec/regression/logistics/tests/filter-empty/result.json similarity index 100% rename from spec/regression/logistics/tests/filter-empty.result.json rename to spec/regression/logistics/tests/filter-empty/result.json diff --git a/spec/regression/logistics/tests/filter-empty.graphql b/spec/regression/logistics/tests/filter-empty/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-empty.graphql rename to spec/regression/logistics/tests/filter-empty/test.graphql diff --git a/spec/regression/logistics/tests/filter-null/aql/filterInEqualsNull.aql b/spec/regression/logistics/tests/filter-null/aql/filterInEqualsNull.aql new file mode 100644 index 000000000..7ebb9122c --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterInEqualsNull.aql @@ -0,0 +1,10 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + SORT (v_country1.`isoCode`) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterInNull.aql b/spec/regression/logistics/tests/filter-null/aql/filterInNull.aql new file mode 100644 index 000000000..6a1c87534 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterInNull.aql @@ -0,0 +1,11 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + FILTER (v_country1.`someKey` IN @var1) + SORT (v_country1.`isoCode`) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNotInNull.aql b/spec/regression/logistics/tests/filter-null/aql/filterNotInNull.aql new file mode 100644 index 000000000..ba2d5eaf1 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNotInNull.aql @@ -0,0 +1,11 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + FILTER !((v_country1.`someKey` IN @var1)) + SORT (v_country1.`isoCode`) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNotNullScalar.aql b/spec/regression/logistics/tests/filter-null/aql/filterNotNullScalar.aql new file mode 100644 index 000000000..b6f6033cb --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNotNullScalar.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`destinationCountryISOCode` > NULL) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "id": v_delivery1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNullEntityExtension.aql b/spec/regression/logistics/tests/filter-null/aql/filterNullEntityExtension.aql new file mode 100644 index 000000000..2741714a0 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNullEntityExtension.aql @@ -0,0 +1,10 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "id": v_delivery1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNullReference.aql b/spec/regression/logistics/tests/filter-null/aql/filterNullReference.aql new file mode 100644 index 000000000..34f76a353 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNullReference.aql @@ -0,0 +1,17 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var1 + RETURN v_destinationCountry1 + ))) == null) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "id": v_delivery1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNullRelation.aql b/spec/regression/logistics/tests/filter-null/aql/filterNullRelation.aql new file mode 100644 index 000000000..3d238a886 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNullRelation.aql @@ -0,0 +1,17 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) == null) + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "id": v_handlingUnit1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNullScalar.aql b/spec/regression/logistics/tests/filter-null/aql/filterNullScalar.aql new file mode 100644 index 000000000..279a92e7c --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNullScalar.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`destinationCountryISOCode` == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "id": v_delivery1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null/aql/filterNullValueObject.aql b/spec/regression/logistics/tests/filter-null/aql/filterNullValueObject.aql new file mode 100644 index 000000000..7a89bc0b5 --- /dev/null +++ b/spec/regression/logistics/tests/filter-null/aql/filterNullValueObject.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`consignee` == null) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "id": v_delivery1._key + } + ) +} diff --git a/spec/regression/logistics/tests/filter-null.result.json b/spec/regression/logistics/tests/filter-null/result.json similarity index 100% rename from spec/regression/logistics/tests/filter-null.result.json rename to spec/regression/logistics/tests/filter-null/result.json diff --git a/spec/regression/logistics/tests/filter-null.graphql b/spec/regression/logistics/tests/filter-null/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-null.graphql rename to spec/regression/logistics/tests/filter-null/test.graphql diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/empty_list.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/empty_list.aql new file mode 100644 index 000000000..8e3cc127d --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/empty_list.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) ALL == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/every.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/every.aql new file mode 100644 index 000000000..dd6c879c9 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/every.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`items`[*].`quantity` ALL > @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/every_equals.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/every_equals.aql new file mode 100644 index 000000000..789f605c2 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/every_equals.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`items`[*].`quantity` ALL == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/none.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/none.aql new file mode 100644 index 000000000..3c2c75da2 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/none.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`items`[*].`quantity` NONE > @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/null_list.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/null_list.aql new file mode 100644 index 000000000..8e3cc127d --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/null_list.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) ALL == @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/set_empty_list.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/set_empty_list.aql new file mode 100644 index 000000000..ffd64938e --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/set_empty_list.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "serialNumbers": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/some.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/some.aql new file mode 100644 index 000000000..9abfd421c --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/some.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`items`[*].`quantity` ANY > @var1) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/some_equals.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/some_equals.aql new file mode 100644 index 000000000..27b33b034 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/some_equals.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (@var1 IN v_delivery1.`items`[*].`quantity`) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_complicated.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_complicated.aql new file mode 100644 index 000000000..ad778e8c1 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_complicated.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_items1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (v_items1.`itemNumber` >= UPPER(@var1) && v_items1.`itemNumber` < LOWER(@var2)) + RETURN v_items1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var3) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_simple.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_simple.aql new file mode 100644 index 000000000..920bae614 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/some_like_simple.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (@var1 IN v_delivery1.`items`[*].`itemNumber`) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers/aql/some_multiple.aql b/spec/regression/logistics/tests/filter-quantifiers/aql/some_multiple.aql new file mode 100644 index 000000000..d3922f412 --- /dev/null +++ b/spec/regression/logistics/tests/filter-quantifiers/aql/some_multiple.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_items1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER ((v_items1.`quantity` < @var1) && (v_items1.`quantity` > @var2)) + RETURN v_items1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var3) + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-quantifiers.result.json b/spec/regression/logistics/tests/filter-quantifiers/result.json similarity index 100% rename from spec/regression/logistics/tests/filter-quantifiers.result.json rename to spec/regression/logistics/tests/filter-quantifiers/result.json diff --git a/spec/regression/logistics/tests/filter-quantifiers.graphql b/spec/regression/logistics/tests/filter-quantifiers/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-quantifiers.graphql rename to spec/regression/logistics/tests/filter-quantifiers/test.graphql diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nString.aql b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nString.aql new file mode 100644 index 000000000..8efbe0c5e --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nString.aql @@ -0,0 +1,33 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_description1 + IN ( + LET v_object1 = v_deliveryItem1.`description` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER ((v_description1)[@var3] == @var4) + RETURN v_description1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var5) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithCorrectLanguage.aql b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithCorrectLanguage.aql new file mode 100644 index 000000000..07f2febbd --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithCorrectLanguage.aql @@ -0,0 +1,33 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_description1 + IN ( + LET v_object1 = v_deliveryItem1.`description` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER (((v_description1)[@var3] == @var4) && ((v_description1)[@var5] == @var6)) + RETURN v_description1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var7) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithIncorrectLanguage.aql b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithIncorrectLanguage.aql new file mode 100644 index 000000000..07f2febbd --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithIncorrectLanguage.aql @@ -0,0 +1,33 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_description1 + IN ( + LET v_object1 = v_deliveryItem1.`description` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER (((v_description1)[@var3] == @var4) && ((v_description1)[@var5] == @var6)) + RETURN v_description1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var7) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithNullValueForI18nString.aql b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithNullValueForI18nString.aql new file mode 100644 index 000000000..07f2febbd --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/aql/filterI18nStringWithNullValueForI18nString.aql @@ -0,0 +1,33 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_description1 + IN ( + LET v_object1 = v_deliveryItem1.`description` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER (((v_description1)[@var3] == @var4) && ((v_description1)[@var5] == @var6)) + RETURN v_description1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var7) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities.result.json b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/result.json similarity index 100% rename from spec/regression/logistics/tests/filter-stringmap-in-child-entities.result.json rename to spec/regression/logistics/tests/filter-stringmap-in-child-entities/result.json diff --git a/spec/regression/logistics/tests/filter-stringmap-in-child-entities.graphql b/spec/regression/logistics/tests/filter-stringmap-in-child-entities/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-stringmap-in-child-entities.graphql rename to spec/regression/logistics/tests/filter-stringmap-in-child-entities/test.graphql diff --git a/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nString.aql b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nString.aql new file mode 100644 index 000000000..e96e4bd72 --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nString.aql @@ -0,0 +1,24 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_descriptionI18nString1 + IN ( + LET v_object1 = v_country1.`descriptionI18nString` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER ((v_descriptionI18nString1)[@var1] == @var2) + RETURN v_descriptionI18nString1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var3) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithCorrectLanguage.aql b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithCorrectLanguage.aql new file mode 100644 index 000000000..3a910239d --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithCorrectLanguage.aql @@ -0,0 +1,24 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_descriptionI18nString1 + IN ( + LET v_object1 = v_country1.`descriptionI18nString` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER (((v_descriptionI18nString1)[@var1] == @var2) && ((v_descriptionI18nString1)[@var3] == @var4)) + RETURN v_descriptionI18nString1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var5) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithIncorrectLanguage.aql b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithIncorrectLanguage.aql new file mode 100644 index 000000000..3a910239d --- /dev/null +++ b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/aql/filterI18nStringWithIncorrectLanguage.aql @@ -0,0 +1,24 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_descriptionI18nString1 + IN ( + LET v_object1 = v_country1.`descriptionI18nString` + FOR v_key1 IN IS_DOCUMENT(v_object1) ? ATTRIBUTES(v_object1) : [] + RETURN [ v_key1, v_object1[v_key1] ] + ) + FILTER (((v_descriptionI18nString1)[@var1] == @var2) && ((v_descriptionI18nString1)[@var3] == @var4)) + RETURN v_descriptionI18nString1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var5) + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-root-entities.result.json b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/result.json similarity index 99% rename from spec/regression/logistics/tests/filter-stringmap-in-root-entities.result.json rename to spec/regression/logistics/tests/filter-stringmap-in-root-entities/result.json index c391e780a..d668fc13f 100644 --- a/spec/regression/logistics/tests/filter-stringmap-in-root-entities.result.json +++ b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/result.json @@ -22,4 +22,4 @@ "allCountries": [] } } -} \ No newline at end of file +} diff --git a/spec/regression/logistics/tests/filter-stringmap-in-root-entities.graphql b/spec/regression/logistics/tests/filter-stringmap-in-root-entities/test.graphql similarity index 100% rename from spec/regression/logistics/tests/filter-stringmap-in-root-entities.graphql rename to spec/regression/logistics/tests/filter-stringmap-in-root-entities/test.graphql diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/everythingIsGreaterThanNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/everythingIsGreaterThanNull.aql new file mode 100644 index 000000000..11ed931da --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/everythingIsGreaterThanNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "sometimesNull": v_delivery1.`sometimesNull` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/nothingIsLessThanNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/nothingIsLessThanNull.aql new file mode 100644 index 000000000..f622d009e --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/nothingIsLessThanNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH false + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "sometimesNull": v_delivery1.`sometimesNull` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringEqualsNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringEqualsNull.aql new file mode 100644 index 000000000..baac94acf --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringEqualsNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH ((v_country2.`someKey` == null) || !(EXISTS(v_country2.`someKey`, "analyzer", @var1))) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanNull.aql new file mode 100644 index 000000000..a403e6a69 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH ((v_country2.`someKey` != null) && EXISTS(v_country2.`someKey`, "analyzer", @var1)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanOrEqualNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanOrEqualNull.aql new file mode 100644 index 000000000..a0173e33c --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringGreaterThanOrEqualNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH true + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringInNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringInNull.aql new file mode 100644 index 000000000..97a8c3b07 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringInNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (ANALYZER( v_country2.`someKey` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) || !(EXISTS(v_country2.`someKey`, "analyzer", @var4))) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanNull.aql new file mode 100644 index 000000000..a2b3d5ffe --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH false + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanOrEqualNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanOrEqualNull.aql new file mode 100644 index 000000000..baac94acf --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringLessThanOrEqualNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH ((v_country2.`someKey` == null) || !(EXISTS(v_country2.`someKey`, "analyzer", @var1))) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotEqualsNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotEqualsNull.aql new file mode 100644 index 000000000..a403e6a69 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotEqualsNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH ((v_country2.`someKey` != null) && EXISTS(v_country2.`someKey`, "analyzer", @var1)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotInNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotInNull.aql new file mode 100644 index 000000000..a403b0999 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotInNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (!(ANALYZER( v_country2.`someKey` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 )) && EXISTS(v_country2.`someKey`, "analyzer", @var4)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotStartsWithNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotStartsWithNull.aql new file mode 100644 index 000000000..a0173e33c --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringNotStartsWithNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH true + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null/aql/stringStartsWithNull.aql b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringStartsWithNull.aql new file mode 100644 index 000000000..a0173e33c --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-filter-null/aql/stringStartsWithNull.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH true + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-filter-null.meta.json b/spec/regression/logistics/tests/flex-search-filter-null/meta.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-filter-null.meta.json rename to spec/regression/logistics/tests/flex-search-filter-null/meta.json diff --git a/spec/regression/logistics/tests/flex-search-filter-null.result.json b/spec/regression/logistics/tests/flex-search-filter-null/result.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-filter-null.result.json rename to spec/regression/logistics/tests/flex-search-filter-null/result.json diff --git a/spec/regression/logistics/tests/flex-search-filter-null.graphql b/spec/regression/logistics/tests/flex-search-filter-null/test.graphql similarity index 100% rename from spec/regression/logistics/tests/flex-search-filter-null.graphql rename to spec/regression/logistics/tests/flex-search-filter-null/test.graphql diff --git a/spec/regression/logistics/tests/flex-search-i18nstring/aql/fulltextInList.aql b/spec/regression/logistics/tests/flex-search-i18nstring/aql/fulltextInList.aql new file mode 100644 index 000000000..69e5ace5f --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-i18nstring/aql/fulltextInList.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (LENGTH(TOKENS(@var1,@var2)) ? ANALYZER( STARTS_WITH( v_delivery2.`items`.`description`.`en`, TOKENS(@var3,@var4)[0]), @var5) : false) + OPTIONS { conditionOptimization: 'none' } + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-i18nstring/aql/identityInList.aql b/spec/regression/logistics/tests/flex-search-i18nstring/aql/identityInList.aql new file mode 100644 index 000000000..4eb5c30b7 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-i18nstring/aql/identityInList.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`items`.`description`.`de` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-i18nstring.context.json b/spec/regression/logistics/tests/flex-search-i18nstring/context.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-i18nstring.context.json rename to spec/regression/logistics/tests/flex-search-i18nstring/context.json diff --git a/spec/regression/logistics/tests/flex-search-i18nstring.meta.json b/spec/regression/logistics/tests/flex-search-i18nstring/meta.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-i18nstring.meta.json rename to spec/regression/logistics/tests/flex-search-i18nstring/meta.json diff --git a/spec/regression/logistics/tests/flex-search-i18nstring.result.json b/spec/regression/logistics/tests/flex-search-i18nstring/result.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-i18nstring.result.json rename to spec/regression/logistics/tests/flex-search-i18nstring/result.json diff --git a/spec/regression/logistics/tests/flex-search-i18nstring.graphql b/spec/regression/logistics/tests/flex-search-i18nstring/test.graphql similarity index 100% rename from spec/regression/logistics/tests/flex-search-i18nstring.graphql rename to spec/regression/logistics/tests/flex-search-i18nstring/test.graphql diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/empty.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/empty.aql new file mode 100644 index 000000000..6d0568d7e --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/empty.aql @@ -0,0 +1,44 @@ +RETURN { + "empty": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH !(EXISTS(v_delivery2.`items`)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var1: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } + } + ), + "not_empty": ( + FOR v_delivery3 + IN ( + FOR v_delivery4 + IN @@flex_view_deliveries + SEARCH EXISTS(v_delivery4.`items`) + RETURN v_delivery4 + ) + SORT (v_delivery3.`deliveryNumber`) , (v_delivery3.`createdAt`) DESC, (v_delivery3._key) DESC + RETURN { + "deliveryNumber": v_delivery3.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item2 + IN (IS_LIST(v_delivery3.`items`) ? v_delivery3.`items` : []) + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + } + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/empty_one_list.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/empty_one_list.aql new file mode 100644 index 000000000..c227172dd --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/empty_one_list.aql @@ -0,0 +1,41 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + @var2: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/entityExtension.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/entityExtension.aql new file mode 100644 index 000000000..3bfa1b09e --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/entityExtension.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`colorData`.`packageColor` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/eq_does_not_include_null.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/eq_does_not_include_null.aql new file mode 100644 index 000000000..a56ff33c8 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/eq_does_not_include_null.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH ANALYZER( v_country2.`someKey` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/equals.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals.aql new file mode 100644 index 000000000..b832e27e7 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_enum.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_enum.aql new file mode 100644 index 000000000..4d54eac14 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_enum.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`enumFlexSearch` == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_id.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_id.aql new file mode 100644 index 000000000..977fcc197 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_id.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2._key == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_number.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_number.aql new file mode 100644 index 000000000..edb1145dd --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/equals_number.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`aNumber` == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/gte_string.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/gte_string.aql new file mode 100644 index 000000000..044017c39 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/gte_string.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( IN_RANGE(v_delivery2.`deliveryNumber`, TOKENS(@var1, @var2)[0], @var3, true, true), @var4) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/in.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/in.aql new file mode 100644 index 000000000..bad1bfbca --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/in.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/in_null.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/in_null.aql new file mode 100644 index 000000000..31a01232c --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/in_null.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (ANALYZER( v_country2.`someKey` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) || !(EXISTS(v_country2.`someKey`, "analyzer", @var4))) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_above_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_above_max.aql new file mode 100644 index 000000000..050378db3 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_above_max.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` >= UPPER(@var3) && v_delivery1.`description` < LOWER(@var4)) && (LEFT(v_delivery1.`description`, LENGTH(@var5)) == @var6) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_below_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_below_max.aql new file mode 100644 index 000000000..26582af26 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/legacy_filter_below_max.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var3 , @var4) RETURN v_token1[0] ), @var5 ) + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` == @var6) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/lt_includes_null.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/lt_includes_null.aql new file mode 100644 index 000000000..e418bd238 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/lt_includes_null.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (((v_country2.`someKey` == null) || !(EXISTS(v_country2.`someKey`, "analyzer", @var1))) || ANALYZER( IN_RANGE(v_country2.`someKey`, @var2 , TOKENS(@var3, @var4)[0], true, false), @var5)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_includes_null.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_includes_null.aql new file mode 100644 index 000000000..64e6e266a --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_includes_null.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (((v_country2.`someKey` == null) || !(EXISTS(v_country2.`someKey`, "analyzer", @var1))) || ANALYZER( IN_RANGE(v_country2.`someKey`, @var2 , TOKENS(@var3, @var4)[0], true, true), @var5)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode`, + "someKey": v_country1.`someKey` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_string.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_string.aql new file mode 100644 index 000000000..4803cca35 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/lte_string.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (((v_delivery2.`deliveryNumber` == null) || !(EXISTS(v_delivery2.`deliveryNumber`, "analyzer", @var1))) || ANALYZER( IN_RANGE(v_delivery2.`deliveryNumber`, @var2 , TOKENS(@var3, @var4)[0], true, true), @var5)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_above_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_above_max.aql new file mode 100644 index 000000000..2bd405207 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_above_max.aql @@ -0,0 +1,34 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + @var1: (@tmp1 ? { __cruddl_runtime_error_code: @var2, __cruddl_runtime_error: @var3 } : { + "count": FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` >= UPPER(@var4) && v_delivery1.`description` < LOWER(@var5)) && (LEFT(v_delivery1.`description`, LENGTH(@var6)) == @var7) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_below_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_below_max.aql new file mode 100644 index 000000000..0fa2d0ae6 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/meta_below_max.aql @@ -0,0 +1,34 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN { + @var1: (@tmp1 ? { __cruddl_runtime_error_code: @var2, __cruddl_runtime_error: @var3 } : { + "count": FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var4, @var5)[0],@var6) + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` >= UPPER(@var7) && v_delivery1.`description` < LOWER(@var8)) && (LEFT(v_delivery1.`description`, LENGTH(@var9)) == @var10) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/not_in_null.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/not_in_null.aql new file mode 100644 index 000000000..18940c3d2 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/not_in_null.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchCountries": ( + FOR v_country1 + IN ( + FOR v_country2 + IN @@flex_view_countries + SEARCH (!(ANALYZER( v_country2.`someKey` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 )) && EXISTS(v_country2.`someKey`, "analyzer", @var4)) + RETURN v_country2 + ) + SORT (v_country1.`isoCode`) , (v_country1.`createdAt`) DESC, (v_country1._key) DESC + RETURN { + "isoCode": v_country1.`isoCode` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/null_starts_with.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/null_starts_with.aql new file mode 100644 index 000000000..a55fdf641 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/null_starts_with.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER(STARTS_WITH(v_delivery2.`aText`, TOKENS(@var1,@var2)[0]), @var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/offset_date_time.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/offset_date_time.aql new file mode 100644 index 000000000..e914cabb8 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/offset_date_time.aql @@ -0,0 +1,17 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`dispatchDate`.`timestamp` == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "dispatchDate": v_delivery1.`dispatchDate` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/order_above_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/order_above_max.aql new file mode 100644 index 000000000..3623a796a --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/order_above_max.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/order_below_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/order_below_max.aql new file mode 100644 index 000000000..b832e27e7 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/order_below_max.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/post_and_legacy_filter_throws.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_and_legacy_filter_throws.aql new file mode 100644 index 000000000..775cef954 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_and_legacy_filter_throws.aql @@ -0,0 +1,17 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : { __cruddl_runtime_error: @var3 }) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_above_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_above_max.aql new file mode 100644 index 000000000..050378db3 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_above_max.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` >= UPPER(@var3) && v_delivery1.`description` < LOWER(@var4)) && (LEFT(v_delivery1.`description`, LENGTH(@var5)) == @var6) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_and_first.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_and_first.aql new file mode 100644 index 000000000..213684c20 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_and_first.aql @@ -0,0 +1,60 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN { + "a": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var3 , @var4) RETURN v_token1[0] ), @var5 ) + RETURN v_delivery2 + ) + FILTER (v_delivery1.`deliveryNumber` == @var6) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + LIMIT @var7 + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )), + "b": (@tmp2 ? { __cruddl_runtime_error_code: @var8, __cruddl_runtime_error: @var9 } : ( + FOR v_delivery3 + IN ( + FOR v_delivery4 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery4.`deliveryNumber` IN ( FOR v_token2 IN TOKENS(@var10 , @var11) RETURN v_token2[0] ), @var12 ) + RETURN v_delivery4 + ) + FILTER (v_delivery3.`deliveryNumber` == @var13) + SORT (v_delivery3.`deliveryNumber`) , (v_delivery3.`createdAt`) DESC, (v_delivery3._key) DESC + LIMIT @var14, @var15 + RETURN { + "deliveryNumber": v_delivery3.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_below_max.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_below_max.aql new file mode 100644 index 000000000..e4ebb29ef --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/post_filter_below_max.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_delivery1 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery1.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var4) + +// -------------------------------- + +RETURN { + "flexSearchDeliveries": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var3, @var4)[0],@var5) + RETURN v_delivery2 + ) + FILTER (v_delivery1.`description` >= UPPER(@var6) && v_delivery1.`description` < LOWER(@var7)) && (LEFT(v_delivery1.`description`, LENGTH(@var8)) == @var9) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_error.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_error.aql new file mode 100644 index 000000000..c141b41e6 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_error.aql @@ -0,0 +1,3 @@ +RETURN { + "flexSearchDeliveries": { __cruddl_runtime_error: @var1 } +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_successfull.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_successfull.aql new file mode 100644 index 000000000..ff6663499 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/recursion_successfull.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`recursion`.`recursion`.`name` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/starts_with.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/starts_with.aql new file mode 100644 index 000000000..8d6ba5ef8 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/starts_with.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/string_aggregation.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/string_aggregation.aql new file mode 100644 index 000000000..78ab24670 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/string_aggregation.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`serialNumbers` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []) + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory/aql/valueObject.aql b/spec/regression/logistics/tests/flex-search-in-memory/aql/valueObject.aql new file mode 100644 index 000000000..da1433391 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-in-memory/aql/valueObject.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`consignee`.`city` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-in-memory.context.json b/spec/regression/logistics/tests/flex-search-in-memory/context.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-in-memory.context.json rename to spec/regression/logistics/tests/flex-search-in-memory/context.json diff --git a/spec/regression/logistics/tests/flex-search-in-memory.meta.json b/spec/regression/logistics/tests/flex-search-in-memory/meta.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-in-memory.meta.json rename to spec/regression/logistics/tests/flex-search-in-memory/meta.json diff --git a/spec/regression/logistics/tests/flex-search-in-memory.result.json b/spec/regression/logistics/tests/flex-search-in-memory/result.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-in-memory.result.json rename to spec/regression/logistics/tests/flex-search-in-memory/result.json diff --git a/spec/regression/logistics/tests/flex-search-in-memory.graphql b/spec/regression/logistics/tests/flex-search-in-memory/test.graphql similarity index 100% rename from spec/regression/logistics/tests/flex-search-in-memory.graphql rename to spec/regression/logistics/tests/flex-search-in-memory/test.graphql diff --git a/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max.aql b/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max.aql new file mode 100644 index 000000000..64f315988 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_handlingUnit1 + IN @@flex_view_handlingUnits + SEARCH true + RETURN v_handlingUnit1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchHandlingUnits": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_handlingUnit1 + IN ( + FOR v_handlingUnit2 + IN @@flex_view_handlingUnits + SEARCH true + RETURN v_handlingUnit2 + ) + SORT (v_handlingUnit1._key) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + )) +} diff --git a/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max_primary_sort.aql b/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max_primary_sort.aql new file mode 100644 index 000000000..a0db33286 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search-primary-sort/aql/order_above_max_primary_sort.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchHandlingUnits": ( + FOR v_handlingUnit1 + IN ( + FOR v_handlingUnit2 + IN @@flex_view_handlingUnits + SEARCH true + RETURN v_handlingUnit2 + ) + SORT (v_handlingUnit1.`huNumber`) DESC, (v_handlingUnit1.`createdAt`) DESC, (v_handlingUnit1._key) DESC + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search-primary-sort.context.json b/spec/regression/logistics/tests/flex-search-primary-sort/context.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-primary-sort.context.json rename to spec/regression/logistics/tests/flex-search-primary-sort/context.json diff --git a/spec/regression/logistics/tests/flex-search-primary-sort.meta.json b/spec/regression/logistics/tests/flex-search-primary-sort/meta.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-primary-sort.meta.json rename to spec/regression/logistics/tests/flex-search-primary-sort/meta.json diff --git a/spec/regression/logistics/tests/flex-search-primary-sort.result.json b/spec/regression/logistics/tests/flex-search-primary-sort/result.json similarity index 100% rename from spec/regression/logistics/tests/flex-search-primary-sort.result.json rename to spec/regression/logistics/tests/flex-search-primary-sort/result.json diff --git a/spec/regression/logistics/tests/flex-search-primary-sort.graphql b/spec/regression/logistics/tests/flex-search-primary-sort/test.graphql similarity index 100% rename from spec/regression/logistics/tests/flex-search-primary-sort.graphql rename to spec/regression/logistics/tests/flex-search-primary-sort/test.graphql diff --git a/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_equals.aql b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_equals.aql new file mode 100644 index 000000000..7df3de079 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_equals.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`caseInsensitiveField` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "caseInsensitiveField": v_delivery1.`caseInsensitiveField` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_gte.aql b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_gte.aql new file mode 100644 index 000000000..44c68f2dd --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_gte.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( IN_RANGE(v_delivery2.`caseInsensitiveField`, TOKENS(@var1, @var2)[0], @var3, true, true), @var4) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "caseInsensitiveField": v_delivery1.`caseInsensitiveField` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_in.aql b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_in.aql new file mode 100644 index 000000000..9c5e02089 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_in.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`caseInsensitiveField` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 ) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "caseInsensitiveField": v_delivery1.`caseInsensitiveField` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_starts_with.aql b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_starts_with.aql new file mode 100644 index 000000000..a1354685b --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/caseInsensitive_starts_with.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER(STARTS_WITH(v_delivery2.`caseInsensitiveField`, TOKENS(@var1,@var2)[0]), @var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "caseInsensitiveField": v_delivery1.`caseInsensitiveField` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixes.aql b/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixes.aql new file mode 100644 index 000000000..7bafdf2be --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixes.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((LENGTH(TOKENS(@var1,@var2)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var3,@var4)[0]), @var5) : false) && (LENGTH(TOKENS(@var6,@var7)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var8,@var9)[0]), @var10) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixesWithEmptyFilter.aql b/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixesWithEmptyFilter.aql new file mode 100644 index 000000000..7bafdf2be --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsAllPrefixesWithEmptyFilter.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((LENGTH(TOKENS(@var1,@var2)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var3,@var4)[0]), @var5) : false) && (LENGTH(TOKENS(@var6,@var7)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var8,@var9)[0]), @var10) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsAllWords.aql b/spec/regression/logistics/tests/flex-search/aql/containsAllWords.aql new file mode 100644 index 000000000..92f7a10ea --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsAllWords.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER( v_delivery2.`description` IN TOKENS(@var1, @var2),@var3) && ANALYZER( v_delivery2.`description` IN TOKENS(@var4, @var5),@var6)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsAnyPrefix.aql b/spec/regression/logistics/tests/flex-search/aql/containsAnyPrefix.aql new file mode 100644 index 000000000..ab47524ac --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsAnyPrefix.aql @@ -0,0 +1,16 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((LENGTH(TOKENS(@var1,@var2)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var3,@var4)[0]), @var5) : false) || (LENGTH(TOKENS(@var6,@var7)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var8,@var9)[0]), @var10) : false)) + OPTIONS { conditionOptimization: 'none' } + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsAnyWord.aql b/spec/regression/logistics/tests/flex-search/aql/containsAnyWord.aql new file mode 100644 index 000000000..8ea9e5035 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsAnyWord.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`description` IN TOKENS(@var1, @var2),@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/containsPhrase.aql b/spec/regression/logistics/tests/flex-search/aql/containsPhrase.aql new file mode 100644 index 000000000..65c973802 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/containsPhrase.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( PHRASE( v_delivery2.`description`, @var1), @var2) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/emptyExpression.aql b/spec/regression/logistics/tests/flex-search/aql/emptyExpression.aql new file mode 100644 index 000000000..c0a9ce4eb --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/emptyExpression.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH true + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/equals_null.aql b/spec/regression/logistics/tests/flex-search/aql/equals_null.aql new file mode 100644 index 000000000..4ab591aa0 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/equals_null.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((v_delivery2.`destinationCountryISOCode` == null) || !(EXISTS(v_delivery2.`destinationCountryISOCode`, "analyzer", @var1))) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/everythingIsGreaterThanNullInAggregation.aql b/spec/regression/logistics/tests/flex-search/aql/everythingIsGreaterThanNullInAggregation.aql new file mode 100644 index 000000000..9db62b017 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/everythingIsGreaterThanNullInAggregation.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((v_delivery2.`items`.`quantity` != null) && EXISTS(v_delivery2.`items`.`quantity`)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expression.aql b/spec/regression/logistics/tests/flex-search/aql/expression.aql new file mode 100644 index 000000000..4d80dd2c4 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expression.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || (LENGTH(TOKENS(@var4,@var5)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var6,@var7)[0]), @var8) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expressionFulltext.aql b/spec/regression/logistics/tests/flex-search/aql/expressionFulltext.aql new file mode 100644 index 000000000..4d80dd2c4 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expressionFulltext.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || (LENGTH(TOKENS(@var4,@var5)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var6,@var7)[0]), @var8) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expressionRequiresFlagOnChildObjects.aql b/spec/regression/logistics/tests/flex-search/aql/expressionRequiresFlagOnChildObjects.aql new file mode 100644 index 000000000..4d80dd2c4 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expressionRequiresFlagOnChildObjects.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || (LENGTH(TOKENS(@var4,@var5)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var6,@var7)[0]), @var8) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expressionWithMultipleWords.aql b/spec/regression/logistics/tests/flex-search/aql/expressionWithMultipleWords.aql new file mode 100644 index 000000000..1a3bc81f5 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expressionWithMultipleWords.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || ((LENGTH(TOKENS(@var4,@var5)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var6,@var7)[0]), @var8) : false) && (LENGTH(TOKENS(@var9,@var10)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var11,@var12)[0]), @var13) : false))) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expressionWithNoTokens.aql b/spec/regression/logistics/tests/flex-search/aql/expressionWithNoTokens.aql new file mode 100644 index 000000000..b074d7b07 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expressionWithNoTokens.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || false) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/expressionWithoutResults.aql b/spec/regression/logistics/tests/flex-search/aql/expressionWithoutResults.aql new file mode 100644 index 000000000..4d80dd2c4 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/expressionWithoutResults.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (ANALYZER(STARTS_WITH(v_delivery2.`deliveryNumber`, TOKENS(@var1,@var2)[0]), @var3) || (LENGTH(TOKENS(@var4,@var5)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var6,@var7)[0]), @var8) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/gt_lt_number.aql b/spec/regression/logistics/tests/flex-search/aql/gt_lt_number.aql new file mode 100644 index 000000000..4ad705e66 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/gt_lt_number.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (((v_delivery2.`items`.`quantity` == null) || !(EXISTS(v_delivery2.`items`.`quantity`))) || (v_delivery2.`items`.`quantity` < @var1)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/id.aql b/spec/regression/logistics/tests/flex-search/aql/id.aql new file mode 100644 index 000000000..977fcc197 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/id.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2._key == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/multipleTokenizationExpressions.aql b/spec/regression/logistics/tests/flex-search/aql/multipleTokenizationExpressions.aql new file mode 100644 index 000000000..76c34045a --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/multipleTokenizationExpressions.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ((LENGTH(TOKENS(@var1,@var2)) ? ANALYZER( STARTS_WITH( v_delivery2.`items`.`itemNumber`, TOKENS(@var3,@var4)[0]), @var5) : false) && (LENGTH(TOKENS(@var6,@var7)) ? ANALYZER( STARTS_WITH( v_delivery2.`description`, TOKENS(@var8,@var9)[0]), @var10) : false)) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search/aql/nothingIsLessThanNullInAggregation.aql b/spec/regression/logistics/tests/flex-search/aql/nothingIsLessThanNullInAggregation.aql new file mode 100644 index 000000000..d4eed9ae9 --- /dev/null +++ b/spec/regression/logistics/tests/flex-search/aql/nothingIsLessThanNullInAggregation.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH false + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flex-search.context.json b/spec/regression/logistics/tests/flex-search/context.json similarity index 100% rename from spec/regression/logistics/tests/flex-search.context.json rename to spec/regression/logistics/tests/flex-search/context.json diff --git a/spec/regression/logistics/tests/flex-search.meta.json b/spec/regression/logistics/tests/flex-search/meta.json similarity index 100% rename from spec/regression/logistics/tests/flex-search.meta.json rename to spec/regression/logistics/tests/flex-search/meta.json diff --git a/spec/regression/logistics/tests/flex-search.result.json b/spec/regression/logistics/tests/flex-search/result.json similarity index 100% rename from spec/regression/logistics/tests/flex-search.result.json rename to spec/regression/logistics/tests/flex-search/result.json diff --git a/spec/regression/logistics/tests/flex-search.graphql b/spec/regression/logistics/tests/flex-search/test.graphql similarity index 100% rename from spec/regression/logistics/tests/flex-search.graphql rename to spec/regression/logistics/tests/flex-search/test.graphql diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/a.aql b/spec/regression/logistics/tests/flexsearch-not/aql/a.aql new file mode 100644 index 000000000..a0f0a3bda --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/a.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` != TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/b.aql b/spec/regression/logistics/tests/flexsearch-not/aql/b.aql new file mode 100644 index 000000000..a0f0a3bda --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/b.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` != TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/c.aql b/spec/regression/logistics/tests/flexsearch-not/aql/c.aql new file mode 100644 index 000000000..b832e27e7 --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/c.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/d.aql b/spec/regression/logistics/tests/flexsearch-not/aql/d.aql new file mode 100644 index 000000000..b832e27e7 --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/d.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH ANALYZER( v_delivery2.`deliveryNumber` == TOKENS(@var1, @var2)[0],@var3) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/e.aql b/spec/regression/logistics/tests/flexsearch-not/aql/e.aql new file mode 100644 index 000000000..b65b75eab --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/e.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`processingFinished` == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/f.aql b/spec/regression/logistics/tests/flexsearch-not/aql/f.aql new file mode 100644 index 000000000..b65b75eab --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/f.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`processingFinished` == @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/g.aql b/spec/regression/logistics/tests/flexsearch-not/aql/g.aql new file mode 100644 index 000000000..992c857d8 --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/g.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`processingFinished` != @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/h.aql b/spec/regression/logistics/tests/flexsearch-not/aql/h.aql new file mode 100644 index 000000000..992c857d8 --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/h.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH (v_delivery2.`processingFinished` != @var1) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/i.aql b/spec/regression/logistics/tests/flexsearch-not/aql/i.aql new file mode 100644 index 000000000..c2ca6453d --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/i.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH !(ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 )) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/j.aql b/spec/regression/logistics/tests/flexsearch-not/aql/j.aql new file mode 100644 index 000000000..c2ca6453d --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/j.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH !(ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 )) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not/aql/k.aql b/spec/regression/logistics/tests/flexsearch-not/aql/k.aql new file mode 100644 index 000000000..c2ca6453d --- /dev/null +++ b/spec/regression/logistics/tests/flexsearch-not/aql/k.aql @@ -0,0 +1,15 @@ +RETURN { + "flexSearchDeliveries": ( + FOR v_delivery1 + IN ( + FOR v_delivery2 + IN @@flex_view_deliveries + SEARCH !(ANALYZER( v_delivery2.`deliveryNumber` IN ( FOR v_token1 IN TOKENS(@var1 , @var2) RETURN v_token1[0] ), @var3 )) + RETURN v_delivery2 + ) + SORT (v_delivery1.`deliveryNumber`) , (v_delivery1.`createdAt`) DESC, (v_delivery1._key) DESC + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/flexsearch-not.result.json b/spec/regression/logistics/tests/flexsearch-not/result.json similarity index 100% rename from spec/regression/logistics/tests/flexsearch-not.result.json rename to spec/regression/logistics/tests/flexsearch-not/result.json diff --git a/spec/regression/logistics/tests/flexsearch-not.graphql b/spec/regression/logistics/tests/flexsearch-not/test.graphql similarity index 99% rename from spec/regression/logistics/tests/flexsearch-not.graphql rename to spec/regression/logistics/tests/flexsearch-not/test.graphql index 943412944..709d6acd5 100644 --- a/spec/regression/logistics/tests/flexsearch-not.graphql +++ b/spec/regression/logistics/tests/flexsearch-not/test.graphql @@ -55,4 +55,4 @@ query k { flexSearchDeliveries(flexSearchFilter: { deliveryNumber_not_in: ["D1"] }) { deliveryNumber } -} \ No newline at end of file +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-many/aql/toManyRelation.aql b/spec/regression/logistics/tests/inline-mutation-to-many/aql/toManyRelation.aql new file mode 100644 index 000000000..f72d592bd --- /dev/null +++ b/spec/regression/logistics/tests/inline-mutation-to-many/aql/toManyRelation.aql @@ -0,0 +1,133 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, @v_newEntityId1), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, @v_newEntityId1), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])}, {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, (@v_newEntityIds1)[@var6])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "createDelivery": @v_createDelivery1, + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-many.result.json b/spec/regression/logistics/tests/inline-mutation-to-many/result.json similarity index 100% rename from spec/regression/logistics/tests/inline-mutation-to-many.result.json rename to spec/regression/logistics/tests/inline-mutation-to-many/result.json diff --git a/spec/regression/logistics/tests/inline-mutation-to-many.graphql b/spec/regression/logistics/tests/inline-mutation-to-many/test.graphql similarity index 100% rename from spec/regression/logistics/tests/inline-mutation-to-many.graphql rename to spec/regression/logistics/tests/inline-mutation-to-many/test.graphql diff --git a/spec/regression/logistics/tests/inline-mutation-to-one/aql/checkOldGotRemoved.aql b/spec/regression/logistics/tests/inline-mutation-to-one/aql/checkOldGotRemoved.aql new file mode 100644 index 000000000..edaab7867 --- /dev/null +++ b/spec/regression/logistics/tests/inline-mutation-to-one/aql/checkOldGotRemoved.aql @@ -0,0 +1,35 @@ +WITH @@deliveries +RETURN { + "old": ( + FOR v_forwarder1 + IN @@forwarders + FILTER (v_forwarder1.`name` == @var1) + RETURN { + "name": v_forwarder1.`name`, + "deliveries": ( + FOR v_delivery1 + IN INBOUND v_forwarder1 @@deliveries_forwarder + FILTER v_delivery1._key != null + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) + } + ), + "new": ( + FOR v_forwarder2 + IN @@forwarders + FILTER (v_forwarder2.`name` == @var2) + RETURN { + "name": v_forwarder2.`name`, + "deliveries": ( + FOR v_delivery2 + IN INBOUND v_forwarder2 @@deliveries_forwarder + FILTER v_delivery2._key != null + RETURN { + "deliveryNumber": v_delivery2.`deliveryNumber` + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-one/aql/createWithNestedToOne.aql b/spec/regression/logistics/tests/inline-mutation-to-one/aql/createWithNestedToOne.aql new file mode 100644 index 000000000..1f1f31834 --- /dev/null +++ b/spec/regression/logistics/tests/inline-mutation-to-one/aql/createWithNestedToOne.aql @@ -0,0 +1,72 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@forwarders + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + UPSERT {_from: CONCAT(@var1, @v_newEntityId1)} + INSERT {_from: CONCAT(@var2, @v_newEntityId1), _to: CONCAT(@var3, @v_newEntityId2)} + UPDATE {_from: CONCAT(@var4, @v_newEntityId1), _to: CONCAT(@var5, @v_newEntityId2)} + IN @@deliveries_forwarder +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +LET v_forwarder1 = FIRST(( + FOR v_node1 + IN OUTBOUND v_delivery1 @@deliveries_forwarder + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN (IS_NULL(v_delivery1) ? null : { + "forwarder": (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` + }) +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNestedToOne.aql b/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNestedToOne.aql new file mode 100644 index 000000000..5748eb47d --- /dev/null +++ b/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNestedToOne.aql @@ -0,0 +1,54 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@forwarders + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: CONCAT(@var3, @v_newEntityId1)} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, @v_newEntityId1)} + IN @@deliveries_forwarder +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +LET v_forwarder1 = FIRST(( + FOR v_node1 + IN OUTBOUND v_delivery1 @@deliveries_forwarder + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN (IS_NULL(v_delivery1) ? null : { + "forwarder": (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` + }) +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNewNestedToOne.aql b/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNewNestedToOne.aql new file mode 100644 index 000000000..5748eb47d --- /dev/null +++ b/spec/regression/logistics/tests/inline-mutation-to-one/aql/updateWithNewNestedToOne.aql @@ -0,0 +1,54 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN FIRST( + INSERT @var1 IN @@forwarders + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: CONCAT(@var3, @v_newEntityId1)} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: CONCAT(@var5, @v_newEntityId1)} + IN @@deliveries_forwarder +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +LET v_forwarder1 = FIRST(( + FOR v_node1 + IN OUTBOUND v_delivery1 @@deliveries_forwarder + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN (IS_NULL(v_delivery1) ? null : { + "forwarder": (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` + }) +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/inline-mutation-to-one.context.json b/spec/regression/logistics/tests/inline-mutation-to-one/context.json similarity index 100% rename from spec/regression/logistics/tests/inline-mutation-to-one.context.json rename to spec/regression/logistics/tests/inline-mutation-to-one/context.json diff --git a/spec/regression/logistics/tests/inline-mutation-to-one.result.json b/spec/regression/logistics/tests/inline-mutation-to-one/result.json similarity index 100% rename from spec/regression/logistics/tests/inline-mutation-to-one.result.json rename to spec/regression/logistics/tests/inline-mutation-to-one/result.json diff --git a/spec/regression/logistics/tests/inline-mutation-to-one.graphql b/spec/regression/logistics/tests/inline-mutation-to-one/test.graphql similarity index 100% rename from spec/regression/logistics/tests/inline-mutation-to-one.graphql rename to spec/regression/logistics/tests/inline-mutation-to-one/test.graphql diff --git a/spec/regression/logistics/tests/internal-graphql-fields.result.json b/spec/regression/logistics/tests/internal-graphql-fields.result.json deleted file mode 100644 index b6693ff54..000000000 --- a/spec/regression/logistics/tests/internal-graphql-fields.result.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "__type": { - "name": "Delivery" - }, - "__typename": "Query", - "Delivery": { - "deliveryNumber": "1000173", - "__typename": "Delivery" - } - } -} diff --git a/spec/regression/logistics/tests/internal-graphql-fields/aql/typename.aql b/spec/regression/logistics/tests/internal-graphql-fields/aql/typename.aql new file mode 100644 index 000000000..3800104cc --- /dev/null +++ b/spec/regression/logistics/tests/internal-graphql-fields/aql/typename.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/internal-graphql-fields/result.json b/spec/regression/logistics/tests/internal-graphql-fields/result.json new file mode 100644 index 000000000..ee8512b2b --- /dev/null +++ b/spec/regression/logistics/tests/internal-graphql-fields/result.json @@ -0,0 +1,18 @@ +{ + "introspection": { + "data": { + "__type": { + "name": "Delivery" + } + } + }, + "typename": { + "data": { + "__typename": "Query", + "Delivery": { + "deliveryNumber": "1000173", + "__typename": "Delivery" + } + } + } +} diff --git a/spec/regression/logistics/tests/internal-graphql-fields.graphql b/spec/regression/logistics/tests/internal-graphql-fields/test.graphql similarity index 59% rename from spec/regression/logistics/tests/internal-graphql-fields.graphql rename to spec/regression/logistics/tests/internal-graphql-fields/test.graphql index a09c54967..1f6ea7287 100644 --- a/spec/regression/logistics/tests/internal-graphql-fields.graphql +++ b/spec/regression/logistics/tests/internal-graphql-fields/test.graphql @@ -1,10 +1,12 @@ -{ - # these fields should be ignored and handled by the graphql engine +# these fields should be ignored and handled by the graphql engine +query introspection { __type(name: "Delivery") { name } +} +query typename { __typename Delivery(id: "@{ids/Delivery/1}") { diff --git a/spec/regression/logistics/tests/multi-mutation.result.json b/spec/regression/logistics/tests/multi-mutation.result.json deleted file mode 100644 index ca03cb285..000000000 --- a/spec/regression/logistics/tests/multi-mutation.result.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "update1": { - "deliveryNumber": "123" - }, - "update2": { - "deliveryNumber": "456" - } - } -} diff --git a/spec/regression/logistics/tests/multi-mutation/aql/multiMutation.aql b/spec/regression/logistics/tests/multi-mutation/aql/multiMutation.aql new file mode 100644 index 000000000..3ec3af8d3 --- /dev/null +++ b/spec/regression/logistics/tests/multi-mutation/aql/multiMutation.aql @@ -0,0 +1,122 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "update1": @v_updateDelivery1, + "update2": @v_updateDelivery2 +} diff --git a/spec/regression/logistics/tests/multi-mutation/result.json b/spec/regression/logistics/tests/multi-mutation/result.json new file mode 100644 index 000000000..86aea9027 --- /dev/null +++ b/spec/regression/logistics/tests/multi-mutation/result.json @@ -0,0 +1,12 @@ +{ + "multiMutation": { + "data": { + "update1": { + "deliveryNumber": "123" + }, + "update2": { + "deliveryNumber": "456" + } + } + } +} diff --git a/spec/regression/logistics/tests/multi-mutation.graphql b/spec/regression/logistics/tests/multi-mutation/test.graphql similarity index 90% rename from spec/regression/logistics/tests/multi-mutation.graphql rename to spec/regression/logistics/tests/multi-mutation/test.graphql index bb3dec8ba..a148f4829 100644 --- a/spec/regression/logistics/tests/multi-mutation.graphql +++ b/spec/regression/logistics/tests/multi-mutation/test.graphql @@ -1,4 +1,4 @@ -mutation { +mutation multiMutation { update1: updateDelivery(input: { id: "@{ids/Delivery/1}", deliveryNumber: "123" }) { deliveryNumber } diff --git a/spec/regression/logistics/tests/number-range/aql/firstIncrement.aql b/spec/regression/logistics/tests/number-range/aql/firstIncrement.aql new file mode 100644 index 000000000..fa076e983 --- /dev/null +++ b/spec/regression/logistics/tests/number-range/aql/firstIncrement.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_numberRange1 + IN @@numberRanges + FILTER (v_numberRange1._key == @var1) + LIMIT @var2 + RETURN v_numberRange1 + ) + UPDATE v_currentEntity1 + WITH { + "number": (v_currentEntity1.`number` + @var3), + "updatedAt": @var4 + } + IN @@numberRanges + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@numberRanges +LET v_numberRange1 = DOCUMENT(@@numberRanges, @var1) +RETURN (IS_NULL(v_numberRange1) ? null : { + "number": v_numberRange1.`number` +}) + +// -------------------------------- + +WITH @@numberRanges +RETURN { + "updateNumberRange": @v_updateNumberRange1 +} diff --git a/spec/regression/logistics/tests/number-range/aql/secondIncrement.aql b/spec/regression/logistics/tests/number-range/aql/secondIncrement.aql new file mode 100644 index 000000000..fa076e983 --- /dev/null +++ b/spec/regression/logistics/tests/number-range/aql/secondIncrement.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_numberRange1 + IN @@numberRanges + FILTER (v_numberRange1._key == @var1) + LIMIT @var2 + RETURN v_numberRange1 + ) + UPDATE v_currentEntity1 + WITH { + "number": (v_currentEntity1.`number` + @var3), + "updatedAt": @var4 + } + IN @@numberRanges + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@numberRanges +LET v_numberRange1 = DOCUMENT(@@numberRanges, @var1) +RETURN (IS_NULL(v_numberRange1) ? null : { + "number": v_numberRange1.`number` +}) + +// -------------------------------- + +WITH @@numberRanges +RETURN { + "updateNumberRange": @v_updateNumberRange1 +} diff --git a/spec/regression/logistics/tests/number-range.result.json b/spec/regression/logistics/tests/number-range/result.json similarity index 100% rename from spec/regression/logistics/tests/number-range.result.json rename to spec/regression/logistics/tests/number-range/result.json diff --git a/spec/regression/logistics/tests/number-range.graphql b/spec/regression/logistics/tests/number-range/test.graphql similarity index 100% rename from spec/regression/logistics/tests/number-range.graphql rename to spec/regression/logistics/tests/number-range/test.graphql diff --git a/spec/regression/logistics/tests/offset-date-time/aql/after.aql b/spec/regression/logistics/tests/offset-date-time/aql/after.aql new file mode 100644 index 000000000..af59c19ee --- /dev/null +++ b/spec/regression/logistics/tests/offset-date-time/aql/after.aql @@ -0,0 +1,38 @@ +RETURN { + "asc": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`dispatchDate`.`timestamp`) , (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "dispatchDate": v_delivery1.`dispatchDate` + } + ), + "desc": ( + FOR v_delivery2 + IN @@deliveries + SORT (v_delivery2.`dispatchDate`.`timestamp`) DESC, (v_delivery2.`deliveryNumber`) DESC + RETURN { + "deliveryNumber": v_delivery2.`deliveryNumber`, + "dispatchDate": v_delivery2.`dispatchDate` + } + ), + "eq1": ( + FOR v_delivery3 + IN @@deliveries + FILTER (v_delivery3.`dispatchDate`.`timestamp` == @var1) + RETURN { + "deliveryNumber": v_delivery3.`deliveryNumber`, + "dispatchDate": v_delivery3.`dispatchDate` + } + ), + "eq2": ( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4.`dispatchDate`.`timestamp` == @var2) + RETURN { + "deliveryNumber": v_delivery4.`deliveryNumber`, + "dispatchDate": v_delivery4.`dispatchDate` + } + ) +} diff --git a/spec/regression/logistics/tests/offset-date-time/aql/before.aql b/spec/regression/logistics/tests/offset-date-time/aql/before.aql new file mode 100644 index 000000000..a7a26c2e2 --- /dev/null +++ b/spec/regression/logistics/tests/offset-date-time/aql/before.aql @@ -0,0 +1,11 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`dispatchDate`.`timestamp`) , (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "dispatchDate": v_delivery1.`dispatchDate` + } + ) +} diff --git a/spec/regression/logistics/tests/offset-date-time/aql/set.aql b/spec/regression/logistics/tests/offset-date-time/aql/set.aql new file mode 100644 index 000000000..2f3e60286 --- /dev/null +++ b/spec/regression/logistics/tests/offset-date-time/aql/set.aql @@ -0,0 +1,141 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "dispatchDate": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dispatchDate": v_delivery1.`dispatchDate` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "dispatchDate": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dispatchDate": v_delivery1.`dispatchDate` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "dispatchDate": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dispatchDate": v_delivery1.`dispatchDate` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "dispatchDate": v_delivery1.`dispatchDate` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "d1": @v_updateDelivery1, + "d2": @v_updateDelivery2, + "d3": @v_updateDelivery3, + "d4": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/offset-date-time.result.json b/spec/regression/logistics/tests/offset-date-time/result.json similarity index 100% rename from spec/regression/logistics/tests/offset-date-time.result.json rename to spec/regression/logistics/tests/offset-date-time/result.json diff --git a/spec/regression/logistics/tests/offset-date-time.graphql b/spec/regression/logistics/tests/offset-date-time/test.graphql similarity index 100% rename from spec/regression/logistics/tests/offset-date-time.graphql rename to spec/regression/logistics/tests/offset-date-time/test.graphql diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql new file mode 100644 index 000000000..edd8c03b2 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql @@ -0,0 +1,35 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) , (v_handlingUnit1._key) + LIMIT @var1 + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }), + @var2: JSON_STRINGIFY({ + "delivery_deliveryNumber": FIRST(( + FOR v_node3 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node3._key != null + RETURN v_node3 + )).`deliveryNumber`, + "id": v_handlingUnit1._key + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql new file mode 100644 index 000000000..4976c0179 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql @@ -0,0 +1,69 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN UNION(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit2 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber` > @var1) + SORT (FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit2 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )).`deliveryNumber`) , (v_handlingUnit2._key) + LIMIT @var2 + RETURN v_handlingUnit2 + ), ( + FOR v_handlingUnit3 + IN @@handlingUnits + FILTER ((FIRST(( + FOR v_node3 + IN INBOUND v_handlingUnit3 @@deliveries_handlingUnits + FILTER v_node3._key != null + RETURN v_node3 + )).`deliveryNumber` == @var3) && (v_handlingUnit3._key > @var4)) + SORT (FIRST(( + FOR v_node4 + IN INBOUND v_handlingUnit3 @@deliveries_handlingUnits + FILTER v_node4._key != null + RETURN v_node4 + )).`deliveryNumber`) , (v_handlingUnit3._key) + LIMIT @var5 + RETURN v_handlingUnit3 + )) + SORT (FIRST(( + FOR v_node5 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node5._key != null + RETURN v_node5 + )).`deliveryNumber`) , (v_handlingUnit1._key) + LIMIT @var6 + LET v_delivery1 = FIRST(( + FOR v_node6 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node6._key != null + RETURN v_node6 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }), + @var7: JSON_STRINGIFY({ + "delivery_deliveryNumber": FIRST(( + FOR v_node7 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node7._key != null + RETURN v_node7 + )).`deliveryNumber`, + "id": v_handlingUnit1._key + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination.result.json b/spec/regression/logistics/tests/order-by-relation-with-pagination/result.json similarity index 100% rename from spec/regression/logistics/tests/order-by-relation-with-pagination.result.json rename to spec/regression/logistics/tests/order-by-relation-with-pagination/result.json diff --git a/spec/regression/logistics/tests/order-by-relation-with-pagination.graphql b/spec/regression/logistics/tests/order-by-relation-with-pagination/test.graphql similarity index 100% rename from spec/regression/logistics/tests/order-by-relation-with-pagination.graphql rename to spec/regression/logistics/tests/order-by-relation-with-pagination/test.graphql diff --git a/spec/regression/logistics/tests/order-by-relation/aql/addRelation1.aql b/spec/regression/logistics/tests/order-by-relation/aql/addRelation1.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/addRelation1.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/order-by-relation/aql/addRelation2.aql b/spec/regression/logistics/tests/order-by-relation/aql/addRelation2.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/addRelation2.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/order-by-relation/aql/asc.aql b/spec/regression/logistics/tests/order-by-relation/aql/asc.aql new file mode 100644 index 000000000..db8f76725 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/asc.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation/aql/desc.aql b/spec/regression/logistics/tests/order-by-relation/aql/desc.aql new file mode 100644 index 000000000..cff4625bb --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/desc.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) DESC + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql b/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql new file mode 100644 index 000000000..0da200be7 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql @@ -0,0 +1,27 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`consignee`.`street`) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "street": v_delivery1.`consignee`.`street` + }) + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql b/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql new file mode 100644 index 000000000..c6edbcdb4 --- /dev/null +++ b/spec/regression/logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql @@ -0,0 +1,27 @@ +WITH @@deliveries +RETURN { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`consignee`.`street`) DESC + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "street": v_delivery1.`consignee`.`street` + }) + }) + } + ) +} diff --git a/spec/regression/logistics/tests/order-by-relation.result.json b/spec/regression/logistics/tests/order-by-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/order-by-relation.result.json rename to spec/regression/logistics/tests/order-by-relation/result.json diff --git a/spec/regression/logistics/tests/order-by-relation.graphql b/spec/regression/logistics/tests/order-by-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/order-by-relation.graphql rename to spec/regression/logistics/tests/order-by-relation/test.graphql diff --git a/spec/regression/logistics/tests/permissions-creator/aql/create.aql b/spec/regression/logistics/tests/permissions-creator/aql/create.aql new file mode 100644 index 000000000..32dd4868d --- /dev/null +++ b/spec/regression/logistics/tests/permissions-creator/aql/create.aql @@ -0,0 +1,48 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/permissions-creator/aql/delete.aql b/spec/regression/logistics/tests/permissions-creator/aql/delete.aql new file mode 100644 index 000000000..911a75ca0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-creator/aql/delete.aql @@ -0,0 +1,3 @@ +RETURN { + "deleteDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-creator/aql/list.aql b/spec/regression/logistics/tests/permissions-creator/aql/list.aql new file mode 100644 index 000000000..9ecdc67f0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-creator/aql/list.aql @@ -0,0 +1,10 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/permissions-creator/aql/update.aql b/spec/regression/logistics/tests/permissions-creator/aql/update.aql new file mode 100644 index 000000000..25076bdb0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-creator/aql/update.aql @@ -0,0 +1,3 @@ +RETURN { + "updateDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-creator.context.json b/spec/regression/logistics/tests/permissions-creator/context.json similarity index 100% rename from spec/regression/logistics/tests/permissions-creator.context.json rename to spec/regression/logistics/tests/permissions-creator/context.json diff --git a/spec/regression/logistics/tests/permissions-creator.result.json b/spec/regression/logistics/tests/permissions-creator/result.json similarity index 100% rename from spec/regression/logistics/tests/permissions-creator.result.json rename to spec/regression/logistics/tests/permissions-creator/result.json diff --git a/spec/regression/logistics/tests/permissions-creator.graphql b/spec/regression/logistics/tests/permissions-creator/test.graphql similarity index 100% rename from spec/regression/logistics/tests/permissions-creator.graphql rename to spec/regression/logistics/tests/permissions-creator/test.graphql diff --git a/spec/regression/logistics/tests/permissions-deleter/aql/create.aql b/spec/regression/logistics/tests/permissions-deleter/aql/create.aql new file mode 100644 index 000000000..269e27942 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-deleter/aql/create.aql @@ -0,0 +1,3 @@ +RETURN { + "createDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-deleter/aql/delete.aql b/spec/regression/logistics/tests/permissions-deleter/aql/delete.aql new file mode 100644 index 000000000..8d17e6af6 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-deleter/aql/delete.aql @@ -0,0 +1,53 @@ +RETURN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@onlyRelations_deliveries + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@onlyRelations_deliveries +) + +// -------------------------------- + +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @v_ids1 + REMOVE v_delivery2 + IN @@deliveries + RETURN OLD +)) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +RETURN { + "deleteDelivery": @v_deleteDelivery1 +} diff --git a/spec/regression/logistics/tests/permissions-deleter/aql/list.aql b/spec/regression/logistics/tests/permissions-deleter/aql/list.aql new file mode 100644 index 000000000..9ecdc67f0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-deleter/aql/list.aql @@ -0,0 +1,10 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/permissions-deleter/aql/update.aql b/spec/regression/logistics/tests/permissions-deleter/aql/update.aql new file mode 100644 index 000000000..25076bdb0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-deleter/aql/update.aql @@ -0,0 +1,3 @@ +RETURN { + "updateDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-deleter.context.json b/spec/regression/logistics/tests/permissions-deleter/context.json similarity index 100% rename from spec/regression/logistics/tests/permissions-deleter.context.json rename to spec/regression/logistics/tests/permissions-deleter/context.json diff --git a/spec/regression/logistics/tests/permissions-deleter.result.json b/spec/regression/logistics/tests/permissions-deleter/result.json similarity index 100% rename from spec/regression/logistics/tests/permissions-deleter.result.json rename to spec/regression/logistics/tests/permissions-deleter/result.json diff --git a/spec/regression/logistics/tests/permissions-deleter.graphql b/spec/regression/logistics/tests/permissions-deleter/test.graphql similarity index 100% rename from spec/regression/logistics/tests/permissions-deleter.graphql rename to spec/regression/logistics/tests/permissions-deleter/test.graphql diff --git a/spec/regression/logistics/tests/permissions-updater/aql/create.aql b/spec/regression/logistics/tests/permissions-updater/aql/create.aql new file mode 100644 index 000000000..269e27942 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-updater/aql/create.aql @@ -0,0 +1,3 @@ +RETURN { + "createDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-updater/aql/delete.aql b/spec/regression/logistics/tests/permissions-updater/aql/delete.aql new file mode 100644 index 000000000..911a75ca0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-updater/aql/delete.aql @@ -0,0 +1,3 @@ +RETURN { + "deleteDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/logistics/tests/permissions-updater/aql/list.aql b/spec/regression/logistics/tests/permissions-updater/aql/list.aql new file mode 100644 index 000000000..9ecdc67f0 --- /dev/null +++ b/spec/regression/logistics/tests/permissions-updater/aql/list.aql @@ -0,0 +1,10 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ) +} diff --git a/spec/regression/logistics/tests/permissions-updater/aql/update.aql b/spec/regression/logistics/tests/permissions-updater/aql/update.aql new file mode 100644 index 000000000..6714b0cec --- /dev/null +++ b/spec/regression/logistics/tests/permissions-updater/aql/update.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/permissions-updater.context.json b/spec/regression/logistics/tests/permissions-updater/context.json similarity index 100% rename from spec/regression/logistics/tests/permissions-updater.context.json rename to spec/regression/logistics/tests/permissions-updater/context.json diff --git a/spec/regression/logistics/tests/permissions-updater.result.json b/spec/regression/logistics/tests/permissions-updater/result.json similarity index 100% rename from spec/regression/logistics/tests/permissions-updater.result.json rename to spec/regression/logistics/tests/permissions-updater/result.json diff --git a/spec/regression/logistics/tests/permissions-updater.graphql b/spec/regression/logistics/tests/permissions-updater/test.graphql similarity index 100% rename from spec/regression/logistics/tests/permissions-updater.graphql rename to spec/regression/logistics/tests/permissions-updater/test.graphql diff --git a/spec/regression/logistics/tests/query-all.result.json b/spec/regression/logistics/tests/query-all.result.json deleted file mode 100644 index cb52c4e60..000000000 --- a/spec/regression/logistics/tests/query-all.result.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "data": { - "allCountries": [ - { - "id": "@{ids/Country/4}", - "isoCode": "CH", - "description": [ - { - "languageIsoCode": "DE", - "translation": "Schweiz" - }, - { - "languageIsoCode": "EN", - "translation": "Switzerland" - } - ] - }, - { - "id": "@{ids/Country/1}", - "isoCode": "DE", - "description": [ - { - "languageIsoCode": "DE", - "translation": "Deutschland" - }, - { - "languageIsoCode": "EN", - "translation": "Germany" - } - ] - }, - { - "id": "@{ids/Country/2}", - "isoCode": "GB", - "description": [ - { - "languageIsoCode": "DE", - "translation": "Vereinigtes Königreich" - }, - { - "languageIsoCode": "EN", - "translation": "United Kingdom" - } - ] - }, - { - "id": "@{ids/Country/3}", - "isoCode": "US", - "description": [ - { - "languageIsoCode": "DE", - "translation": "Vereinigte Staaten" - }, - { - "languageIsoCode": "EN", - "translation": "United States" - } - ] - } - ] - } -} diff --git a/spec/regression/logistics/tests/query-all/aql/allCountries.aql b/spec/regression/logistics/tests/query-all/aql/allCountries.aql new file mode 100644 index 000000000..3e57e953c --- /dev/null +++ b/spec/regression/logistics/tests/query-all/aql/allCountries.aql @@ -0,0 +1,19 @@ +RETURN { + "allCountries": ( + FOR v_country1 + IN @@countries + SORT (v_country1.`isoCode`) + RETURN { + "id": v_country1._key, + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + } + ) +} diff --git a/spec/regression/namespaced_logistics/tests/query-all.result.json b/spec/regression/logistics/tests/query-all/result.json similarity index 85% rename from spec/regression/namespaced_logistics/tests/query-all.result.json rename to spec/regression/logistics/tests/query-all/result.json index 294252db3..c1afb8225 100644 --- a/spec/regression/namespaced_logistics/tests/query-all.result.json +++ b/spec/regression/logistics/tests/query-all/result.json @@ -1,9 +1,9 @@ { - "data": { - "foundation": { + "allCountries": { + "data": { "allCountries": [ { - "id": "@{ids/foundation.Country/4}", + "id": "@{ids/Country/4}", "isoCode": "CH", "description": [ { @@ -17,7 +17,7 @@ ] }, { - "id": "@{ids/foundation.Country/1}", + "id": "@{ids/Country/1}", "isoCode": "DE", "description": [ { @@ -31,7 +31,7 @@ ] }, { - "id": "@{ids/foundation.Country/2}", + "id": "@{ids/Country/2}", "isoCode": "GB", "description": [ { @@ -45,7 +45,7 @@ ] }, { - "id": "@{ids/foundation.Country/3}", + "id": "@{ids/Country/3}", "isoCode": "US", "description": [ { diff --git a/spec/regression/logistics/tests/query-all.graphql b/spec/regression/logistics/tests/query-all/test.graphql similarity index 88% rename from spec/regression/logistics/tests/query-all.graphql rename to spec/regression/logistics/tests/query-all/test.graphql index d6de64858..3d007f623 100644 --- a/spec/regression/logistics/tests/query-all.graphql +++ b/spec/regression/logistics/tests/query-all/test.graphql @@ -1,4 +1,4 @@ -{ +query allCountries { allCountries(orderBy: isoCode_ASC) { id isoCode diff --git a/spec/regression/logistics/tests/query-single/aql/byID.aql b/spec/regression/logistics/tests/query-single/aql/byID.aql new file mode 100644 index 000000000..3800104cc --- /dev/null +++ b/spec/regression/logistics/tests/query-single/aql/byID.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/query-single/aql/byKey.aql b/spec/regression/logistics/tests/query-single/aql/byKey.aql new file mode 100644 index 000000000..b86d4e685 --- /dev/null +++ b/spec/regression/logistics/tests/query-single/aql/byKey.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/query-single/aql/emptyArg.aql b/spec/regression/logistics/tests/query-single/aql/emptyArg.aql new file mode 100644 index 000000000..3800104cc --- /dev/null +++ b/spec/regression/logistics/tests/query-single/aql/emptyArg.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/query-single/aql/notFound.aql b/spec/regression/logistics/tests/query-single/aql/notFound.aql new file mode 100644 index 000000000..b86d4e685 --- /dev/null +++ b/spec/regression/logistics/tests/query-single/aql/notFound.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/query-single/aql/nullAndNonNullArg.aql b/spec/regression/logistics/tests/query-single/aql/nullAndNonNullArg.aql new file mode 100644 index 000000000..b86d4e685 --- /dev/null +++ b/spec/regression/logistics/tests/query-single/aql/nullAndNonNullArg.aql @@ -0,0 +1,12 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2.`deliveryNumber` == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) +} diff --git a/spec/regression/logistics/tests/query-single.result.json b/spec/regression/logistics/tests/query-single/result.json similarity index 100% rename from spec/regression/logistics/tests/query-single.result.json rename to spec/regression/logistics/tests/query-single/result.json diff --git a/spec/regression/logistics/tests/query-single.graphql b/spec/regression/logistics/tests/query-single/test.graphql similarity index 100% rename from spec/regression/logistics/tests/query-single.graphql rename to spec/regression/logistics/tests/query-single/test.graphql diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/createWithKeyField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithKeyField.aql new file mode 100644 index 000000000..f7270ca4e --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithKeyField.aql @@ -0,0 +1,19 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/createWithReferenceField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithReferenceField.aql new file mode 100644 index 000000000..f7270ca4e --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithReferenceField.aql @@ -0,0 +1,19 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/createWithSingleField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithSingleField.aql new file mode 100644 index 000000000..686c4b60c --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/createWithSingleField.aql @@ -0,0 +1,28 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +LET v_country1 = (IS_NULL(v_delivery1.`originCountry`) ? null : FIRST(( + FOR v_originCountry1 + IN @@countries + FILTER ((v_originCountry1.`isoCode` > NULL) && (v_originCountry1.`isoCode` == v_delivery1.`originCountry`)) + LIMIT @var1 + RETURN v_originCountry1 +))) +RETURN (IS_NULL(v_delivery1) ? null : { + "originCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithKeyField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithKeyField.aql new file mode 100644 index 000000000..193f4ed93 --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithKeyField.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "destinationCountryISOCode": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithReferenceField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithReferenceField.aql new file mode 100644 index 000000000..193f4ed93 --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithReferenceField.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "destinationCountryISOCode": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithSingleField.aql b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithSingleField.aql new file mode 100644 index 000000000..763ffe519 --- /dev/null +++ b/spec/regression/logistics/tests/reference-create-and-update/aql/updateWithSingleField.aql @@ -0,0 +1,42 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "originCountry": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +LET v_country1 = (IS_NULL(v_delivery1.`originCountry`) ? null : FIRST(( + FOR v_originCountry1 + IN @@countries + FILTER ((v_originCountry1.`isoCode` > NULL) && (v_originCountry1.`isoCode` == v_delivery1.`originCountry`)) + LIMIT @var2 + RETURN v_originCountry1 +))) +RETURN (IS_NULL(v_delivery1) ? null : { + "originCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/reference-create-and-update.result.json b/spec/regression/logistics/tests/reference-create-and-update/result.json similarity index 100% rename from spec/regression/logistics/tests/reference-create-and-update.result.json rename to spec/regression/logistics/tests/reference-create-and-update/result.json diff --git a/spec/regression/logistics/tests/reference-create-and-update.graphql b/spec/regression/logistics/tests/reference-create-and-update/test.graphql similarity index 100% rename from spec/regression/logistics/tests/reference-create-and-update.graphql rename to spec/regression/logistics/tests/reference-create-and-update/test.graphql diff --git a/spec/regression/logistics/tests/reference-filter/aql/filterKeyField.aql b/spec/regression/logistics/tests/reference-filter/aql/filterKeyField.aql new file mode 100644 index 000000000..0fb712bf6 --- /dev/null +++ b/spec/regression/logistics/tests/reference-filter/aql/filterKeyField.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`destinationCountryISOCode` == @var1) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var2 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-filter/aql/filterKeyFieldMissingReference.aql b/spec/regression/logistics/tests/reference-filter/aql/filterKeyFieldMissingReference.aql new file mode 100644 index 000000000..0fb712bf6 --- /dev/null +++ b/spec/regression/logistics/tests/reference-filter/aql/filterKeyFieldMissingReference.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`destinationCountryISOCode` == @var1) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var2 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-filter/aql/filterMissingReference.aql b/spec/regression/logistics/tests/reference-filter/aql/filterMissingReference.aql new file mode 100644 index 000000000..faec75bdb --- /dev/null +++ b/spec/regression/logistics/tests/reference-filter/aql/filterMissingReference.aql @@ -0,0 +1,27 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var1 + RETURN v_destinationCountry1 + ))).`isoCode` == @var2) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry2 + IN @@countries + FILTER ((v_destinationCountry2.`isoCode` > NULL) && (v_destinationCountry2.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var3 + RETURN v_destinationCountry2 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-filter/aql/filterReference.aql b/spec/regression/logistics/tests/reference-filter/aql/filterReference.aql new file mode 100644 index 000000000..faec75bdb --- /dev/null +++ b/spec/regression/logistics/tests/reference-filter/aql/filterReference.aql @@ -0,0 +1,27 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var1 + RETURN v_destinationCountry1 + ))).`isoCode` == @var2) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry2 + IN @@countries + FILTER ((v_destinationCountry2.`isoCode` > NULL) && (v_destinationCountry2.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var3 + RETURN v_destinationCountry2 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-filter.result.json b/spec/regression/logistics/tests/reference-filter/result.json similarity index 100% rename from spec/regression/logistics/tests/reference-filter.result.json rename to spec/regression/logistics/tests/reference-filter/result.json diff --git a/spec/regression/logistics/tests/reference-filter.graphql b/spec/regression/logistics/tests/reference-filter/test.graphql similarity index 100% rename from spec/regression/logistics/tests/reference-filter.graphql rename to spec/regression/logistics/tests/reference-filter/test.graphql diff --git a/spec/regression/logistics/tests/reference-sort/aql/orderByKeyField.aql b/spec/regression/logistics/tests/reference-sort/aql/orderByKeyField.aql new file mode 100644 index 000000000..4808bbcbd --- /dev/null +++ b/spec/regression/logistics/tests/reference-sort/aql/orderByKeyField.aql @@ -0,0 +1,21 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`destinationCountryISOCode`) , (v_delivery1.`deliveryNumber`) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var1 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-sort/aql/orderByReferenceField.aql b/spec/regression/logistics/tests/reference-sort/aql/orderByReferenceField.aql new file mode 100644 index 000000000..062abf2b8 --- /dev/null +++ b/spec/regression/logistics/tests/reference-sort/aql/orderByReferenceField.aql @@ -0,0 +1,27 @@ +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT ((IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var1 + RETURN v_destinationCountry1 + ))).`isoCode`) , (v_delivery1.`deliveryNumber`) + LET v_country1 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry2 + IN @@countries + FILTER ((v_destinationCountry2.`isoCode` > NULL) && (v_destinationCountry2.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var2 + RETURN v_destinationCountry2 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "destinationCountryISOCode": v_delivery1.`destinationCountryISOCode`, + "destinationCountry": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` + }) + } + ) +} diff --git a/spec/regression/logistics/tests/reference-sort.result.json b/spec/regression/logistics/tests/reference-sort/result.json similarity index 100% rename from spec/regression/logistics/tests/reference-sort.result.json rename to spec/regression/logistics/tests/reference-sort/result.json diff --git a/spec/regression/logistics/tests/reference-sort.graphql b/spec/regression/logistics/tests/reference-sort/test.graphql similarity index 100% rename from spec/regression/logistics/tests/reference-sort.graphql rename to spec/regression/logistics/tests/reference-sort/test.graphql diff --git a/spec/regression/logistics/tests/reference-to-id/aql/referenceToExistingID.aql b/spec/regression/logistics/tests/reference-to-id/aql/referenceToExistingID.aql new file mode 100644 index 000000000..f534a0d7f --- /dev/null +++ b/spec/regression/logistics/tests/reference-to-id/aql/referenceToExistingID.aql @@ -0,0 +1,30 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + LET v_handlingUnit1 = (IS_NULL(v_deliveryItem1.`handlingUnit`) ? null : FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER ((v_handlingUnit2._key > NULL) && (v_handlingUnit2._key == v_deliveryItem1.`handlingUnit`)) + LIMIT @var3 + RETURN v_handlingUnit2 + ))) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber`, + "handlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "id": v_handlingUnit1._key, + "huNumber": v_handlingUnit1.`huNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/reference-to-id/aql/referenceToWrongID.aql b/spec/regression/logistics/tests/reference-to-id/aql/referenceToWrongID.aql new file mode 100644 index 000000000..f534a0d7f --- /dev/null +++ b/spec/regression/logistics/tests/reference-to-id/aql/referenceToWrongID.aql @@ -0,0 +1,30 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + LET v_handlingUnit1 = (IS_NULL(v_deliveryItem1.`handlingUnit`) ? null : FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER ((v_handlingUnit2._key > NULL) && (v_handlingUnit2._key == v_deliveryItem1.`handlingUnit`)) + LIMIT @var3 + RETURN v_handlingUnit2 + ))) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber`, + "handlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "id": v_handlingUnit1._key, + "huNumber": v_handlingUnit1.`huNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/reference-to-id.result.json b/spec/regression/logistics/tests/reference-to-id/result.json similarity index 100% rename from spec/regression/logistics/tests/reference-to-id.result.json rename to spec/regression/logistics/tests/reference-to-id/result.json diff --git a/spec/regression/logistics/tests/reference-to-id.graphql b/spec/regression/logistics/tests/reference-to-id/test.graphql similarity index 100% rename from spec/regression/logistics/tests/reference-to-id.graphql rename to spec/regression/logistics/tests/reference-to-id/test.graphql diff --git a/spec/regression/logistics/tests/traversal-after-mutation/aql/create.aql b/spec/regression/logistics/tests/traversal-after-mutation/aql/create.aql new file mode 100644 index 000000000..560d7733b --- /dev/null +++ b/spec/regression/logistics/tests/traversal-after-mutation/aql/create.aql @@ -0,0 +1,83 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, @v_newEntityId1), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "createDelivery": @v_createDelivery1 +} diff --git a/spec/regression/logistics/tests/traversal-after-mutation/aql/update.aql b/spec/regression/logistics/tests/traversal-after-mutation/aql/update.aql new file mode 100644 index 000000000..b7b16615e --- /dev/null +++ b/spec/regression/logistics/tests/traversal-after-mutation/aql/update.aql @@ -0,0 +1,97 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/traversal-after-mutation.result.json b/spec/regression/logistics/tests/traversal-after-mutation/result.json similarity index 100% rename from spec/regression/logistics/tests/traversal-after-mutation.result.json rename to spec/regression/logistics/tests/traversal-after-mutation/result.json diff --git a/spec/regression/logistics/tests/traversal-after-mutation.graphql b/spec/regression/logistics/tests/traversal-after-mutation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/traversal-after-mutation.graphql rename to spec/regression/logistics/tests/traversal-after-mutation/test.graphql diff --git a/spec/regression/logistics/tests/update-all/aql/all.aql b/spec/regression/logistics/tests/update-all/aql/all.aql new file mode 100644 index 000000000..2b07399c5 --- /dev/null +++ b/spec/regression/logistics/tests/update-all/aql/all.aql @@ -0,0 +1,43 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1.`deliveryNumber` == @var1) || (v_delivery1.`deliveryNumber` == @var2)) + SORT (v_delivery1.`deliveryNumber`) + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "consignee": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_delivery1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@deliveries, v_id1) + ) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city` + }) + } +) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateAllDeliveries": @v_updateAllDeliveries1 +} diff --git a/spec/regression/logistics/tests/update-all/aql/onlyFirst.aql b/spec/regression/logistics/tests/update-all/aql/onlyFirst.aql new file mode 100644 index 000000000..2e1b5fcf0 --- /dev/null +++ b/spec/regression/logistics/tests/update-all/aql/onlyFirst.aql @@ -0,0 +1,44 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1.`deliveryNumber` == @var1) || (v_delivery1.`deliveryNumber` == @var2)) + SORT (v_delivery1.`deliveryNumber`) + LIMIT @var3 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "consignee": @var4, + "updatedAt": @var5 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_delivery1 + IN ( + FOR v_id1 + IN @v_updatedIds1 + RETURN DOCUMENT(@@deliveries, v_id1) + ) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city` + }) + } +) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateAllDeliveries": @v_updateAllDeliveries1 +} diff --git a/spec/regression/logistics/tests/update-all.result.json b/spec/regression/logistics/tests/update-all/result.json similarity index 100% rename from spec/regression/logistics/tests/update-all.result.json rename to spec/regression/logistics/tests/update-all/result.json diff --git a/spec/regression/logistics/tests/update-all.graphql b/spec/regression/logistics/tests/update-all/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-all.graphql rename to spec/regression/logistics/tests/update-all/test.graphql diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/addSome.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/addSome.aql new file mode 100644 index 000000000..c271de847 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/addSome.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/addUpdateAndDelete.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/addUpdateAndDelete.aql new file mode 100644 index 000000000..a1c344c4a --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/addUpdateAndDelete.aql @@ -0,0 +1,68 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + LET v_items1 = ( + FOR v_deliveryItem1 + IN UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3) + FILTER !((v_deliveryItem1.`id` IN @var4)) + RETURN v_deliveryItem1 + ) + LET v_itemsWithIndex1 = ( + FOR v_indexVar1 + IN LENGTH(v_items1) > 0 ? 0..(LENGTH(v_items1) - 1) : [] + RETURN MERGE(NTH(v_items1, v_indexVar1), { __index: v_indexVar1 }) + ) + LET v_dict1 = ZIP(v_items1[*].id, v_itemsWithIndex1) + LET v_updatedDict1 = MERGE(v_dict1, { + @var5: MERGE(v_dict1[@var6], { + "itemNumber": @var7, + "updatedAt": @var8 + }), + @var9: MERGE(v_dict1[@var10], { + "itemNumber": @var11, + "updatedAt": @var12 + }) + }) + FOR v_item1 + IN VALUES(v_updatedDict1) + FILTER v_item1.__index != null + SORT v_item1.__index + RETURN UNSET(v_item1, '__index') + ), + "updatedAt": @var13 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateMultiple.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateMultiple.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateMultiple.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateOne.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateOne.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/afterUpdateOne.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/end.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/end.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/end.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/updateMultiple.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/updateMultiple.aql new file mode 100644 index 000000000..4f1f4c60a --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/updateMultiple.aql @@ -0,0 +1,79 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + LET v_items1 = (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + LET v_itemsWithIndex1 = ( + FOR v_indexVar1 + IN LENGTH(v_items1) > 0 ? 0..(LENGTH(v_items1) - 1) : [] + RETURN MERGE(NTH(v_items1, v_indexVar1), { __index: v_indexVar1 }) + ) + LET v_dict1 = ZIP(v_items1[*].id, v_itemsWithIndex1) + LET v_updatedDict1 = MERGE(v_dict1, { + @var3: MERGE(v_dict1[@var4], { + "itemNumber": @var5, + "updatedAt": @var6 + }), + @var7: MERGE(v_dict1[@var8], { + "itemNumber": @var9, + "updatedAt": @var10 + }), + @var11: MERGE(v_dict1[@var12], { + "itemNumber": @var13, + "updatedAt": @var14 + }), + @var15: MERGE(v_dict1[@var16], { + "itemNumber": @var17, + "updatedAt": @var18 + }), + @var19: MERGE(v_dict1[@var20], { + "itemNumber": @var21, + "updatedAt": @var22 + }), + @var23: MERGE(v_dict1[@var24], { + "itemNumber": @var25, + "updatedAt": @var26 + }) + }) + FOR v_item1 + IN VALUES(v_updatedDict1) + FILTER v_item1.__index != null + SORT v_item1.__index + RETURN UNSET(v_item1, '__index') + ), + "updatedAt": @var27 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict/aql/updateOne.aql b/spec/regression/logistics/tests/update-child-entities-dict/aql/updateOne.aql new file mode 100644 index 000000000..054a47cc3 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities-dict/aql/updateOne.aql @@ -0,0 +1,59 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + LET v_items1 = (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + LET v_itemsWithIndex1 = ( + FOR v_indexVar1 + IN LENGTH(v_items1) > 0 ? 0..(LENGTH(v_items1) - 1) : [] + RETURN MERGE(NTH(v_items1, v_indexVar1), { __index: v_indexVar1 }) + ) + LET v_dict1 = ZIP(v_items1[*].id, v_itemsWithIndex1) + LET v_updatedDict1 = MERGE(v_dict1, { + @var3: MERGE(v_dict1[@var4], { + "itemNumber": @var5, + "updatedAt": @var6 + }) + }) + FOR v_item1 + IN VALUES(v_updatedDict1) + FILTER v_item1.__index != null + SORT v_item1.__index + RETURN UNSET(v_item1, '__index') + ), + "updatedAt": @var7 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities-dict.context.json b/spec/regression/logistics/tests/update-child-entities-dict/context.json similarity index 100% rename from spec/regression/logistics/tests/update-child-entities-dict.context.json rename to spec/regression/logistics/tests/update-child-entities-dict/context.json diff --git a/spec/regression/logistics/tests/update-child-entities-dict.result.json b/spec/regression/logistics/tests/update-child-entities-dict/result.json similarity index 100% rename from spec/regression/logistics/tests/update-child-entities-dict.result.json rename to spec/regression/logistics/tests/update-child-entities-dict/result.json diff --git a/spec/regression/logistics/tests/update-child-entities-dict.graphql b/spec/regression/logistics/tests/update-child-entities-dict/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-child-entities-dict.graphql rename to spec/regression/logistics/tests/update-child-entities-dict/test.graphql diff --git a/spec/regression/logistics/tests/update-child-entities/aql/addSome.aql b/spec/regression/logistics/tests/update-child-entities/aql/addSome.aql new file mode 100644 index 000000000..c271de847 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/addSome.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/addUpdateAndDelete.aql b/spec/regression/logistics/tests/update-child-entities/aql/addUpdateAndDelete.aql new file mode 100644 index 000000000..b65266f68 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/addUpdateAndDelete.aql @@ -0,0 +1,51 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3) + FILTER !((v_deliveryItem1.`id` IN @var4)) + RETURN ((v_deliveryItem1.`id` == @var5) ? MERGE(v_deliveryItem1, { + "itemNumber": @var6, + "updatedAt": @var7 + }) : ((v_deliveryItem1.`id` == @var8) ? MERGE(v_deliveryItem1, { + "itemNumber": @var9, + "updatedAt": @var10 + }) : v_deliveryItem1)) + ), + "updatedAt": @var11 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateMultiple.aql b/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateMultiple.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateMultiple.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateOne.aql b/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateOne.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/afterUpdateOne.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/end.aql b/spec/regression/logistics/tests/update-child-entities/aql/end.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/end.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/updateMultiple.aql b/spec/regression/logistics/tests/update-child-entities/aql/updateMultiple.aql new file mode 100644 index 000000000..ad22b5fca --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/updateMultiple.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + RETURN ((v_deliveryItem1.`id` == @var3) ? MERGE(v_deliveryItem1, { + "itemNumber": @var4, + "updatedAt": @var5 + }) : ((v_deliveryItem1.`id` == @var6) ? MERGE(v_deliveryItem1, { + "itemNumber": @var7, + "updatedAt": @var8 + }) : ((v_deliveryItem1.`id` == @var9) ? MERGE(v_deliveryItem1, { + "itemNumber": @var10, + "updatedAt": @var11 + }) : ((v_deliveryItem1.`id` == @var12) ? MERGE(v_deliveryItem1, { + "itemNumber": @var13, + "updatedAt": @var14 + }) : ((v_deliveryItem1.`id` == @var15) ? MERGE(v_deliveryItem1, { + "itemNumber": @var16, + "updatedAt": @var17 + }) : ((v_deliveryItem1.`id` == @var18) ? MERGE(v_deliveryItem1, { + "itemNumber": @var19, + "updatedAt": @var20 + }) : v_deliveryItem1)))))) + ), + "updatedAt": @var21 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities/aql/updateOne.aql b/spec/regression/logistics/tests/update-child-entities/aql/updateOne.aql new file mode 100644 index 000000000..3208bdc24 --- /dev/null +++ b/spec/regression/logistics/tests/update-child-entities/aql/updateOne.aql @@ -0,0 +1,47 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + RETURN ((v_deliveryItem1.`id` == @var3) ? MERGE(v_deliveryItem1, { + "itemNumber": @var4, + "updatedAt": @var5 + }) : v_deliveryItem1) + ), + "updatedAt": @var6 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-child-entities.context.json b/spec/regression/logistics/tests/update-child-entities/context.json similarity index 100% rename from spec/regression/logistics/tests/update-child-entities.context.json rename to spec/regression/logistics/tests/update-child-entities/context.json diff --git a/spec/regression/logistics/tests/update-child-entities.result.json b/spec/regression/logistics/tests/update-child-entities/result.json similarity index 100% rename from spec/regression/logistics/tests/update-child-entities.result.json rename to spec/regression/logistics/tests/update-child-entities/result.json diff --git a/spec/regression/logistics/tests/update-child-entities.graphql b/spec/regression/logistics/tests/update-child-entities/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-child-entities.graphql rename to spec/regression/logistics/tests/update-child-entities/test.graphql diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterClear.aql b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterClear.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterClear.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterUpdateMultiple.aql b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterUpdateMultiple.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/afterUpdateMultiple.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/clearItems.aql b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/clearItems.aql new file mode 100644 index 000000000..867b8bc69 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/clearItems.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + FILTER !((v_deliveryItem1.`id` IN @var3)) + RETURN v_deliveryItem1 + ), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/updateMultiple.aql b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/updateMultiple.aql new file mode 100644 index 000000000..1dea861c9 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/aql/updateMultiple.aql @@ -0,0 +1,75 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + LET v_items1 = (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + LET v_itemsWithIndex1 = ( + FOR v_indexVar1 + IN LENGTH(v_items1) > 0 ? 0..(LENGTH(v_items1) - 1) : [] + RETURN MERGE(NTH(v_items1, v_indexVar1), { __index: v_indexVar1 }) + ) + LET v_dict1 = ZIP(v_items1[*].id, v_itemsWithIndex1) + LET v_updatedDict1 = MERGE(v_dict1, { + @var3: MERGE(v_dict1[@var4], { + "itemNumber": @var5, + "updatedAt": @var6 + }), + @var7: MERGE(v_dict1[@var8], { + "itemNumber": @var9, + "updatedAt": @var10 + }), + @var11: MERGE(v_dict1[@var12], { + "itemNumber": @var13, + "updatedAt": @var14 + }), + @var15: MERGE(v_dict1[@var16], { + "itemNumber": @var17, + "updatedAt": @var18 + }), + @var19: MERGE(v_dict1[@var20], { + "itemNumber": @var21, + "updatedAt": @var22 + }) + }) + FOR v_item1 + IN VALUES(v_updatedDict1) + FILTER v_item1.__index != null + SORT v_item1.__index + RETURN UNSET(v_item1, '__index') + ), + "updatedAt": @var23 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict.context.json b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/context.json similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list-dict.context.json rename to spec/regression/logistics/tests/update-empty-child-entities-list-dict/context.json diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict.result.json b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/result.json similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list-dict.result.json rename to spec/regression/logistics/tests/update-empty-child-entities-list-dict/result.json diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list-dict.graphql b/spec/regression/logistics/tests/update-empty-child-entities-list-dict/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list-dict.graphql rename to spec/regression/logistics/tests/update-empty-child-entities-list-dict/test.graphql diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterClear.aql b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterClear.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterClear.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterUpdateMultiple.aql b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterUpdateMultiple.aql new file mode 100644 index 000000000..a28345321 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/afterUpdateMultiple.aql @@ -0,0 +1,19 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list/aql/clearItems.aql b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/clearItems.aql new file mode 100644 index 000000000..867b8bc69 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/clearItems.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + FILTER !((v_deliveryItem1.`id` IN @var3)) + RETURN v_deliveryItem1 + ), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list/aql/updateMultiple.aql b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/updateMultiple.aql new file mode 100644 index 000000000..93251a2c6 --- /dev/null +++ b/spec/regression/logistics/tests/update-empty-child-entities-list/aql/updateMultiple.aql @@ -0,0 +1,59 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []) + RETURN ((v_deliveryItem1.`id` == @var3) ? MERGE(v_deliveryItem1, { + "itemNumber": @var4, + "updatedAt": @var5 + }) : ((v_deliveryItem1.`id` == @var6) ? MERGE(v_deliveryItem1, { + "itemNumber": @var7, + "updatedAt": @var8 + }) : ((v_deliveryItem1.`id` == @var9) ? MERGE(v_deliveryItem1, { + "itemNumber": @var10, + "updatedAt": @var11 + }) : ((v_deliveryItem1.`id` == @var12) ? MERGE(v_deliveryItem1, { + "itemNumber": @var13, + "updatedAt": @var14 + }) : ((v_deliveryItem1.`id` == @var15) ? MERGE(v_deliveryItem1, { + "itemNumber": @var16, + "updatedAt": @var17 + }) : v_deliveryItem1))))) + ), + "updatedAt": @var18 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "id": v_deliveryItem1.`id`, + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list.context.json b/spec/regression/logistics/tests/update-empty-child-entities-list/context.json similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list.context.json rename to spec/regression/logistics/tests/update-empty-child-entities-list/context.json diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list.result.json b/spec/regression/logistics/tests/update-empty-child-entities-list/result.json similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list.result.json rename to spec/regression/logistics/tests/update-empty-child-entities-list/result.json diff --git a/spec/regression/logistics/tests/update-empty-child-entities-list.graphql b/spec/regression/logistics/tests/update-empty-child-entities-list/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-empty-child-entities-list.graphql rename to spec/regression/logistics/tests/update-empty-child-entities-list/test.graphql diff --git a/spec/regression/logistics/tests/update-many/aql/create.aql b/spec/regression/logistics/tests/update-many/aql/create.aql new file mode 100644 index 000000000..5f262239f --- /dev/null +++ b/spec/regression/logistics/tests/update-many/aql/create.aql @@ -0,0 +1,247 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "serialNumbers": @var3, + "consignee": @var4, + "contentInfo": @var5, + "dgInfo": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`) ? v_currentEntity1.`dgInfo` : {}), { + "unNumber": @var6, + "flashpoint": @var7, + "notices": @var8 + }), + "destinationCountryISOCode": @var9, + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var10), + "updatedAt": @var11 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "serialNumbers": @var3, + "consignee": @var4, + "contentInfo": @var5, + "dgInfo": MERGE((IS_OBJECT(v_currentEntity1.`dgInfo`) ? v_currentEntity1.`dgInfo` : {}), { + "unNumber": @var6, + "flashpoint": @var7, + "notices": @var8 + }), + "destinationCountryISOCode": @var9, + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var10), + "updatedAt": @var11 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_entity1 IN @var1 + INSERT v_entity1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: CONCAT(@var2, (@v_newEntityIds1)[@var3])} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN ( + FOR v_delivery1 + IN [ + DOCUMENT(@@deliveries, @var1), + DOCUMENT(@@deliveries, @var2) + ] + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var3 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var4 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) + } +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "updateDeliveries": @v_updateDeliveries1 +} diff --git a/spec/regression/logistics/tests/update-many/aql/query.aql b/spec/regression/logistics/tests/update-many/aql/query.aql new file mode 100644 index 000000000..f3be1e2a9 --- /dev/null +++ b/spec/regression/logistics/tests/update-many/aql/query.aql @@ -0,0 +1,74 @@ +WITH @@handlingUnits +RETURN { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`deliveryNumber`) + LIMIT @var1 + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var2 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountryISOCode`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountryISOCode`)) + LIMIT @var3 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) + } + ) +} diff --git a/spec/regression/logistics/tests/update-many.result.json b/spec/regression/logistics/tests/update-many/result.json similarity index 100% rename from spec/regression/logistics/tests/update-many.result.json rename to spec/regression/logistics/tests/update-many/result.json diff --git a/spec/regression/logistics/tests/update-many.graphql b/spec/regression/logistics/tests/update-many/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-many.graphql rename to spec/regression/logistics/tests/update-many/test.graphql diff --git a/spec/regression/logistics/tests/update-not-found.result.json b/spec/regression/logistics/tests/update-not-found.result.json deleted file mode 100644 index ce2d7849a..000000000 --- a/spec/regression/logistics/tests/update-not-found.result.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "errors": [ - { - "message": "Delivery with id 'not-found' could not be found.", - "locations": [ - { - "line": 2, - "column": 5 - } - ], - "path": ["updateDelivery"] - } - ], - "data": { - "updateDelivery": null - } -} diff --git a/spec/regression/logistics/tests/update-not-found/aql/updateNotFound.aql b/spec/regression/logistics/tests/update-not-found/aql/updateNotFound.aql new file mode 100644 index 000000000..6714b0cec --- /dev/null +++ b/spec/regression/logistics/tests/update-not-found/aql/updateNotFound.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_entity1 = DOCUMENT(@@deliveries, FIRST(@v_updatedIds1)) +RETURN ( + UPSERT { + key: @var1, + type: @var2 + } + INSERT { + + key: @var3, + type: @var4, + category: null, + quantity: null, + isExported: false, + createdAt: @var5, + updatedAt: @var6, + isConfirmedForExport: false + } + UPDATE (OLD.isConfirmedForExport ? {} : { + updatedAt: @var7, + category: null, + quantity: null + }) + IN @@billingEntities + RETURN @var8 +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-not-found/result.json b/spec/regression/logistics/tests/update-not-found/result.json new file mode 100644 index 000000000..2519a7848 --- /dev/null +++ b/spec/regression/logistics/tests/update-not-found/result.json @@ -0,0 +1,19 @@ +{ + "updateNotFound": { + "errors": [ + { + "message": "Delivery with id 'not-found' could not be found.", + "locations": [ + { + "line": 2, + "column": 5 + } + ], + "path": ["updateDelivery"] + } + ], + "data": { + "updateDelivery": null + } + } +} diff --git a/spec/regression/logistics/tests/update-not-found.graphql b/spec/regression/logistics/tests/update-not-found/test.graphql similarity index 79% rename from spec/regression/logistics/tests/update-not-found.graphql rename to spec/regression/logistics/tests/update-not-found/test.graphql index 67eb646fc..698017d62 100644 --- a/spec/regression/logistics/tests/update-not-found.graphql +++ b/spec/regression/logistics/tests/update-not-found/test.graphql @@ -1,4 +1,4 @@ -mutation { +mutation updateNotFound { updateDelivery(input: { id: "not-found", deliveryNumber: "123" }) { deliveryNumber } diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/add.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/add.aql new file mode 100644 index 000000000..d81a64180 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/add.aql @@ -0,0 +1,57 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/add2.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/add2.aql new file mode 100644 index 000000000..d81a64180 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/add2.aql @@ -0,0 +1,57 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/check1.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check1.aql new file mode 100644 index 000000000..b4481f4c1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check1.aql @@ -0,0 +1,30 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/check2.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check2.aql new file mode 100644 index 000000000..ee2045590 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check2.aql @@ -0,0 +1,31 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/check3.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check3.aql new file mode 100644 index 000000000..b4481f4c1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check3.aql @@ -0,0 +1,30 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/check4.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check4.aql new file mode 100644 index 000000000..b4481f4c1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/check4.aql @@ -0,0 +1,30 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove.aql new file mode 100644 index 000000000..ff7ac3611 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_to1 IN @var2 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 && v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove2.aql b/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove2.aql new file mode 100644 index 000000000..ff7ac3611 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-many-relation/aql/remove2.aql @@ -0,0 +1,40 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_to1 IN @var2 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 && v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "updateDelivery": @v_updateDelivery1 +} diff --git a/spec/regression/logistics/tests/update-with-to-many-relation.result.json b/spec/regression/logistics/tests/update-with-to-many-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/update-with-to-many-relation.result.json rename to spec/regression/logistics/tests/update-with-to-many-relation/result.json diff --git a/spec/regression/logistics/tests/update-with-to-many-relation.graphql b/spec/regression/logistics/tests/update-with-to-many-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-with-to-many-relation.graphql rename to spec/regression/logistics/tests/update-with-to-many-relation/test.graphql diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/check1.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check1.aql new file mode 100644 index 000000000..365b9cfa1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check1.aql @@ -0,0 +1,21 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/check2.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check2.aql new file mode 100644 index 000000000..365b9cfa1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check2.aql @@ -0,0 +1,21 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/check3.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check3.aql new file mode 100644 index 000000000..365b9cfa1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check3.aql @@ -0,0 +1,21 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/check4.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check4.aql new file mode 100644 index 000000000..365b9cfa1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/check4.aql @@ -0,0 +1,21 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/leave.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/leave.aql new file mode 100644 index 000000000..fa8885508 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/leave.aql @@ -0,0 +1,30 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/replace.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/replace.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/replace.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/set.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/set.aql new file mode 100644 index 000000000..15a04a3e1 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/set.aql @@ -0,0 +1,45 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation/aql/unset.aql b/spec/regression/logistics/tests/update-with-to-one-relation/aql/unset.aql new file mode 100644 index 000000000..fd0bfb147 --- /dev/null +++ b/spec/regression/logistics/tests/update-with-to-one-relation/aql/unset.aql @@ -0,0 +1,39 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits +RETURN { + "updateHandlingUnit": @v_updateHandlingUnit1 +} diff --git a/spec/regression/logistics/tests/update-with-to-one-relation.result.json b/spec/regression/logistics/tests/update-with-to-one-relation/result.json similarity index 100% rename from spec/regression/logistics/tests/update-with-to-one-relation.result.json rename to spec/regression/logistics/tests/update-with-to-one-relation/result.json diff --git a/spec/regression/logistics/tests/update-with-to-one-relation.graphql b/spec/regression/logistics/tests/update-with-to-one-relation/test.graphql similarity index 100% rename from spec/regression/logistics/tests/update-with-to-one-relation.graphql rename to spec/regression/logistics/tests/update-with-to-one-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/add-child-entity/aql/add.aql b/spec/regression/namespaced_logistics/tests/add-child-entity/aql/add.aql new file mode 100644 index 000000000..d335de525 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/add-child-entity/aql/add.aql @@ -0,0 +1,43 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "items": UNION((IS_LIST(v_currentEntity1.`items`) ? v_currentEntity1.`items` : []), @var3), + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/add-child-entity/aql/query.aql b/spec/regression/namespaced_logistics/tests/add-child-entity/aql/query.aql new file mode 100644 index 000000000..54914f617 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/add-child-entity/aql/query.aql @@ -0,0 +1,22 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/add-child-entity.result.json b/spec/regression/namespaced_logistics/tests/add-child-entity/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/add-child-entity.result.json rename to spec/regression/namespaced_logistics/tests/add-child-entity/result.json diff --git a/spec/regression/namespaced_logistics/tests/add-child-entity.graphql b/spec/regression/namespaced_logistics/tests/add-child-entity/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/add-child-entity.graphql rename to spec/regression/namespaced_logistics/tests/add-child-entity/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/add-root-entity/aql/add.aql b/spec/regression/namespaced_logistics/tests/add-root-entity/aql/add.aql new file mode 100644 index 000000000..9d3649c39 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/add-root-entity/aql/add.aql @@ -0,0 +1,21 @@ +RETURN FIRST( + INSERT @var1 IN @@countries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@countries +LET v_country1 = DOCUMENT(@@countries, @v_newEntityId1) +RETURN (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode` +}) + +// -------------------------------- + +WITH @@countries +RETURN { + "foundation": { + "createCountry": @v_createCountry1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/add-root-entity/aql/query.aql b/spec/regression/namespaced_logistics/tests/add-root-entity/aql/query.aql new file mode 100644 index 000000000..507341668 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/add-root-entity/aql/query.aql @@ -0,0 +1,20 @@ +RETURN { + "foundation": { + "allCountries": ( + FOR v_country1 + IN @@countries + SORT (v_country1.`isoCode`) + RETURN { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + } + ) + } +} diff --git a/spec/regression/namespaced_logistics/tests/add-root-entity.result.json b/spec/regression/namespaced_logistics/tests/add-root-entity/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/add-root-entity.result.json rename to spec/regression/namespaced_logistics/tests/add-root-entity/result.json diff --git a/spec/regression/namespaced_logistics/tests/add-root-entity.graphql b/spec/regression/namespaced_logistics/tests/add-root-entity/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/add-root-entity.graphql rename to spec/regression/namespaced_logistics/tests/add-root-entity/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/aliases.result.json b/spec/regression/namespaced_logistics/tests/aliases.result.json deleted file mode 100644 index 5c3f61e00..000000000 --- a/spec/regression/namespaced_logistics/tests/aliases.result.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "data": { - "logistics": { - "delivery": { - "aDelivery": { - "nr": "1000173", - "oneItem": [ - { - "itemNumber": "1001" - } - ], - "items": [ - { - "itemNumber": "1001" - }, - { - "itemNumber": "1002" - } - ] - }, - "anotherDelivery": { - "nr": "1000521" - } - } - } - } -} diff --git a/spec/regression/namespaced_logistics/tests/aliases/aql/aliases.aql b/spec/regression/namespaced_logistics/tests/aliases/aql/aliases.aql new file mode 100644 index 000000000..6bcddc23f --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/aliases/aql/aliases.aql @@ -0,0 +1,41 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_delivery3 = FIRST(( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var3) + LIMIT @var4 + RETURN v_delivery4 +)) +RETURN { + "logistics": { + "delivery": { + "aDelivery": (IS_NULL(v_delivery1) ? null : { + "nr": v_delivery1.`deliveryNumber`, + "oneItem": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + FILTER (v_deliveryItem1.`itemNumber` == @var5) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ), + "items": ( + FOR v_deliveryItem2 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem2.`itemNumber` + } + ) + }), + "anotherDelivery": (IS_NULL(v_delivery3) ? null : { + "nr": v_delivery3.`deliveryNumber` + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/aliases/result.json b/spec/regression/namespaced_logistics/tests/aliases/result.json new file mode 100644 index 000000000..42e2bf762 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/aliases/result.json @@ -0,0 +1,29 @@ +{ + "aliases": { + "data": { + "logistics": { + "delivery": { + "aDelivery": { + "nr": "1000173", + "oneItem": [ + { + "itemNumber": "1001" + } + ], + "items": [ + { + "itemNumber": "1001" + }, + { + "itemNumber": "1002" + } + ] + }, + "anotherDelivery": { + "nr": "1000521" + } + } + } + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/aliases.graphql b/spec/regression/namespaced_logistics/tests/aliases/test.graphql similarity index 96% rename from spec/regression/namespaced_logistics/tests/aliases.graphql rename to spec/regression/namespaced_logistics/tests/aliases/test.graphql index 2d4d145a0..2d575061c 100644 --- a/spec/regression/namespaced_logistics/tests/aliases.graphql +++ b/spec/regression/namespaced_logistics/tests/aliases/test.graphql @@ -1,4 +1,4 @@ -{ +query aliases { logistics { delivery { aDelivery: Delivery(id: "@{ids/logistics.delivery.Delivery/1}") { diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/check.aql b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/check.aql new file mode 100644 index 000000000..b987aec3d --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/check.aql @@ -0,0 +1,32 @@ +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1.`deliveryNumber` == @var1) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery2 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery2) ? null : { + "deliveryNumber": v_delivery2.`deliveryNumber` + }) + } + ) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/create.aql b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/create.aql new file mode 100644 index 000000000..9effcb381 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/aql/create.aql @@ -0,0 +1,50 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, @v_newEntityId1), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "logistics": { + "delivery": { + "createDelivery": @v_createDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-many-relation.result.json b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/create-with-to-many-relation.result.json rename to spec/regression/namespaced_logistics/tests/create-with-to-many-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-many-relation.graphql b/spec/regression/namespaced_logistics/tests/create-with-to-many-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/create-with-to-many-relation.graphql rename to spec/regression/namespaced_logistics/tests/create-with-to-many-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/check.aql b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/check.aql new file mode 100644 index 000000000..d519eeed5 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/check.aql @@ -0,0 +1,24 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1.`huNumber` == @var1) + LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/create.aql b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/create.aql new file mode 100644 index 000000000..33c176e41 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/aql/create.aql @@ -0,0 +1,38 @@ +RETURN FIRST( + INSERT @var1 IN @@handlingUnits + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, @v_newEntityId1)} + INSERT {_from: @var2, _to: CONCAT(@var3, @v_newEntityId1)} + UPDATE {_from: @var4, _to: CONCAT(@var5, @v_newEntityId1)} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @v_newEntityId1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "createHandlingUnit": @v_createHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-one-relation.result.json b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/create-with-to-one-relation.result.json rename to spec/regression/namespaced_logistics/tests/create-with-to-one-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/create-with-to-one-relation.graphql b/spec/regression/namespaced_logistics/tests/create-with-to-one-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/create-with-to-one-relation.graphql rename to spec/regression/namespaced_logistics/tests/create-with-to-one-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/create/aql/create.aql b/spec/regression/namespaced_logistics/tests/create/aql/create.aql new file mode 100644 index 000000000..cd2d734c6 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create/aql/create.aql @@ -0,0 +1,76 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var1 + RETURN v_country2 +))) +LET v_country3 = (IS_NULL(v_delivery1.`destinationCountry`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountry`)) + LIMIT @var2 + RETURN v_destinationCountry1 +))) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "createDelivery": @v_createDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create/aql/query.aql b/spec/regression/namespaced_logistics/tests/create/aql/query.aql new file mode 100644 index 000000000..6e0f5a273 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/create/aql/query.aql @@ -0,0 +1,68 @@ +RETURN { + "logistics": { + "delivery": { + "allDeliveries": ( + FOR v_delivery1 + IN @@deliveries + SORT (v_delivery1.`updatedAt`) DESC + LIMIT @var1 + LET v_country1 = (IS_NULL(v_delivery1.`consignee`.`country`) ? null : FIRST(( + FOR v_country2 + IN @@countries + FILTER ((v_country2.`isoCode` > NULL) && (v_country2.`isoCode` == v_delivery1.`consignee`.`country`)) + LIMIT @var2 + RETURN v_country2 + ))) + LET v_country3 = (IS_NULL(v_delivery1.`destinationCountry`) ? null : FIRST(( + FOR v_destinationCountry1 + IN @@countries + FILTER ((v_destinationCountry1.`isoCode` > NULL) && (v_destinationCountry1.`isoCode` == v_delivery1.`destinationCountry`)) + LIMIT @var3 + RETURN v_destinationCountry1 + ))) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "city": v_delivery1.`consignee`.`city`, + "country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + }), + "street": v_delivery1.`consignee`.`street` + }), + "contentInfo": ( + FOR v_translation2 + IN (IS_LIST(v_delivery1.`contentInfo`) ? v_delivery1.`contentInfo` : []) + RETURN { + "translation": v_translation2.`translation`, + "languageIsoCode": v_translation2.`languageIsoCode` + } + ), + "destinationCountry": (IS_NULL(v_country3) ? null : { + "isoCode": v_country3.`isoCode` + }), + "dgInfo": { + "flashpoint": v_delivery1.`dgInfo`.`flashpoint`, + "unNumber": v_delivery1.`dgInfo`.`unNumber`, + "notices": (IS_LIST(v_delivery1.`dgInfo`.`notices`) ? v_delivery1.`dgInfo`.`notices` : []) + }, + "serialNumbers": (IS_LIST(v_delivery1.`serialNumbers`) ? v_delivery1.`serialNumbers` : []), + "items": ( + FOR v_deliveryItem1 + IN (IS_LIST(v_delivery1.`items`) ? v_delivery1.`items` : []) + RETURN { + "itemNumber": v_deliveryItem1.`itemNumber` + } + ) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/create.result.json b/spec/regression/namespaced_logistics/tests/create/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/create.result.json rename to spec/regression/namespaced_logistics/tests/create/result.json diff --git a/spec/regression/namespaced_logistics/tests/create.graphql b/spec/regression/namespaced_logistics/tests/create/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/create.graphql rename to spec/regression/namespaced_logistics/tests/create/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/create.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/create.aql new file mode 100644 index 000000000..e62e8f736 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/create.aql @@ -0,0 +1,8 @@ +RETURN { + "logistics": { + "delivery": { + "createDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } + }, + "createForwarder": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/delete.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/delete.aql new file mode 100644 index 000000000..9df1fa087 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/delete.aql @@ -0,0 +1,5 @@ +RETURN { + "logistics": { + "deleteForwarder": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/filter.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/filter.aql new file mode 100644 index 000000000..96d6f447a --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/filter.aql @@ -0,0 +1,13 @@ +RETURN { + "logistics": { + "delivery": { + "direct": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "startsWith": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 }, + "throughRelation": { __cruddl_runtime_error_code: @var5, __cruddl_runtime_error: @var6 }, + "toUnaccessibleEntity": { __cruddl_runtime_error_code: @var7, __cruddl_runtime_error: @var8 } + } + }, + "simple": { + "SecretKey": { __cruddl_runtime_error_code: @var9, __cruddl_runtime_error: @var10 } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/prepare.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/prepare.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/prepare.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/select.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/select.aql new file mode 100644 index 000000000..4a8782803 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/select.aql @@ -0,0 +1,60 @@ +WITH @@deliveries +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var3) + LIMIT @var4 + RETURN v_handlingUnit2 +)) +LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +LET v_country1 = FIRST(( + FOR v_country2 + IN @@countries + FILTER (v_country2.`isoCode` == @var5) + LIMIT @var6 + RETURN v_country2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var7, __cruddl_runtime_error: @var8 }, + "forwarder": { __cruddl_runtime_error_code: @var9, __cruddl_runtime_error: @var10 } + }), + "allDeliveries": ( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var11) + RETURN { + "deliveryNumber": v_delivery4.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var12, __cruddl_runtime_error: @var13 } + } + ), + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber`, + "totalValue": { __cruddl_runtime_error_code: @var14, __cruddl_runtime_error: @var15 } + }) + }) + } + }, + "foundation": { + "Country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "totalInvestment": { __cruddl_runtime_error_code: @var16, __cruddl_runtime_error: @var17 } + }) + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/selectMeta.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/selectMeta.aql new file mode 100644 index 000000000..6f6934d0a --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/selectMeta.aql @@ -0,0 +1,8 @@ +RETURN { + "logistics": { + "allForwarders": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + @var3: { + "count": { __cruddl_runtime_error_code: @var4, __cruddl_runtime_error: @var5 } + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/sort.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/sort.aql new file mode 100644 index 000000000..3b631f433 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/sort.aql @@ -0,0 +1,8 @@ +RETURN { + "logistics": { + "delivery": { + "direct": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "throughRelation": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/update.aql b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/update.aql new file mode 100644 index 000000000..4a40b8090 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-denied/aql/update.aql @@ -0,0 +1,9 @@ +RETURN { + "logistics": { + "delivery": { + "updateDelivery": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "update2": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } + }, + "updateForwarder": { __cruddl_runtime_error_code: @var5, __cruddl_runtime_error: @var6 } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied.result.json b/spec/regression/namespaced_logistics/tests/field-permission-denied/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/field-permission-denied.result.json rename to spec/regression/namespaced_logistics/tests/field-permission-denied/result.json diff --git a/spec/regression/namespaced_logistics/tests/field-permission-denied.graphql b/spec/regression/namespaced_logistics/tests/field-permission-denied/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/field-permission-denied.graphql rename to spec/regression/namespaced_logistics/tests/field-permission-denied/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/create.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/create.aql new file mode 100644 index 000000000..b97dced9f --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/create.aql @@ -0,0 +1,40 @@ +RETURN FIRST( + INSERT @var1 IN @@deliveries + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @v_newEntityId1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN FIRST( + INSERT @var1 IN @@forwarders + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_forwarder1 = DOCUMENT(@@forwarders, @v_newEntityId1) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "logistics": { + "delivery": { + "createDelivery": @v_createDelivery1 + }, + "createForwarder": @v_createForwarder1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/delete.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/delete.aql new file mode 100644 index 000000000..40400df28 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/delete.aql @@ -0,0 +1,37 @@ +RETURN ( + FOR v_forwarder1 + IN @@forwarders + FILTER (v_forwarder1._key == @var1) + LIMIT @var2 + RETURN v_forwarder1._key +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@deliveries_forwarder + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_forwarder +) + +// -------------------------------- + +LET v_forwarder1 = FIRST(( + FOR v_forwarder2 + IN @v_ids1 + REMOVE v_forwarder2 + IN @@forwarders + RETURN OLD +)) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +RETURN { + "logistics": { + "deleteForwarder": @v_deleteForwarder1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/filter.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/filter.aql new file mode 100644 index 000000000..e300b35c9 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/filter.aql @@ -0,0 +1,61 @@ +WITH @@deliveries, @@forwarders +LET v_secretKey1 = FIRST(( + FOR v_secretKey2 + IN @@secretKeys + FILTER (v_secretKey2.`key` == @var1) + LIMIT @var2 + RETURN v_secretKey2 +)) +RETURN { + "logistics": { + "delivery": { + "direct": ( + FOR v_delivery1 + IN @@deliveries + FILTER ((v_delivery1._key == @var3) && (v_delivery1.`totalValue` == @var4)) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ), + "startsWith": ( + FOR v_delivery2 + IN @@deliveries + FILTER ((v_delivery2._key == @var5) && (v_delivery2.`totalValue` >= UPPER(@var6) && v_delivery2.`totalValue` < LOWER(@var7)) && (LEFT(v_delivery2.`totalValue`, LENGTH(@var8)) == @var9)) + RETURN { + "deliveryNumber": v_delivery2.`deliveryNumber` + } + ), + "throughRelation": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER ((v_handlingUnit1._key == @var10) && (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`totalValue` == @var11)) + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ), + "toUnaccessibleEntity": ( + FOR v_delivery3 + IN @@deliveries + FILTER ((v_delivery3._key == @var12) && (FIRST(( + FOR v_node2 + IN OUTBOUND v_delivery3 @@deliveries_forwarder + FILTER v_node2._key != null + RETURN v_node2 + )).`name` == @var13)) + RETURN { + "deliveryNumber": v_delivery3.`deliveryNumber` + } + ) + } + }, + "accounting": { + "simple": (IS_NULL(v_secretKey1) ? null : { + "value": v_secretKey1.`value` + }) + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/prepare.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/prepare.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/prepare.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/select.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/select.aql new file mode 100644 index 000000000..8c9be065c --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/select.aql @@ -0,0 +1,68 @@ +WITH @@forwarders, @@deliveries +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +LET v_forwarder1 = FIRST(( + FOR v_node1 + IN OUTBOUND v_delivery1 @@deliveries_forwarder + FILTER v_node1._key != null + RETURN v_node1 +)) +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var3) + LIMIT @var4 + RETURN v_handlingUnit2 +)) +LET v_delivery3 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 +)) +LET v_country1 = FIRST(( + FOR v_country2 + IN @@countries + FILTER (v_country2.`isoCode` == @var5) + LIMIT @var6 + RETURN v_country2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "totalValue": v_delivery1.`totalValue`, + "forwarder": (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` + }) + }), + "allDeliveries": ( + FOR v_delivery4 + IN @@deliveries + FILTER (v_delivery4._key == @var7) + RETURN { + "deliveryNumber": v_delivery4.`deliveryNumber`, + "totalValue": v_delivery4.`totalValue` + } + ), + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber`, + "totalValue": v_delivery3.`totalValue` + }) + }) + } + }, + "foundation": { + "Country": (IS_NULL(v_country1) ? null : { + "isoCode": v_country1.`isoCode`, + "totalInvestment": v_country1.`totalInvestment` + }) + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/selectMeta.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/selectMeta.aql new file mode 100644 index 000000000..479d90eb3 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/selectMeta.aql @@ -0,0 +1,14 @@ +RETURN { + "logistics": { + "allForwarders": ( + FOR v_forwarder1 + IN @@forwarders + RETURN { + "name": v_forwarder1.`name` + } + ), + @var1: { + "count": LENGTH(@@forwarders) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/sort.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/sort.aql new file mode 100644 index 000000000..d96a8f90e --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/sort.aql @@ -0,0 +1,30 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "direct": ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + SORT (v_delivery1.`totalValue`) + RETURN { + "deliveryNumber": v_delivery1.`deliveryNumber` + } + ), + "throughRelation": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var2) + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`totalValue`) DESC + RETURN { + "huNumber": v_handlingUnit1.`huNumber` + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/update.aql b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/update.aql new file mode 100644 index 000000000..c66b4d150 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/field-permission-granted/aql/update.aql @@ -0,0 +1,99 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "totalValue": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH { + "deliveryNumber": @var3, + "updatedAt": @var4 + } + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_forwarder1 + IN @@forwarders + FILTER (v_forwarder1._key == @var1) + LIMIT @var2 + RETURN v_forwarder1 + ) + UPDATE v_currentEntity1 + WITH { + "name": @var3, + "updatedAt": @var4 + } + IN @@forwarders + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +LET v_forwarder1 = DOCUMENT(@@forwarders, @var1) +RETURN (IS_NULL(v_forwarder1) ? null : { + "name": v_forwarder1.`name` +}) + +// -------------------------------- + +WITH @@deliveries, @@forwarders +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1, + "update2": @v_updateDelivery2 + }, + "updateForwarder": @v_updateForwarder1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted.context.json b/spec/regression/namespaced_logistics/tests/field-permission-granted/context.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/field-permission-granted.context.json rename to spec/regression/namespaced_logistics/tests/field-permission-granted/context.json diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted.result.json b/spec/regression/namespaced_logistics/tests/field-permission-granted/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/field-permission-granted.result.json rename to spec/regression/namespaced_logistics/tests/field-permission-granted/result.json diff --git a/spec/regression/namespaced_logistics/tests/field-permission-granted.graphql b/spec/regression/namespaced_logistics/tests/field-permission-granted/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/field-permission-granted.graphql rename to spec/regression/namespaced_logistics/tests/field-permission-granted/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation1.aql b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation1.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation1.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation2.aql b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation2.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/addRelation2.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/q.aql b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/q.aql new file mode 100644 index 000000000..0bd3ae10b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/filter-by-relation/aql/q.aql @@ -0,0 +1,29 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber` == @var1) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/filter-by-relation.result.json b/spec/regression/namespaced_logistics/tests/filter-by-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/filter-by-relation.result.json rename to spec/regression/namespaced_logistics/tests/filter-by-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/filter-by-relation.graphql b/spec/regression/namespaced_logistics/tests/filter-by-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/filter-by-relation.graphql rename to spec/regression/namespaced_logistics/tests/filter-by-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/internal-graphql-fields.result.json b/spec/regression/namespaced_logistics/tests/internal-graphql-fields.result.json deleted file mode 100644 index 5ad3f73e0..000000000 --- a/spec/regression/namespaced_logistics/tests/internal-graphql-fields.result.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": { - "__type": { - "name": "Delivery" - }, - "__typename": "Query", - "logistics": { - "delivery": { - "Delivery": { - "deliveryNumber": "1000173", - "__typename": "Delivery" - } - } - } - } -} diff --git a/spec/regression/namespaced_logistics/tests/internal-graphql-fields/aql/typename.aql b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/aql/typename.aql new file mode 100644 index 000000000..bc28c23de --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/aql/typename.aql @@ -0,0 +1,16 @@ +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/internal-graphql-fields/result.json b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/result.json new file mode 100644 index 000000000..57a018aa3 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/result.json @@ -0,0 +1,22 @@ +{ + "introspection": { + "data": { + "__type": { + "name": "Delivery" + } + } + }, + "typename": { + "data": { + "__typename": "Query", + "logistics": { + "delivery": { + "Delivery": { + "deliveryNumber": "1000173", + "__typename": "Delivery" + } + } + } + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/internal-graphql-fields.graphql b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/test.graphql similarity index 70% rename from spec/regression/namespaced_logistics/tests/internal-graphql-fields.graphql rename to spec/regression/namespaced_logistics/tests/internal-graphql-fields/test.graphql index 3d7515f32..594fb4552 100644 --- a/spec/regression/namespaced_logistics/tests/internal-graphql-fields.graphql +++ b/spec/regression/namespaced_logistics/tests/internal-graphql-fields/test.graphql @@ -1,10 +1,12 @@ -{ - # these fields should be ignored and handled by the graphql engine +# these fields should be ignored and handled by the graphql engine +query introspection { __type(name: "Delivery") { name } +} +query typename { __typename logistics { diff --git a/spec/regression/namespaced_logistics/tests/number-range/aql/firstIncrement.aql b/spec/regression/namespaced_logistics/tests/number-range/aql/firstIncrement.aql new file mode 100644 index 000000000..ce5c7c0cf --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/number-range/aql/firstIncrement.aql @@ -0,0 +1,35 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_numberRange1 + IN @@numberRanges + FILTER (v_numberRange1._key == @var1) + LIMIT @var2 + RETURN v_numberRange1 + ) + UPDATE v_currentEntity1 + WITH { + "number": (v_currentEntity1.`number` + @var3), + "updatedAt": @var4 + } + IN @@numberRanges + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@numberRanges +LET v_numberRange1 = DOCUMENT(@@numberRanges, @var1) +RETURN (IS_NULL(v_numberRange1) ? null : { + "number": v_numberRange1.`number` +}) + +// -------------------------------- + +WITH @@numberRanges +RETURN { + "foundation": { + "updateNumberRange": @v_updateNumberRange1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/number-range/aql/secondIncrement.aql b/spec/regression/namespaced_logistics/tests/number-range/aql/secondIncrement.aql new file mode 100644 index 000000000..ce5c7c0cf --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/number-range/aql/secondIncrement.aql @@ -0,0 +1,35 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_numberRange1 + IN @@numberRanges + FILTER (v_numberRange1._key == @var1) + LIMIT @var2 + RETURN v_numberRange1 + ) + UPDATE v_currentEntity1 + WITH { + "number": (v_currentEntity1.`number` + @var3), + "updatedAt": @var4 + } + IN @@numberRanges + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@numberRanges +LET v_numberRange1 = DOCUMENT(@@numberRanges, @var1) +RETURN (IS_NULL(v_numberRange1) ? null : { + "number": v_numberRange1.`number` +}) + +// -------------------------------- + +WITH @@numberRanges +RETURN { + "foundation": { + "updateNumberRange": @v_updateNumberRange1 + } +} diff --git a/spec/regression/namespaced_logistics/tests/number-range.result.json b/spec/regression/namespaced_logistics/tests/number-range/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/number-range.result.json rename to spec/regression/namespaced_logistics/tests/number-range/result.json diff --git a/spec/regression/namespaced_logistics/tests/number-range.graphql b/spec/regression/namespaced_logistics/tests/number-range/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/number-range.graphql rename to spec/regression/namespaced_logistics/tests/number-range/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation1.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/addRelation2.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql new file mode 100644 index 000000000..3ea2471a0 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage1.aql @@ -0,0 +1,39 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) , (v_handlingUnit1._key) + LIMIT @var1 + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }), + @var2: JSON_STRINGIFY({ + "delivery_deliveryNumber": FIRST(( + FOR v_node3 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node3._key != null + RETURN v_node3 + )).`deliveryNumber`, + "id": v_handlingUnit1._key + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql new file mode 100644 index 000000000..93c66c297 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/aql/ascPage2.aql @@ -0,0 +1,73 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN UNION(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit2 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber` > @var1) + SORT (FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit2 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )).`deliveryNumber`) , (v_handlingUnit2._key) + LIMIT @var2 + RETURN v_handlingUnit2 + ), ( + FOR v_handlingUnit3 + IN @@handlingUnits + FILTER ((FIRST(( + FOR v_node3 + IN INBOUND v_handlingUnit3 @@deliveries_handlingUnits + FILTER v_node3._key != null + RETURN v_node3 + )).`deliveryNumber` == @var3) && (v_handlingUnit3._key > @var4)) + SORT (FIRST(( + FOR v_node4 + IN INBOUND v_handlingUnit3 @@deliveries_handlingUnits + FILTER v_node4._key != null + RETURN v_node4 + )).`deliveryNumber`) , (v_handlingUnit3._key) + LIMIT @var5 + RETURN v_handlingUnit3 + )) + SORT (FIRST(( + FOR v_node5 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node5._key != null + RETURN v_node5 + )).`deliveryNumber`) , (v_handlingUnit1._key) + LIMIT @var6 + LET v_delivery1 = FIRST(( + FOR v_node6 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node6._key != null + RETURN v_node6 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }), + @var7: JSON_STRINGIFY({ + "delivery_deliveryNumber": FIRST(( + FOR v_node7 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node7._key != null + RETURN v_node7 + )).`deliveryNumber`, + "id": v_handlingUnit1._key + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination.result.json b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination.result.json rename to spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/result.json diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination.graphql b/spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination.graphql rename to spec/regression/namespaced_logistics/tests/order-by-relation-with-pagination/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation1.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation1.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation1.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation2.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation2.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/addRelation2.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/asc.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/asc.aql new file mode 100644 index 000000000..2dd10b0d4 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/asc.aql @@ -0,0 +1,29 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/desc.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/desc.aql new file mode 100644 index 000000000..a3a79fd98 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/desc.aql @@ -0,0 +1,29 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`deliveryNumber`) DESC + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql new file mode 100644 index 000000000..1a18d27ca --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionAsc.aql @@ -0,0 +1,31 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`consignee`.`street`) + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "street": v_delivery1.`consignee`.`street` + }) + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql new file mode 100644 index 000000000..21f5a4ace --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/order-by-relation/aql/relationAndExtensionDesc.aql @@ -0,0 +1,31 @@ +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "allHandlingUnits": ( + FOR v_handlingUnit1 + IN @@handlingUnits + SORT (FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )).`consignee`.`street`) DESC + LET v_delivery1 = FIRST(( + FOR v_node2 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node2._key != null + RETURN v_node2 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery1) ? null : { + "consignee": (IS_NULL(v_delivery1.`consignee`) ? null : { + "street": v_delivery1.`consignee`.`street` + }) + }) + } + ) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation.result.json b/spec/regression/namespaced_logistics/tests/order-by-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/order-by-relation.result.json rename to spec/regression/namespaced_logistics/tests/order-by-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/order-by-relation.graphql b/spec/regression/namespaced_logistics/tests/order-by-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/order-by-relation.graphql rename to spec/regression/namespaced_logistics/tests/order-by-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/query-all/aql/queryAll.aql b/spec/regression/namespaced_logistics/tests/query-all/aql/queryAll.aql new file mode 100644 index 000000000..6b67c35e7 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/query-all/aql/queryAll.aql @@ -0,0 +1,21 @@ +RETURN { + "foundation": { + "allCountries": ( + FOR v_country1 + IN @@countries + SORT (v_country1.`isoCode`) + RETURN { + "id": v_country1._key, + "isoCode": v_country1.`isoCode`, + "description": ( + FOR v_translation1 + IN (IS_LIST(v_country1.`description`) ? v_country1.`description` : []) + RETURN { + "languageIsoCode": v_translation1.`languageIsoCode`, + "translation": v_translation1.`translation` + } + ) + } + ) + } +} diff --git a/spec/regression/namespaced_logistics/tests/query-all/result.json b/spec/regression/namespaced_logistics/tests/query-all/result.json new file mode 100644 index 000000000..947dc6211 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/query-all/result.json @@ -0,0 +1,66 @@ +{ + "queryAll": { + "data": { + "foundation": { + "allCountries": [ + { + "id": "@{ids/foundation.Country/4}", + "isoCode": "CH", + "description": [ + { + "languageIsoCode": "DE", + "translation": "Schweiz" + }, + { + "languageIsoCode": "EN", + "translation": "Switzerland" + } + ] + }, + { + "id": "@{ids/foundation.Country/1}", + "isoCode": "DE", + "description": [ + { + "languageIsoCode": "DE", + "translation": "Deutschland" + }, + { + "languageIsoCode": "EN", + "translation": "Germany" + } + ] + }, + { + "id": "@{ids/foundation.Country/2}", + "isoCode": "GB", + "description": [ + { + "languageIsoCode": "DE", + "translation": "Vereinigtes Königreich" + }, + { + "languageIsoCode": "EN", + "translation": "United Kingdom" + } + ] + }, + { + "id": "@{ids/foundation.Country/3}", + "isoCode": "US", + "description": [ + { + "languageIsoCode": "DE", + "translation": "Vereinigte Staaten" + }, + { + "languageIsoCode": "EN", + "translation": "United States" + } + ] + } + ] + } + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/query-all.graphql b/spec/regression/namespaced_logistics/tests/query-all/test.graphql similarity index 92% rename from spec/regression/namespaced_logistics/tests/query-all.graphql rename to spec/regression/namespaced_logistics/tests/query-all/test.graphql index d3fa80eed..a327ab2ca 100644 --- a/spec/regression/namespaced_logistics/tests/query-all.graphql +++ b/spec/regression/namespaced_logistics/tests/query-all/test.graphql @@ -1,4 +1,4 @@ -{ +query queryAll { foundation { allCountries(orderBy: isoCode_ASC) { id diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add.aql new file mode 100644 index 000000000..e1fc97374 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add.aql @@ -0,0 +1,61 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add2.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add2.aql new file mode 100644 index 000000000..e1fc97374 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/add2.aql @@ -0,0 +1,61 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN DOCUMENT(@@handlingUnits, @var1) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits, @@deliveries +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check1.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check1.aql new file mode 100644 index 000000000..c237ebda4 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check1.aql @@ -0,0 +1,34 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check2.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check2.aql new file mode 100644 index 000000000..e90665f65 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check2.aql @@ -0,0 +1,35 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + SORT (v_handlingUnit1.`huNumber`) + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check3.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check3.aql new file mode 100644 index 000000000..c237ebda4 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check3.aql @@ -0,0 +1,34 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check4.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check4.aql new file mode 100644 index 000000000..c237ebda4 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/check4.aql @@ -0,0 +1,34 @@ +WITH @@deliveries, @@handlingUnits +LET v_delivery1 = FIRST(( + FOR v_delivery2 + IN @@deliveries + FILTER (v_delivery2._key == @var1) + LIMIT @var2 + RETURN v_delivery2 +)) +RETURN { + "logistics": { + "delivery": { + "Delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber`, + "handlingUnits": ( + FOR v_handlingUnit1 + IN OUTBOUND v_delivery1 @@deliveries_handlingUnits + FILTER v_handlingUnit1._key != null + LET v_delivery3 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 + )) + RETURN { + "huNumber": v_handlingUnit1.`huNumber`, + "delivery": (IS_NULL(v_delivery3) ? null : { + "deliveryNumber": v_delivery3.`deliveryNumber` + }) + } + ) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove.aql new file mode 100644 index 000000000..245dec2e0 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove.aql @@ -0,0 +1,44 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_to1 IN @var2 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 && v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove2.aql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove2.aql new file mode 100644 index 000000000..245dec2e0 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/aql/remove2.aql @@ -0,0 +1,44 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_delivery1 + IN @@deliveries + FILTER (v_delivery1._key == @var1) + LIMIT @var2 + RETURN v_delivery1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@deliveries + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_from1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_to1 IN @var2 + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._from == v_from1 && v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries +LET v_delivery1 = DOCUMENT(@@deliveries, @var1) +RETURN (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` +}) + +// -------------------------------- + +WITH @@deliveries +RETURN { + "logistics": { + "delivery": { + "updateDelivery": @v_updateDelivery1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation.result.json b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/update-with-to-many-relation.result.json rename to spec/regression/namespaced_logistics/tests/update-with-to-many-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-many-relation.graphql b/spec/regression/namespaced_logistics/tests/update-with-to-many-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/update-with-to-many-relation.graphql rename to spec/regression/namespaced_logistics/tests/update-with-to-many-relation/test.graphql diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check1.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check1.aql new file mode 100644 index 000000000..7d5f5f71b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check1.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "logistics": { + "delivery": { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check2.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check2.aql new file mode 100644 index 000000000..7d5f5f71b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check2.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "logistics": { + "delivery": { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check3.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check3.aql new file mode 100644 index 000000000..7d5f5f71b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check3.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "logistics": { + "delivery": { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check4.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check4.aql new file mode 100644 index 000000000..7d5f5f71b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/check4.aql @@ -0,0 +1,25 @@ +WITH @@deliveries +LET v_handlingUnit1 = FIRST(( + FOR v_handlingUnit2 + IN @@handlingUnits + FILTER (v_handlingUnit2._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit2 +)) +LET v_delivery1 = FIRST(( + FOR v_node1 + IN INBOUND v_handlingUnit1 @@deliveries_handlingUnits + FILTER v_node1._key != null + RETURN v_node1 +)) +RETURN { + "logistics": { + "delivery": { + "HandlingUnit": (IS_NULL(v_handlingUnit1) ? null : { + "delivery": (IS_NULL(v_delivery1) ? null : { + "deliveryNumber": v_delivery1.`deliveryNumber` + }) + }) + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/leave.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/leave.aql new file mode 100644 index 000000000..5e4f2779b --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/leave.aql @@ -0,0 +1,34 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/replace.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/replace.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/replace.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/set.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/set.aql new file mode 100644 index 000000000..6027a65ac --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/set.aql @@ -0,0 +1,49 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@deliveries +RETURN DOCUMENT(@@deliveries, @var1) + +// -------------------------------- + +WITH @@deliveries +RETURN ( + UPSERT {_to: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: @var2, _to: CONCAT(@var3, FIRST(@v_updatedIds1))} + UPDATE {_from: @var4, _to: CONCAT(@var5, FIRST(@v_updatedIds1))} + IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@deliveries, @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/unset.aql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/unset.aql new file mode 100644 index 000000000..d61b676a1 --- /dev/null +++ b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/aql/unset.aql @@ -0,0 +1,43 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_handlingUnit1 + IN @@handlingUnits + FILTER (v_handlingUnit1._key == @var1) + LIMIT @var2 + RETURN v_handlingUnit1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@handlingUnits + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +RETURN ( + FOR v_to1 IN [CONCAT(@var1, FIRST(@v_updatedIds1))] + FOR v_edge1 IN @@deliveries_handlingUnits + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@deliveries_handlingUnits +) + +// -------------------------------- + +WITH @@handlingUnits +LET v_handlingUnit1 = DOCUMENT(@@handlingUnits, @var1) +RETURN (IS_NULL(v_handlingUnit1) ? null : { + "huNumber": v_handlingUnit1.`huNumber` +}) + +// -------------------------------- + +WITH @@handlingUnits +RETURN { + "logistics": { + "delivery": { + "updateHandlingUnit": @v_updateHandlingUnit1 + } + } +} diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation.result.json b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/result.json similarity index 100% rename from spec/regression/namespaced_logistics/tests/update-with-to-one-relation.result.json rename to spec/regression/namespaced_logistics/tests/update-with-to-one-relation/result.json diff --git a/spec/regression/namespaced_logistics/tests/update-with-to-one-relation.graphql b/spec/regression/namespaced_logistics/tests/update-with-to-one-relation/test.graphql similarity index 100% rename from spec/regression/namespaced_logistics/tests/update-with-to-one-relation.graphql rename to spec/regression/namespaced_logistics/tests/update-with-to-one-relation/test.graphql diff --git a/spec/regression/no-root-entity-order-by/tests/introspection.result.json b/spec/regression/no-root-entity-order-by/tests/introspection.result.json deleted file mode 100644 index 3c24464eb..000000000 --- a/spec/regression/no-root-entity-order-by/tests/introspection.result.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "data": { - "shipmentDataOrderByType": null, - "shipmentOrderByType": { - "name": "ShipmentOrderBy" - }, - "deliveryType": { - "fields": [ - { - "name": "id", - "args": [] - }, - { - "name": "createdAt", - "args": [] - }, - { - "name": "updatedAt", - "args": [] - }, - { - "name": "deliveryNumber", - "args": [] - }, - { - "name": "orderDatas", - "args": [ - { - "name": "filter", - "type": { - "name": "ShipmentDataFilter", - "ofType": null - } - }, - { - "name": "skip", - "type": { - "name": "Int", - "ofType": null - } - }, - { - "name": "first", - "type": { - "name": "Int", - "ofType": null - } - } - ] - }, - { - "name": "_orderDatasMeta", - "args": [ - { - "name": "filter", - "type": { - "name": "ShipmentDataFilter", - "ofType": null - } - } - ] - }, - { - "name": "orders", - "args": [ - { - "name": "filter", - "type": { - "name": "ShipmentFilter", - "ofType": null - } - }, - { - "name": "orderBy", - "type": { - "name": null, - "ofType": { - "name": null, - "ofType": { - "name": "ShipmentOrderBy" - } - } - } - }, - { - "name": "after", - "type": { - "name": "String", - "ofType": null - } - }, - { - "name": "skip", - "type": { - "name": "Int", - "ofType": null - } - }, - { - "name": "first", - "type": { - "name": "Int", - "ofType": null - } - } - ] - }, - { - "name": "_ordersMeta", - "args": [ - { - "name": "filter", - "type": { - "name": "ShipmentFilter", - "ofType": null - } - } - ] - }, - { - "name": "_cursor", - "args": [] - }, - { - "name": "_revision", - "args": [] - } - ] - } - } -} diff --git a/spec/regression/no-root-entity-order-by/tests/introspection/result.json b/spec/regression/no-root-entity-order-by/tests/introspection/result.json new file mode 100644 index 000000000..29c4b5c6b --- /dev/null +++ b/spec/regression/no-root-entity-order-by/tests/introspection/result.json @@ -0,0 +1,141 @@ +{ + "typeDoesNotExist": { + "data": { + "shipmentDataOrderByType": null + } + }, + "typeExists": { + "data": { + "shipmentOrderByType": { + "name": "ShipmentOrderBy" + } + } + }, + "fields": { + "data": { + "deliveryType": { + "fields": [ + { + "name": "id", + "args": [] + }, + { + "name": "createdAt", + "args": [] + }, + { + "name": "updatedAt", + "args": [] + }, + { + "name": "deliveryNumber", + "args": [] + }, + { + "name": "orderDatas", + "args": [ + { + "name": "filter", + "type": { + "name": "ShipmentDataFilter", + "ofType": null + } + }, + { + "name": "skip", + "type": { + "name": "Int", + "ofType": null + } + }, + { + "name": "first", + "type": { + "name": "Int", + "ofType": null + } + } + ] + }, + { + "name": "_orderDatasMeta", + "args": [ + { + "name": "filter", + "type": { + "name": "ShipmentDataFilter", + "ofType": null + } + } + ] + }, + { + "name": "orders", + "args": [ + { + "name": "filter", + "type": { + "name": "ShipmentFilter", + "ofType": null + } + }, + { + "name": "orderBy", + "type": { + "name": null, + "ofType": { + "name": null, + "ofType": { + "name": "ShipmentOrderBy" + } + } + } + }, + { + "name": "after", + "type": { + "name": "String", + "ofType": null + } + }, + { + "name": "skip", + "type": { + "name": "Int", + "ofType": null + } + }, + { + "name": "first", + "type": { + "name": "Int", + "ofType": null + } + } + ] + }, + { + "name": "_ordersMeta", + "args": [ + { + "name": "filter", + "type": { + "name": "ShipmentFilter", + "ofType": null + } + } + ] + }, + { + "name": "_cursor", + "args": [] + }, + { + "name": "_revision", + "args": [] + } + ] + } + } + } +} diff --git a/spec/regression/no-root-entity-order-by/tests/introspection.graphql b/spec/regression/no-root-entity-order-by/tests/introspection/test.graphql similarity index 81% rename from spec/regression/no-root-entity-order-by/tests/introspection.graphql rename to spec/regression/no-root-entity-order-by/tests/introspection/test.graphql index 91b285805..457f09d3c 100644 --- a/spec/regression/no-root-entity-order-by/tests/introspection.graphql +++ b/spec/regression/no-root-entity-order-by/tests/introspection/test.graphql @@ -1,15 +1,17 @@ -{ - # should not exist +query typeDoesNotExist { shipmentDataOrderByType: __type(name: "ShipmentDataOrderBy") { name } +} - # should exist +query typeExists { shipmentOrderByType: __type(name: "ShipmentOrderBy") { name } +} - # should not include orderBy for shipmentDatas, but for shipments +# should not include orderBy for shipmentDatas, but for shipments +query fields { deliveryType: __type(name: "Delivery") { fields { name diff --git a/spec/regression/papers/tests/count-first.result.json b/spec/regression/papers/tests/count-first.result.json deleted file mode 100644 index 5c666e9a9..000000000 --- a/spec/regression/papers/tests/count-first.result.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "data": { - "_allPapersMeta": { - "count": 2 - } - } -} diff --git a/spec/regression/papers/tests/count-first/aql/countWithFirst.aql b/spec/regression/papers/tests/count-first/aql/countWithFirst.aql new file mode 100644 index 000000000..80b8b2cf6 --- /dev/null +++ b/spec/regression/papers/tests/count-first/aql/countWithFirst.aql @@ -0,0 +1,15 @@ +RETURN { + @var1: { + "count": FIRST( + FOR v_item1 + IN ( + FOR v_item2 + IN @@papers + LIMIT @var2 + RETURN v_item2 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } +} diff --git a/spec/regression/papers/tests/count-first/result.json b/spec/regression/papers/tests/count-first/result.json new file mode 100644 index 000000000..8d1d22c32 --- /dev/null +++ b/spec/regression/papers/tests/count-first/result.json @@ -0,0 +1,9 @@ +{ + "countWithFirst": { + "data": { + "_allPapersMeta": { + "count": 2 + } + } + } +} diff --git a/spec/regression/papers/tests/count-first.graphql b/spec/regression/papers/tests/count-first/test.graphql similarity index 69% rename from spec/regression/papers/tests/count-first.graphql rename to spec/regression/papers/tests/count-first/test.graphql index e2bf1d5f2..2a555da15 100644 --- a/spec/regression/papers/tests/count-first.graphql +++ b/spec/regression/papers/tests/count-first/test.graphql @@ -1,4 +1,4 @@ -{ +query countWithFirst { _allPapersMeta(first: 2) { count } diff --git a/spec/regression/papers/tests/count.result.json b/spec/regression/papers/tests/count.result.json deleted file mode 100644 index 2eff56341..000000000 --- a/spec/regression/papers/tests/count.result.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": { - "Paper": { - "_literatureReferencesMeta": { - "count": 1 - } - }, - "_allPapersMeta": { - "count": 5 - } - } -} diff --git a/spec/regression/papers/tests/count/aql/count.aql b/spec/regression/papers/tests/count/aql/count.aql new file mode 100644 index 000000000..110b2481a --- /dev/null +++ b/spec/regression/papers/tests/count/aql/count.aql @@ -0,0 +1,22 @@ +LET v_paper1 = FIRST(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2._key == @var1) + LIMIT @var2 + RETURN v_paper2 +)) +RETURN { + @var3: { + "count": LENGTH(@@papers) + }, + "Paper": (IS_NULL(v_paper1) ? null : { + @var4: { + "count": FIRST( + FOR v_item1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + } + }) +} diff --git a/spec/regression/papers/tests/count/result.json b/spec/regression/papers/tests/count/result.json new file mode 100644 index 000000000..be5d9d6fd --- /dev/null +++ b/spec/regression/papers/tests/count/result.json @@ -0,0 +1,14 @@ +{ + "count": { + "data": { + "_allPapersMeta": { + "count": 5 + }, + "Paper": { + "_literatureReferencesMeta": { + "count": 1 + } + } + } + } +} diff --git a/spec/regression/papers/tests/count.graphql b/spec/regression/papers/tests/count/test.graphql similarity index 91% rename from spec/regression/papers/tests/count.graphql rename to spec/regression/papers/tests/count/test.graphql index 99a6c335f..2a6f354ca 100644 --- a/spec/regression/papers/tests/count.graphql +++ b/spec/regression/papers/tests/count/test.graphql @@ -1,4 +1,4 @@ -{ +query count { _allPapersMeta { count } diff --git a/spec/regression/papers/tests/filter.result.json b/spec/regression/papers/tests/filter.result.json deleted file mode 100644 index 9e42034f0..000000000 --- a/spec/regression/papers/tests/filter.result.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "data": { - "eq": [ - { - "key": "OOM" - } - ], - "neq": [ - { - "key": "NoSQL" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "gt": [ - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "gte": [ - { - "key": "OOM" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "lt": [ - { - "key": "NoSQL" - } - ], - "lte": [ - { - "key": "NoSQL" - }, - { - "key": "OOM" - } - ], - "in": [ - { - "key": "OOM" - }, - { - "key": "Part" - } - ], - "not_in": [ - { - "key": "NoSQL" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "contains": [ - { - "key": "Part" - }, - { - "key": "Scal" - } - ], - "contains_empty_string": [ - { - "key": "NoSQL" - }, - { - "key": "OOM" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "not_contains": [ - { - "key": "NoSQL" - }, - { - "key": "OOM" - }, - { - "key": "UML" - } - ], - "not_contains_empty_string": [], - "starts_with": [ - { - "key": "OOM" - } - ], - "not_starts_with": [ - { - "key": "NoSQL" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "ends_with": [ - { - "key": "OOM" - } - ], - "not_ends_with": [ - { - "key": "NoSQL" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "like_prefix": [ - { - "key": "OOM" - } - ], - "like_underscore": [ - { - "key": "OOM" - } - ], - "like_not_matching": [], - "like_upper_matching_lower_prefix": [ - { - "key": "Part" - } - ], - "like_lower_matching_upper_prefix": [ - { - "key": "Part" - } - ], - "like_upper_matching_lower_exact": [ - { - "key": "Part" - } - ], - "like_lower_matching_upper_exact": [ - { - "key": "Part" - } - ], - "like_upper_matching_lower_pattern": [ - { - "key": "Part" - } - ], - "like_lower_matching_upper_pattern": [ - { - "key": "Part" - } - ], - "not_like": [ - { - "key": "NoSQL" - }, - { - "key": "Part" - }, - { - "key": "Scal" - }, - { - "key": "UML" - } - ], - "or": [ - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - } - ], - "enum_in": [ - { - "lastName": "Doe" - }, - { - "lastName": "Lynch" - } - ], - "enum_not_in": [ - { - "lastName": "Gilbert" - }, - { - "lastName": "Mustermann" - } - ], - "enum_equal": [ - { - "lastName": "Lynch", - "category": "Telecommunications" - } - ], - "enum_not_equal": [ - { - "lastName": "Doe", - "category": "Programming" - }, - { - "lastName": "Gilbert", - "category": null - }, - { - "lastName": "Mustermann", - "category": null - } - ] - } -} diff --git a/spec/regression/papers/tests/filter/aql/contains.aql b/spec/regression/papers/tests/filter/aql/contains.aql new file mode 100644 index 000000000..1b16950b0 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/contains.aql @@ -0,0 +1,11 @@ +RETURN { + "contains": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` LIKE CONCAT("%", @var1, "%")) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/contains_empty_string.aql b/spec/regression/papers/tests/filter/aql/contains_empty_string.aql new file mode 100644 index 000000000..1adeeae16 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/contains_empty_string.aql @@ -0,0 +1,11 @@ +RETURN { + "contains_empty_string": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` LIKE CONCAT("%", @var1, "%")) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/ends_with.aql b/spec/regression/papers/tests/filter/aql/ends_with.aql new file mode 100644 index 000000000..62f4c09ff --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/ends_with.aql @@ -0,0 +1,11 @@ +RETURN { + "ends_with": ( + FOR v_paper1 + IN @@papers + FILTER (RIGHT(v_paper1.`key`, LENGTH(@var1)) == @var2) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/enums.aql b/spec/regression/papers/tests/filter/aql/enums.aql new file mode 100644 index 000000000..457effa1b --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/enums.aql @@ -0,0 +1,40 @@ +RETURN { + "enum_in": ( + FOR v_user1 + IN @@users + FILTER (v_user1.`category` IN @var1) + SORT (v_user1.`lastName`) + RETURN { + "lastName": v_user1.`lastName` + } + ), + "enum_not_in": ( + FOR v_user2 + IN @@users + FILTER !((v_user2.`category` IN @var2)) + SORT (v_user2.`lastName`) + RETURN { + "lastName": v_user2.`lastName` + } + ), + "enum_equal": ( + FOR v_user3 + IN @@users + FILTER (v_user3.`category` == @var3) + SORT (v_user3.`lastName`) + RETURN { + "lastName": v_user3.`lastName`, + "category": v_user3.`category` + } + ), + "enum_not_equal": ( + FOR v_user4 + IN @@users + FILTER (v_user4.`category` != @var4) + SORT (v_user4.`lastName`) + RETURN { + "lastName": v_user4.`lastName`, + "category": v_user4.`category` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/eq.aql b/spec/regression/papers/tests/filter/aql/eq.aql new file mode 100644 index 000000000..a86635698 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/eq.aql @@ -0,0 +1,11 @@ +RETURN { + "eq": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` == @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/gt.aql b/spec/regression/papers/tests/filter/aql/gt.aql new file mode 100644 index 000000000..a671af9c0 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/gt.aql @@ -0,0 +1,11 @@ +RETURN { + "gt": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` > @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/gte.aql b/spec/regression/papers/tests/filter/aql/gte.aql new file mode 100644 index 000000000..4f0afdbad --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/gte.aql @@ -0,0 +1,11 @@ +RETURN { + "gte": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` >= @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/in.aql b/spec/regression/papers/tests/filter/aql/in.aql new file mode 100644 index 000000000..a792ad9ba --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/in.aql @@ -0,0 +1,11 @@ +RETURN { + "in": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` IN @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/like.aql b/spec/regression/papers/tests/filter/aql/like.aql new file mode 100644 index 000000000..ab12f1de4 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/like.aql @@ -0,0 +1,83 @@ +RETURN { + "like_prefix": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` >= UPPER(@var1) && v_paper1.`key` < LOWER(@var2)) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ), + "like_underscore": ( + FOR v_paper2 + IN @@papers + FILTER ((v_paper2.`key` >= UPPER(@var3) && v_paper2.`key` < LOWER(@var4)) && LIKE(v_paper2.`key`, @var5, true)) + SORT (v_paper2.`key`) + RETURN { + "key": v_paper2.`key` + } + ), + "like_not_matching": ( + FOR v_paper3 + IN @@papers + FILTER ((v_paper3.`key` >= UPPER(@var6) && v_paper3.`key` < LOWER(@var7)) && LIKE(v_paper3.`key`, @var8, true)) + SORT (v_paper3.`key`) + RETURN { + "key": v_paper3.`key` + } + ), + "like_upper_matching_lower_prefix": ( + FOR v_paper4 + IN @@papers + FILTER (v_paper4.`key` >= UPPER(@var9) && v_paper4.`key` < LOWER(@var10)) + SORT (v_paper4.`key`) + RETURN { + "key": v_paper4.`key` + } + ), + "like_lower_matching_upper_prefix": ( + FOR v_paper5 + IN @@papers + FILTER (v_paper5.`key` >= UPPER(@var11) && v_paper5.`key` < LOWER(@var12)) + SORT (v_paper5.`key`) + RETURN { + "key": v_paper5.`key` + } + ), + "like_upper_matching_lower_exact": ( + FOR v_paper6 + IN @@papers + FILTER (v_paper6.`key` >= UPPER(@var13) && v_paper6.`key` <= LOWER(@var14)) + SORT (v_paper6.`key`) + RETURN { + "key": v_paper6.`key` + } + ), + "like_lower_matching_upper_exact": ( + FOR v_paper7 + IN @@papers + FILTER (v_paper7.`key` >= UPPER(@var15) && v_paper7.`key` <= LOWER(@var16)) + SORT (v_paper7.`key`) + RETURN { + "key": v_paper7.`key` + } + ), + "like_upper_matching_lower_pattern": ( + FOR v_paper8 + IN @@papers + FILTER (IS_STRING(v_paper8.`key`) && LIKE(v_paper8.`key`, @var17, true)) + SORT (v_paper8.`key`) + RETURN { + "key": v_paper8.`key` + } + ), + "like_lower_matching_upper_pattern": ( + FOR v_paper9 + IN @@papers + FILTER (IS_STRING(v_paper9.`key`) && LIKE(v_paper9.`key`, @var18, true)) + SORT (v_paper9.`key`) + RETURN { + "key": v_paper9.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/lt.aql b/spec/regression/papers/tests/filter/aql/lt.aql new file mode 100644 index 000000000..b024e8e57 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/lt.aql @@ -0,0 +1,11 @@ +RETURN { + "lt": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` < @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/lte.aql b/spec/regression/papers/tests/filter/aql/lte.aql new file mode 100644 index 000000000..ba954e52d --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/lte.aql @@ -0,0 +1,11 @@ +RETURN { + "lte": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` <= @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/neq.aql b/spec/regression/papers/tests/filter/aql/neq.aql new file mode 100644 index 000000000..7304f4c31 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/neq.aql @@ -0,0 +1,11 @@ +RETURN { + "neq": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` != @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_contains.aql b/spec/regression/papers/tests/filter/aql/not_contains.aql new file mode 100644 index 000000000..adca2cae7 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_contains.aql @@ -0,0 +1,11 @@ +RETURN { + "not_contains": ( + FOR v_paper1 + IN @@papers + FILTER !((v_paper1.`key` LIKE CONCAT("%", @var1, "%"))) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_contains_empty_string.aql b/spec/regression/papers/tests/filter/aql/not_contains_empty_string.aql new file mode 100644 index 000000000..ee70ef94f --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_contains_empty_string.aql @@ -0,0 +1,11 @@ +RETURN { + "not_contains_empty_string": ( + FOR v_paper1 + IN @@papers + FILTER !((v_paper1.`key` LIKE CONCAT("%", @var1, "%"))) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_ends_with.aql b/spec/regression/papers/tests/filter/aql/not_ends_with.aql new file mode 100644 index 000000000..db0cd7a48 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_ends_with.aql @@ -0,0 +1,11 @@ +RETURN { + "not_ends_with": ( + FOR v_paper1 + IN @@papers + FILTER !((RIGHT(v_paper1.`key`, LENGTH(@var1)) == @var2)) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_in.aql b/spec/regression/papers/tests/filter/aql/not_in.aql new file mode 100644 index 000000000..48c2fc2dc --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_in.aql @@ -0,0 +1,11 @@ +RETURN { + "not_in": ( + FOR v_paper1 + IN @@papers + FILTER !((v_paper1.`key` IN @var1)) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_like.aql b/spec/regression/papers/tests/filter/aql/not_like.aql new file mode 100644 index 000000000..7fdddba43 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_like.aql @@ -0,0 +1,11 @@ +RETURN { + "not_like": ( + FOR v_paper1 + IN @@papers + FILTER !((v_paper1.`key` >= UPPER(@var1) && v_paper1.`key` < LOWER(@var2))) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/not_starts_with.aql b/spec/regression/papers/tests/filter/aql/not_starts_with.aql new file mode 100644 index 000000000..1cf5fa34b --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/not_starts_with.aql @@ -0,0 +1,11 @@ +RETURN { + "not_starts_with": ( + FOR v_paper1 + IN @@papers + FILTER !((v_paper1.`key` >= UPPER(@var1) && v_paper1.`key` < LOWER(@var2)) && (LEFT(v_paper1.`key`, LENGTH(@var3)) == @var4)) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/or.aql b/spec/regression/papers/tests/filter/aql/or.aql new file mode 100644 index 000000000..34c81bfa2 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/or.aql @@ -0,0 +1,11 @@ +RETURN { + "or": ( + FOR v_paper1 + IN @@papers + FILTER ((v_paper1.`title` == @var1) || (v_paper1.`title` == @var2)) + SORT (v_paper1.`title`) + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/filter/aql/starts_with.aql b/spec/regression/papers/tests/filter/aql/starts_with.aql new file mode 100644 index 000000000..cf389d060 --- /dev/null +++ b/spec/regression/papers/tests/filter/aql/starts_with.aql @@ -0,0 +1,11 @@ +RETURN { + "starts_with": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`key` >= UPPER(@var1) && v_paper1.`key` < LOWER(@var2)) && (LEFT(v_paper1.`key`, LENGTH(@var3)) == @var4) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/filter/result.json b/spec/regression/papers/tests/filter/result.json new file mode 100644 index 000000000..0b057c065 --- /dev/null +++ b/spec/regression/papers/tests/filter/result.json @@ -0,0 +1,332 @@ +{ + "eq": { + "data": { + "eq": [ + { + "key": "OOM" + } + ] + } + }, + "neq": { + "data": { + "neq": [ + { + "key": "NoSQL" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "gt": { + "data": { + "gt": [ + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "gte": { + "data": { + "gte": [ + { + "key": "OOM" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "lt": { + "data": { + "lt": [ + { + "key": "NoSQL" + } + ] + } + }, + "lte": { + "data": { + "lte": [ + { + "key": "NoSQL" + }, + { + "key": "OOM" + } + ] + } + }, + "in": { + "data": { + "in": [ + { + "key": "OOM" + }, + { + "key": "Part" + } + ] + } + }, + "not_in": { + "data": { + "not_in": [ + { + "key": "NoSQL" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "contains": { + "data": { + "contains": [ + { + "key": "Part" + }, + { + "key": "Scal" + } + ] + } + }, + "contains_empty_string": { + "data": { + "contains_empty_string": [ + { + "key": "NoSQL" + }, + { + "key": "OOM" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "not_contains": { + "data": { + "not_contains": [ + { + "key": "NoSQL" + }, + { + "key": "OOM" + }, + { + "key": "UML" + } + ] + } + }, + "not_contains_empty_string": { + "data": { + "not_contains_empty_string": [] + } + }, + "starts_with": { + "data": { + "starts_with": [ + { + "key": "OOM" + } + ] + } + }, + "not_starts_with": { + "data": { + "not_starts_with": [ + { + "key": "NoSQL" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "ends_with": { + "data": { + "ends_with": [ + { + "key": "OOM" + } + ] + } + }, + "not_ends_with": { + "data": { + "not_ends_with": [ + { + "key": "NoSQL" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "like": { + "data": { + "like_prefix": [ + { + "key": "OOM" + } + ], + "like_underscore": [ + { + "key": "OOM" + } + ], + "like_not_matching": [], + "like_upper_matching_lower_prefix": [ + { + "key": "Part" + } + ], + "like_lower_matching_upper_prefix": [ + { + "key": "Part" + } + ], + "like_upper_matching_lower_exact": [ + { + "key": "Part" + } + ], + "like_lower_matching_upper_exact": [ + { + "key": "Part" + } + ], + "like_upper_matching_lower_pattern": [ + { + "key": "Part" + } + ], + "like_lower_matching_upper_pattern": [ + { + "key": "Part" + } + ] + } + }, + "not_like": { + "data": { + "not_like": [ + { + "key": "NoSQL" + }, + { + "key": "Part" + }, + { + "key": "Scal" + }, + { + "key": "UML" + } + ] + } + }, + "or": { + "data": { + "or": [ + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + } + ] + } + }, + "enums": { + "data": { + "enum_in": [ + { + "lastName": "Doe" + }, + { + "lastName": "Lynch" + } + ], + "enum_not_in": [ + { + "lastName": "Gilbert" + }, + { + "lastName": "Mustermann" + } + ], + "enum_equal": [ + { + "lastName": "Lynch", + "category": "Telecommunications" + } + ], + "enum_not_equal": [ + { + "lastName": "Doe", + "category": "Programming" + }, + { + "lastName": "Gilbert", + "category": null + }, + { + "lastName": "Mustermann", + "category": null + } + ] + } + } +} diff --git a/spec/regression/papers/tests/filter.graphql b/spec/regression/papers/tests/filter/test.graphql similarity index 89% rename from spec/regression/papers/tests/filter.graphql rename to spec/regression/papers/tests/filter/test.graphql index 2d193bd97..4b3e21cd2 100644 --- a/spec/regression/papers/tests/filter.graphql +++ b/spec/regression/papers/tests/filter/test.graphql @@ -1,52 +1,100 @@ -query { +query eq { eq: allPapers(filter: { key: "OOM" }, orderBy: key_ASC) { key } +} + +query neq { neq: allPapers(filter: { key_not: "OOM" }, orderBy: key_ASC) { key } +} + +query gt { gt: allPapers(filter: { key_gt: "OOM" }, orderBy: key_ASC) { key } +} + +query gte { gte: allPapers(filter: { key_gte: "OOM" }, orderBy: key_ASC) { key } +} + +query lt { lt: allPapers(filter: { key_lt: "OOM" }, orderBy: key_ASC) { key } +} + +query lte { lte: allPapers(filter: { key_lte: "OOM" }, orderBy: key_ASC) { key } +} + +query in { in: allPapers(filter: { key_in: ["OOM", "Part"] }, orderBy: key_ASC) { key } +} + +query not_in { not_in: allPapers(filter: { key_not_in: ["OOM", "Part"] }, orderBy: key_ASC) { key } +} + +query contains { contains: allPapers(filter: { key_contains: "a" }, orderBy: key_ASC) { key } +} + +query contains_empty_string { contains_empty_string: allPapers(filter: { key_contains: "" }, orderBy: key_ASC) { key } +} + +query not_contains { not_contains: allPapers(filter: { key_not_contains: "a" }, orderBy: key_ASC) { key } +} + +query not_contains_empty_string { not_contains_empty_string: allPapers(filter: { key_not_contains: "" }, orderBy: key_ASC) { key } +} + +query starts_with { starts_with: allPapers(filter: { key_starts_with: "O" }, orderBy: key_ASC) { key } +} + +query not_starts_with { not_starts_with: allPapers(filter: { key_not_starts_with: "O" }, orderBy: key_ASC) { key } +} + +query ends_with { ends_with: allPapers(filter: { key_ends_with: "M" }, orderBy: key_ASC) { key } +} + +query not_ends_with { not_ends_with: allPapers(filter: { key_not_ends_with: "M" }, orderBy: key_ASC) { key } +} + +query like { like_prefix: allPapers(filter: { key_like: "o%" }, orderBy: key_ASC) { key } @@ -74,9 +122,15 @@ query { like_lower_matching_upper_pattern: allPapers(filter: { key_like: "%part" }, orderBy: key_ASC) { key } +} + +query not_like { not_like: allPapers(filter: { key_not_like: "O%" }, orderBy: key_ASC) { key } +} + +query or { or: allPapers( filter: { OR: [ @@ -88,7 +142,9 @@ query { ) { title } +} +query enums { enum_in: allUsers( filter: { category_in: [Telecommunications, Programming] } orderBy: lastName_ASC diff --git a/spec/regression/papers/tests/invalid-cursors-node20/aql/invalidJSON.aql b/spec/regression/papers/tests/invalid-cursors-node20/aql/invalidJSON.aql new file mode 100644 index 000000000..7dffef838 --- /dev/null +++ b/spec/regression/papers/tests/invalid-cursors-node20/aql/invalidJSON.aql @@ -0,0 +1,3 @@ +RETURN { + "allPapers": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/papers/tests/invalid-cursors-node20/aql/missingProperty.aql b/spec/regression/papers/tests/invalid-cursors-node20/aql/missingProperty.aql new file mode 100644 index 000000000..df427adcb --- /dev/null +++ b/spec/regression/papers/tests/invalid-cursors-node20/aql/missingProperty.aql @@ -0,0 +1,13 @@ +LET v_paper1 = FIRST(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2._key == @var1) + LIMIT @var2 + RETURN v_paper2 +)) +RETURN { + "Paper": (IS_NULL(v_paper1) ? null : { + "title": v_paper1.`title` + }), + "allPapers": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 } +} diff --git a/spec/regression/papers/tests/invalid-cursors-node20/aql/nonObjectJSON.aql b/spec/regression/papers/tests/invalid-cursors-node20/aql/nonObjectJSON.aql new file mode 100644 index 000000000..7dffef838 --- /dev/null +++ b/spec/regression/papers/tests/invalid-cursors-node20/aql/nonObjectJSON.aql @@ -0,0 +1,3 @@ +RETURN { + "allPapers": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } +} diff --git a/spec/regression/papers/tests/invalid-cursors-node20.meta.json b/spec/regression/papers/tests/invalid-cursors-node20/meta.json similarity index 100% rename from spec/regression/papers/tests/invalid-cursors-node20.meta.json rename to spec/regression/papers/tests/invalid-cursors-node20/meta.json diff --git a/spec/regression/papers/tests/invalid-cursors-node20.result.json b/spec/regression/papers/tests/invalid-cursors-node20/result.json similarity index 100% rename from spec/regression/papers/tests/invalid-cursors-node20.result.json rename to spec/regression/papers/tests/invalid-cursors-node20/result.json diff --git a/spec/regression/papers/tests/invalid-cursors-node20.graphql b/spec/regression/papers/tests/invalid-cursors-node20/test.graphql similarity index 100% rename from spec/regression/papers/tests/invalid-cursors-node20.graphql rename to spec/regression/papers/tests/invalid-cursors-node20/test.graphql diff --git a/spec/regression/papers/tests/invalid-cursors.meta.json b/spec/regression/papers/tests/invalid-cursors/meta.json similarity index 100% rename from spec/regression/papers/tests/invalid-cursors.meta.json rename to spec/regression/papers/tests/invalid-cursors/meta.json diff --git a/spec/regression/papers/tests/invalid-cursors.result.json b/spec/regression/papers/tests/invalid-cursors/result.json similarity index 100% rename from spec/regression/papers/tests/invalid-cursors.result.json rename to spec/regression/papers/tests/invalid-cursors/result.json diff --git a/spec/regression/papers/tests/invalid-cursors.graphql b/spec/regression/papers/tests/invalid-cursors/test.graphql similarity index 100% rename from spec/regression/papers/tests/invalid-cursors.graphql rename to spec/regression/papers/tests/invalid-cursors/test.graphql diff --git a/spec/regression/papers/tests/no-attributes.graphql b/spec/regression/papers/tests/no-attributes.graphql deleted file mode 100644 index 60a78a460..000000000 --- a/spec/regression/papers/tests/no-attributes.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query { - onlyCursor: allPapers(first: 3, orderBy: key_ASC) { - _cursor - } - onlyCursorNoLimit: allPapers(orderBy: key_ASC) { - _cursor - } -} diff --git a/spec/regression/papers/tests/no-attributes.result.json b/spec/regression/papers/tests/no-attributes.result.json deleted file mode 100644 index c7fe0ee2b..000000000 --- a/spec/regression/papers/tests/no-attributes.result.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "data": { - "onlyCursor": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}" - } - ], - "onlyCursorNoLimit": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"key\":\"Scal\"}" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"key\":\"UML\"}" - } - ] - } -} diff --git a/spec/regression/papers/tests/no-attributes/aql/onlyCursor.aql b/spec/regression/papers/tests/no-attributes/aql/onlyCursor.aql new file mode 100644 index 000000000..a7442c75e --- /dev/null +++ b/spec/regression/papers/tests/no-attributes/aql/onlyCursor.aql @@ -0,0 +1,14 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`key`) , (v_paper1._key) + LIMIT @var1 + RETURN { + @var2: JSON_STRINGIFY({ + "id": v_paper1._key, + "key": v_paper1.`key` + }) + } + ) +} diff --git a/spec/regression/papers/tests/no-attributes/aql/onlyCursorNoLimit.aql b/spec/regression/papers/tests/no-attributes/aql/onlyCursorNoLimit.aql new file mode 100644 index 000000000..4bf809a49 --- /dev/null +++ b/spec/regression/papers/tests/no-attributes/aql/onlyCursorNoLimit.aql @@ -0,0 +1,13 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`key`) , (v_paper1._key) + RETURN { + @var1: JSON_STRINGIFY({ + "id": v_paper1._key, + "key": v_paper1.`key` + }) + } + ) +} diff --git a/spec/regression/papers/tests/no-attributes/result.json b/spec/regression/papers/tests/no-attributes/result.json new file mode 100644 index 000000000..635b1d31c --- /dev/null +++ b/spec/regression/papers/tests/no-attributes/result.json @@ -0,0 +1,38 @@ +{ + "onlyCursor": { + "data": { + "allPapers": [ + { + "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}" + } + ] + } + }, + "onlyCursorNoLimit": { + "data": { + "allPapers": [ + { + "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"key\":\"Scal\"}" + }, + { + "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"key\":\"UML\"}" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/no-attributes/test.graphql b/spec/regression/papers/tests/no-attributes/test.graphql new file mode 100644 index 000000000..ec19d6c29 --- /dev/null +++ b/spec/regression/papers/tests/no-attributes/test.graphql @@ -0,0 +1,11 @@ +query onlyCursor { + allPapers(first: 3, orderBy: key_ASC) { + _cursor + } +} + +query onlyCursorNoLimit { + allPapers(orderBy: key_ASC) { + _cursor + } +} diff --git a/spec/regression/papers/tests/pagination-combinations.result.json b/spec/regression/papers/tests/pagination-combinations.result.json deleted file mode 100644 index a8af89770..000000000 --- a/spec/regression/papers/tests/pagination-combinations.result.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "data": { - "all": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - }, - { - "title": "Object-oriented modeling and design" - }, - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "skip": [ - { - "title": "Object-oriented modeling and design" - }, - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "skipAndFirst": [ - { - "title": "Object-oriented modeling and design" - } - ], - "first": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - } - ], - "after": [ - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "afterAndSkip": [ - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "afterAndFirst": [ - { - "title": "Scalable SQL and NoSQL data stores" - } - ], - "afterAndSkipAndFirst": [ - { - "title": "Unified modeling language reference manual, the" - } - ] - } -} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/after.aql b/spec/regression/papers/tests/pagination-combinations/aql/after.aql new file mode 100644 index 000000000..3f7acc28d --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/after.aql @@ -0,0 +1,11 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER ((v_paper1.`title` > @var1) || ((v_paper1.`title` == @var2) && (v_paper1._key > @var3))) + SORT (v_paper1.`title`) , (v_paper1._key) + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/afterAndFirst.aql b/spec/regression/papers/tests/pagination-combinations/aql/afterAndFirst.aql new file mode 100644 index 000000000..770a552b1 --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/afterAndFirst.aql @@ -0,0 +1,25 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN UNION(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`title` > @var1) + SORT (v_paper2.`title`) , (v_paper2._key) + LIMIT @var2 + RETURN v_paper2 + ), ( + FOR v_paper3 + IN @@papers + FILTER ((v_paper3.`title` == @var3) && (v_paper3._key > @var4)) + SORT (v_paper3.`title`) , (v_paper3._key) + LIMIT @var5 + RETURN v_paper3 + )) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var6 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkip.aql b/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkip.aql new file mode 100644 index 000000000..119da7e4a --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkip.aql @@ -0,0 +1,12 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER ((v_paper1.`title` > @var1) || ((v_paper1.`title` == @var2) && (v_paper1._key > @var3))) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var4, @var5 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkipAndFirst.aql b/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkipAndFirst.aql new file mode 100644 index 000000000..119da7e4a --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/afterAndSkipAndFirst.aql @@ -0,0 +1,12 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER ((v_paper1.`title` > @var1) || ((v_paper1.`title` == @var2) && (v_paper1._key > @var3))) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var4, @var5 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/all.aql b/spec/regression/papers/tests/pagination-combinations/aql/all.aql new file mode 100644 index 000000000..f72ce3b87 --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/all.aql @@ -0,0 +1,10 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/first.aql b/spec/regression/papers/tests/pagination-combinations/aql/first.aql new file mode 100644 index 000000000..44a2cf7c4 --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/first.aql @@ -0,0 +1,11 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + LIMIT @var1 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/skip.aql b/spec/regression/papers/tests/pagination-combinations/aql/skip.aql new file mode 100644 index 000000000..8233aab12 --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/skip.aql @@ -0,0 +1,11 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + LIMIT @var1, @var2 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/aql/skipAndFirst.aql b/spec/regression/papers/tests/pagination-combinations/aql/skipAndFirst.aql new file mode 100644 index 000000000..8233aab12 --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/aql/skipAndFirst.aql @@ -0,0 +1,11 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + LIMIT @var1, @var2 + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/pagination-combinations/result.json b/spec/regression/papers/tests/pagination-combinations/result.json new file mode 100644 index 000000000..5925c9d1b --- /dev/null +++ b/spec/regression/papers/tests/pagination-combinations/result.json @@ -0,0 +1,104 @@ +{ + "all": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" + }, + { + "title": "Object-oriented modeling and design" + }, + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "skip": { + "data": { + "allPapers": [ + { + "title": "Object-oriented modeling and design" + }, + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "skipAndFirst": { + "data": { + "allPapers": [ + { + "title": "Object-oriented modeling and design" + } + ] + } + }, + "first": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" + } + ] + } + }, + "after": { + "data": { + "allPapers": [ + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "afterAndSkip": { + "data": { + "allPapers": [ + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "afterAndFirst": { + "data": { + "allPapers": [ + { + "title": "Scalable SQL and NoSQL data stores" + } + ] + } + }, + "afterAndSkipAndFirst": { + "data": { + "allPapers": [ + { + "title": "Unified modeling language reference manual, the" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/pagination-combinations.graphql b/spec/regression/papers/tests/pagination-combinations/test.graphql similarity index 65% rename from spec/regression/papers/tests/pagination-combinations.graphql rename to spec/regression/papers/tests/pagination-combinations/test.graphql index 408822b3b..1b40a485d 100644 --- a/spec/regression/papers/tests/pagination-combinations.graphql +++ b/spec/regression/papers/tests/pagination-combinations/test.graphql @@ -1,37 +1,56 @@ -{ - all: allPapers(orderBy: title_ASC) { +query all { + allPapers(orderBy: title_ASC) { title } - skip: allPapers(skip: 1, orderBy: title_ASC) { +} +query skip { + allPapers(skip: 1, orderBy: title_ASC) { title } - skipAndFirst: allPapers(skip: 1, first: 1, orderBy: title_ASC) { +} +query skipAndFirst { + allPapers(skip: 1, first: 1, orderBy: title_ASC) { title } - first: allPapers(first: 1, orderBy: title_ASC) { +} + +query first { + allPapers(first: 1, orderBy: title_ASC) { title } - after: allPapers( +} + +query after { + allPapers( after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" orderBy: title_ASC ) { title } - afterAndSkip: allPapers( +} + +query afterAndSkip { + allPapers( after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" skip: 1 orderBy: title_ASC ) { title } - afterAndFirst: allPapers( +} + +query afterAndFirst { + allPapers( after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" first: 1 orderBy: title_ASC ) { title } - afterAndSkipAndFirst: allPapers( +} + +query afterAndSkipAndFirst { + allPapers( after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" skip: 1 first: 1 diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations.graphql b/spec/regression/papers/tests/pagination-flexsearch-combinations.graphql deleted file mode 100644 index b75dcc09f..000000000 --- a/spec/regression/papers/tests/pagination-flexsearch-combinations.graphql +++ /dev/null @@ -1,44 +0,0 @@ -{ - all: flexSearchPapers(orderBy: title_ASC) { - title - } - # skip without first with order is not supported in flexSearch - # see https://github.com/AEB-labs/cruddl/pull/171#issuecomment-669032789 - #skip: flexSearchPapers(skip: 1, orderBy: title_ASC) { - # title - #} - skipAndFirst: flexSearchPapers(skip: 1, first: 1, orderBy: title_ASC) { - title - } - first: flexSearchPapers(first: 1, orderBy: title_ASC) { - title - } - after: flexSearchPapers( - after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" - orderBy: title_ASC - ) { - title - } - #afterAndSkip: flexSearchPapers( - # after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" - # skip: 1 - # orderBy: title_ASC - #) { - # title - #} - afterAndFirst: flexSearchPapers( - after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" - first: 1 - orderBy: title_ASC - ) { - title - } - afterAndSkipAndFirst: flexSearchPapers( - after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" - skip: 1 - first: 1 - orderBy: title_ASC - ) { - title - } -} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations.result.json b/spec/regression/papers/tests/pagination-flexsearch-combinations.result.json deleted file mode 100644 index b8ffbfda3..000000000 --- a/spec/regression/papers/tests/pagination-flexsearch-combinations.result.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "data": { - "all": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - }, - { - "title": "Object-oriented modeling and design" - }, - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "skipAndFirst": [ - { - "title": "Object-oriented modeling and design" - } - ], - "first": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - } - ], - "after": [ - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ], - "afterAndFirst": [ - { - "title": "Scalable SQL and NoSQL data stores" - } - ], - "afterAndSkipAndFirst": [ - { - "title": "Unified modeling language reference manual, the" - } - ] - } -} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/after.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/after.aql new file mode 100644 index 000000000..18057b55e --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/after.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH (true && (ANALYZER( IN_RANGE(v_paper2.`title`, TOKENS(@var3, @var4)[0], @var5, false, true), @var6) || (ANALYZER( v_paper2.`title` == TOKENS(@var7, @var8)[0],@var9) && ((v_paper2._key > @var10) || ((v_paper2._key == @var11) && false))))) + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndFirst.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndFirst.aql new file mode 100644 index 000000000..c556cf612 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndFirst.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH (true && (ANALYZER( IN_RANGE(v_paper2.`title`, TOKENS(@var3, @var4)[0], @var5, false, true), @var6) || (ANALYZER( v_paper2.`title` == TOKENS(@var7, @var8)[0],@var9) && ((v_paper2._key > @var10) || ((v_paper2._key == @var11) && false))))) + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var12 + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndSkipAndFirst.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndSkipAndFirst.aql new file mode 100644 index 000000000..2f750d5d7 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/afterAndSkipAndFirst.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH (true && (ANALYZER( IN_RANGE(v_paper2.`title`, TOKENS(@var3, @var4)[0], @var5, false, true), @var6) || (ANALYZER( v_paper2.`title` == TOKENS(@var7, @var8)[0],@var9) && ((v_paper2._key > @var10) || ((v_paper2._key == @var11) && false))))) + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var12, @var13 + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/all.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/all.aql new file mode 100644 index 000000000..25fa742e4 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/all.aql @@ -0,0 +1,29 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH true + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/first.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/first.aql new file mode 100644 index 000000000..22be54fbc --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/first.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH true + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var3 + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/skipAndFirst.aql b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/skipAndFirst.aql new file mode 100644 index 000000000..f3e271778 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/aql/skipAndFirst.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH true + RETURN v_paper2 + ) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var3, @var4 + RETURN { + "title": v_paper1.`title` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations.meta.json b/spec/regression/papers/tests/pagination-flexsearch-combinations/meta.json similarity index 100% rename from spec/regression/papers/tests/pagination-flexsearch-combinations.meta.json rename to spec/regression/papers/tests/pagination-flexsearch-combinations/meta.json diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/result.json b/spec/regression/papers/tests/pagination-flexsearch-combinations/result.json new file mode 100644 index 000000000..becbb8c4c --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/result.json @@ -0,0 +1,74 @@ +{ + "all": { + "data": { + "flexSearchPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" + }, + { + "title": "Object-oriented modeling and design" + }, + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "skipAndFirst": { + "data": { + "flexSearchPapers": [ + { + "title": "Object-oriented modeling and design" + } + ] + } + }, + "first": { + "data": { + "flexSearchPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" + } + ] + } + }, + "after": { + "data": { + "flexSearchPapers": [ + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + }, + "afterAndFirst": { + "data": { + "flexSearchPapers": [ + { + "title": "Scalable SQL and NoSQL data stores" + } + ] + } + }, + "afterAndSkipAndFirst": { + "data": { + "flexSearchPapers": [ + { + "title": "Unified modeling language reference manual, the" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/pagination-flexsearch-combinations/test.graphql b/spec/regression/papers/tests/pagination-flexsearch-combinations/test.graphql new file mode 100644 index 000000000..052ad42b6 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch-combinations/test.graphql @@ -0,0 +1,60 @@ +query all { + flexSearchPapers(orderBy: title_ASC) { + title + } +} + +# skip without first with order is not supported in flexSearch +# see https://github.com/AEB-labs/cruddl/pull/171#issuecomment-669032789 +#skip: flexSearchPapers(skip: 1, orderBy: title_ASC) { +# title +#} + +query skipAndFirst { + flexSearchPapers(skip: 1, first: 1, orderBy: title_ASC) { + title + } +} + +query first { + flexSearchPapers(first: 1, orderBy: title_ASC) { + title + } +} +query after { + flexSearchPapers( + after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" + orderBy: title_ASC + ) { + title + } +} + +#afterAndSkip: flexSearchPapers( +# after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" +# skip: 1 +# orderBy: title_ASC +#) { +# title +#} + +query afterAndFirst { + flexSearchPapers( + after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" + first: 1 + orderBy: title_ASC + ) { + title + } +} + +query afterAndSkipAndFirst { + flexSearchPapers( + after: "{\"id\":\"@{ids/Paper/1}\", \"title\": \"Object-oriented modeling and design\"}" + skip: 1 + first: 1 + orderBy: title_ASC + ) { + title + } +} diff --git a/spec/regression/papers/tests/pagination-flexsearch.result.json b/spec/regression/papers/tests/pagination-flexsearch.result.json deleted file mode 100644 index b2db226bb..000000000 --- a/spec/regression/papers/tests/pagination-flexsearch.result.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "data": { - "flexSearchPapers": [ - { - "key": "NoSQL", - "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}", - "title2": "Will NoSQL databases live up to their promise?", - "title": "Will NoSQL databases live up to their promise?", - "readers": [], - "b": [], - "empty": [] - }, - { - "key": "OOM", - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}", - "title2": "Object-oriented modeling and design", - "title": "Object-oriented modeling and design", - "readers": [], - "b": [], - "empty": [] - }, - { - "key": "Part", - "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}", - "title2": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "readers": [], - "b": [], - "empty": [] - } - ], - "noPagesLeft": [], - "noPaginationButCursor": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\"}" - } - ], - "noPaginationButCursorAndSort": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" - } - ] - } -} diff --git a/spec/regression/papers/tests/pagination-flexsearch/aql/noPagesLeft.aql b/spec/regression/papers/tests/pagination-flexsearch/aql/noPagesLeft.aql new file mode 100644 index 000000000..ce7d0b34d --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch/aql/noPagesLeft.aql @@ -0,0 +1,30 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH (v_paper1.`isPublished` == @var1) + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var2) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH ((v_paper2.`isPublished` == @var3) && (ANALYZER( IN_RANGE(v_paper2.`key`, TOKENS(@var4, @var5)[0], @var6, false, true), @var7) || (ANALYZER( v_paper2.`key` == TOKENS(@var8, @var9)[0],@var10) && ((v_paper2._key > @var11) || ((v_paper2._key == @var12) && false))))) + RETURN v_paper2 + ) + SORT (v_paper1.`key`) , (v_paper1._key) + LIMIT @var13 + RETURN { + "key": v_paper1.`key` + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursor.aql b/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursor.aql new file mode 100644 index 000000000..382a3c737 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursor.aql @@ -0,0 +1,32 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH true + RETURN v_paper2 + ) + FILTER (v_paper1._key == @var3) + SORT (v_paper1._key) + RETURN { + @var4: JSON_STRINGIFY({ + "id": v_paper1._key + }) + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursorAndSort.aql b/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursorAndSort.aql new file mode 100644 index 000000000..eec0ab117 --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch/aql/noPaginationButCursorAndSort.aql @@ -0,0 +1,33 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH true + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var1) + +// -------------------------------- + +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH true + RETURN v_paper2 + ) + FILTER (v_paper1._key == @var3) + SORT (v_paper1.`key`) , (v_paper1._key) + RETURN { + @var4: JSON_STRINGIFY({ + "id": v_paper1._key, + "key": v_paper1.`key` + }) + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch/aql/pagination.aql b/spec/regression/papers/tests/pagination-flexsearch/aql/pagination.aql new file mode 100644 index 000000000..a25813d8a --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch/aql/pagination.aql @@ -0,0 +1,69 @@ +RETURN (FIRST( + FOR v_item1 + IN ( + FOR v_paper1 + IN @@flex_view_papers + SEARCH (v_paper1.`isPublished` == @var1) + RETURN v_paper1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 +) > @var2) + +// -------------------------------- + +WITH @@users +RETURN { + "flexSearchPapers": (@tmp1 ? { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 } : ( + FOR v_paper1 + IN ( + FOR v_paper2 + IN @@flex_view_papers + SEARCH (v_paper2.`isPublished` == @var3) + RETURN v_paper2 + ) + SORT (v_paper1.`key`) , (v_paper1._key) + LIMIT @var4 + LET v_title1 = v_paper1.`title` + RETURN { + "key": v_paper1.`key`, + @var5: JSON_STRINGIFY({ + "id": v_paper1._key, + "key": v_paper1.`key` + }), + "title2": v_title1, + "title": v_title1, + "readers": ( + FOR v_user1 + IN INBOUND v_paper1 @@users_papers + FILTER v_user1._key != null + LIMIT @var6 + RETURN { + "lastName": v_user1.`lastName` + } + ), + "b": ( + FOR v_user2 + IN INBOUND v_paper1 @@users_papers + FILTER v_user2._key != null + SORT (v_user2._key) + LIMIT @var7 + RETURN { + "lastName": v_user2.`lastName`, + @var8: JSON_STRINGIFY({ + "id": v_user2._key + }) + } + ), + "empty": ( + FOR v_user3 + IN INBOUND v_paper1 @@users_papers + FILTER (v_user3._key == @var9) + FILTER v_user3._key != null + RETURN { + "id": v_user3._key + } + ) + } + )) +} diff --git a/spec/regression/papers/tests/pagination-flexsearch.meta.json b/spec/regression/papers/tests/pagination-flexsearch/meta.json similarity index 100% rename from spec/regression/papers/tests/pagination-flexsearch.meta.json rename to spec/regression/papers/tests/pagination-flexsearch/meta.json diff --git a/spec/regression/papers/tests/pagination-flexsearch/result.json b/spec/regression/papers/tests/pagination-flexsearch/result.json new file mode 100644 index 000000000..e9aa921eb --- /dev/null +++ b/spec/regression/papers/tests/pagination-flexsearch/result.json @@ -0,0 +1,58 @@ +{ + "pagination": { + "data": { + "flexSearchPapers": [ + { + "key": "NoSQL", + "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}", + "title2": "Will NoSQL databases live up to their promise?", + "title": "Will NoSQL databases live up to their promise?", + "readers": [], + "b": [], + "empty": [] + }, + { + "key": "OOM", + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}", + "title2": "Object-oriented modeling and design", + "title": "Object-oriented modeling and design", + "readers": [], + "b": [], + "empty": [] + }, + { + "key": "Part", + "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}", + "title2": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "readers": [], + "b": [], + "empty": [] + } + ] + } + }, + "noPagesLeft": { + "data": { + "flexSearchPapers": [] + } + }, + "noPaginationButCursor": { + "data": { + "flexSearchPapers": [ + { + "_cursor": "{\"id\":\"@{ids/Paper/1}\"}" + } + ] + } + }, + "noPaginationButCursorAndSort": { + "data": { + "flexSearchPapers": [ + { + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/pagination-flexsearch.graphql b/spec/regression/papers/tests/pagination-flexsearch/test.graphql similarity index 69% rename from spec/regression/papers/tests/pagination-flexsearch.graphql rename to spec/regression/papers/tests/pagination-flexsearch/test.graphql index 77fca39da..a75e819e6 100644 --- a/spec/regression/papers/tests/pagination-flexsearch.graphql +++ b/spec/regression/papers/tests/pagination-flexsearch/test.graphql @@ -1,4 +1,4 @@ -query { +query pagination { flexSearchPapers(first: 3, flexSearchFilter: { isPublished: true }, orderBy: key_ASC) { key _cursor @@ -15,8 +15,9 @@ query { id } } - - noPagesLeft: flexSearchPapers( +} +query noPagesLeft { + flexSearchPapers( first: 2 after: "{\"id\":\"@{ids/Paper/5}\",\"key\":\"Scal\"}" flexSearchFilter: { isPublished: true } @@ -24,15 +25,16 @@ query { ) { key } +} - noPaginationButCursor: flexSearchPapers(postFilter: { id: "@{ids/Paper/1}" }) { +query noPaginationButCursor { + flexSearchPapers(postFilter: { id: "@{ids/Paper/1}" }) { _cursor } +} - noPaginationButCursorAndSort: flexSearchPapers( - postFilter: { id: "@{ids/Paper/1}" } - orderBy: key_ASC - ) { +query noPaginationButCursorAndSort { + flexSearchPapers(postFilter: { id: "@{ids/Paper/1}" }, orderBy: key_ASC) { _cursor } } diff --git a/spec/regression/papers/tests/pagination.result.json b/spec/regression/papers/tests/pagination.result.json deleted file mode 100644 index 77864ab88..000000000 --- a/spec/regression/papers/tests/pagination.result.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "data": { - "allPapers": [ - { - "key": "NoSQL", - "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}", - "title2": "Will NoSQL databases live up to their promise?", - "title": "Will NoSQL databases live up to their promise?", - "readers": [], - "b": [], - "empty": [] - }, - { - "key": "OOM", - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}", - "title2": "Object-oriented modeling and design", - "title": "Object-oriented modeling and design", - "readers": [], - "b": [], - "empty": [] - }, - { - "key": "Part", - "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}", - "title2": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "readers": [], - "b": [], - "empty": [] - } - ], - "noPagesLeft": [], - "noPaginationButCursor": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\"}" - } - ] - } -} diff --git a/spec/regression/papers/tests/pagination/aql/noPagesLeft.aql b/spec/regression/papers/tests/pagination/aql/noPagesLeft.aql new file mode 100644 index 000000000..359d654d3 --- /dev/null +++ b/spec/regression/papers/tests/pagination/aql/noPagesLeft.aql @@ -0,0 +1,25 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN UNION(( + FOR v_paper2 + IN @@papers + FILTER ((v_paper2.`isPublished` == @var1) && (v_paper2.`key` > @var2)) + SORT (v_paper2.`key`) , (v_paper2._key) + LIMIT @var3 + RETURN v_paper2 + ), ( + FOR v_paper3 + IN @@papers + FILTER (((v_paper3.`isPublished` == @var4) && (v_paper3.`key` == @var5)) && (v_paper3._key > @var6)) + SORT (v_paper3.`key`) , (v_paper3._key) + LIMIT @var7 + RETURN v_paper3 + )) + SORT (v_paper1.`key`) , (v_paper1._key) + LIMIT @var8 + RETURN { + "key": v_paper1.`key` + } + ) +} diff --git a/spec/regression/papers/tests/pagination/aql/noPaginationButCursor.aql b/spec/regression/papers/tests/pagination/aql/noPaginationButCursor.aql new file mode 100644 index 000000000..5adc51a53 --- /dev/null +++ b/spec/regression/papers/tests/pagination/aql/noPaginationButCursor.aql @@ -0,0 +1,13 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1._key == @var1) + SORT (v_paper1._key) + RETURN { + @var2: JSON_STRINGIFY({ + "id": v_paper1._key + }) + } + ) +} diff --git a/spec/regression/papers/tests/pagination/aql/pagination.aql b/spec/regression/papers/tests/pagination/aql/pagination.aql new file mode 100644 index 000000000..ab7001bee --- /dev/null +++ b/spec/regression/papers/tests/pagination/aql/pagination.aql @@ -0,0 +1,51 @@ +WITH @@users +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`isPublished` == @var1) + SORT (v_paper1.`key`) , (v_paper1._key) + LIMIT @var2 + LET v_title1 = v_paper1.`title` + RETURN { + "key": v_paper1.`key`, + @var3: JSON_STRINGIFY({ + "id": v_paper1._key, + "key": v_paper1.`key` + }), + "title2": v_title1, + "title": v_title1, + "readers": ( + FOR v_user1 + IN INBOUND v_paper1 @@users_papers + FILTER v_user1._key != null + LIMIT @var4 + RETURN { + "lastName": v_user1.`lastName` + } + ), + "b": ( + FOR v_user2 + IN INBOUND v_paper1 @@users_papers + FILTER v_user2._key != null + SORT (v_user2._key) + LIMIT @var5 + RETURN { + "lastName": v_user2.`lastName`, + @var6: JSON_STRINGIFY({ + "id": v_user2._key + }) + } + ), + "empty": ( + FOR v_user3 + IN INBOUND v_paper1 @@users_papers + FILTER (v_user3._key == @var7) + FILTER v_user3._key != null + RETURN { + "id": v_user3._key + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/pagination/result.json b/spec/regression/papers/tests/pagination/result.json new file mode 100644 index 000000000..89c98ee51 --- /dev/null +++ b/spec/regression/papers/tests/pagination/result.json @@ -0,0 +1,49 @@ +{ + "pagination": { + "data": { + "allPapers": [ + { + "key": "NoSQL", + "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"key\":\"NoSQL\"}", + "title2": "Will NoSQL databases live up to their promise?", + "title": "Will NoSQL databases live up to their promise?", + "readers": [], + "b": [], + "empty": [] + }, + { + "key": "OOM", + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"key\":\"OOM\"}", + "title2": "Object-oriented modeling and design", + "title": "Object-oriented modeling and design", + "readers": [], + "b": [], + "empty": [] + }, + { + "key": "Part", + "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"key\":\"Part\"}", + "title2": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "readers": [], + "b": [], + "empty": [] + } + ] + } + }, + "noPagesLeft": { + "data": { + "allPapers": [] + } + }, + "noPaginationButCursor": { + "data": { + "allPapers": [ + { + "_cursor": "{\"id\":\"@{ids/Paper/1}\"}" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/pagination.graphql b/spec/regression/papers/tests/pagination/test.graphql similarity index 80% rename from spec/regression/papers/tests/pagination.graphql rename to spec/regression/papers/tests/pagination/test.graphql index 901a74ee3..2b1bcd20f 100644 --- a/spec/regression/papers/tests/pagination.graphql +++ b/spec/regression/papers/tests/pagination/test.graphql @@ -1,4 +1,4 @@ -query { +query pagination { allPapers(first: 3, filter: { isPublished: true }, orderBy: key_ASC) { key _cursor @@ -15,8 +15,10 @@ query { id } } +} - noPagesLeft: allPapers( +query noPagesLeft { + allPapers( first: 2 after: "{\"id\":\"@{ids/Paper/5}\",\"key\":\"Scal\"}" filter: { isPublished: true } @@ -24,8 +26,10 @@ query { ) { key } +} - noPaginationButCursor: allPapers(filter: { id: "@{ids/Paper/1}" }) { +query noPaginationButCursor { + allPapers(filter: { id: "@{ids/Paper/1}" }) { _cursor } } diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersHavingACertainLiteraturReferences.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingACertainLiteraturReferences.aql new file mode 100644 index 000000000..53b854bbe --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingACertainLiteraturReferences.aql @@ -0,0 +1,19 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (@var1 IN v_paper1.`literatureReferences`[*].`title`) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "literatureReferences": ( + FOR v_literatureReference1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + SORT (v_literatureReference1.`title`) , (v_literatureReference1.`pages`.`startPage`) + RETURN { + "title": v_literatureReference1.`title` + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferences.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferences.aql new file mode 100644 index 000000000..8fe4da200 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferences.aql @@ -0,0 +1,28 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_literatureReferences1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + RETURN v_literatureReferences1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "literatureReferences": ( + FOR v_literatureReference1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + SORT (v_literatureReference1.`title`) , (v_literatureReference1.`pages`.`startPage`) + RETURN { + "title": v_literatureReference1.`title` + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferencesLike.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferencesLike.aql new file mode 100644 index 000000000..ca3780344 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersHavingLiteraturReferencesLike.aql @@ -0,0 +1,29 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_literatureReferences1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + FILTER (v_literatureReferences1.`title` >= UPPER(@var1) && v_literatureReferences1.`title` < LOWER(@var2)) && (LEFT(v_literatureReferences1.`title`, LENGTH(@var3)) == @var4) + RETURN v_literatureReferences1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) > @var5) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "literatureReferences": ( + FOR v_literatureReference1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + SORT (v_literatureReference1.`title`) , (v_literatureReference1.`pages`.`startPage`) + RETURN { + "title": v_literatureReference1.`title` + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersNotInOneOfTheseCategories.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersNotInOneOfTheseCategories.aql new file mode 100644 index 000000000..f54d47ec5 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersNotInOneOfTheseCategories.aql @@ -0,0 +1,12 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER ((IS_LIST(v_paper1.`categories`) ? v_paper1.`categories` : []) NONE == @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "categories": (IS_LIST(v_paper1.`categories`) ? v_paper1.`categories` : []) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersOfSomeCategories.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersOfSomeCategories.aql new file mode 100644 index 000000000..585e88904 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersOfSomeCategories.aql @@ -0,0 +1,12 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1.`categories` ANY IN @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "categories": (IS_LIST(v_paper1.`categories`) ? v_paper1.`categories` : []) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersWhichHaveOnlyOneOfTheseCategories.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersWhichHaveOnlyOneOfTheseCategories.aql new file mode 100644 index 000000000..570248fc5 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersWhichHaveOnlyOneOfTheseCategories.aql @@ -0,0 +1,12 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER ((IS_LIST(v_paper1.`categories`) ? v_paper1.`categories` : []) ALL IN @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "categories": (IS_LIST(v_paper1.`categories`) ? v_paper1.`categories` : []) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers/aql/allPapersWihoutLiteraturReferences.aql b/spec/regression/papers/tests/quantifiers/aql/allPapersWihoutLiteraturReferences.aql new file mode 100644 index 000000000..87245eff6 --- /dev/null +++ b/spec/regression/papers/tests/quantifiers/aql/allPapersWihoutLiteraturReferences.aql @@ -0,0 +1,28 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + FILTER (FIRST( + FOR v_item1 + IN ( + FOR v_literatureReferences1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + RETURN v_literatureReferences1 + ) + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) == @var1) + SORT (v_paper1.`key`) + RETURN { + "key": v_paper1.`key`, + "literatureReferences": ( + FOR v_literatureReference1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + SORT (v_literatureReference1.`title`) , (v_literatureReference1.`pages`.`startPage`) + RETURN { + "title": v_literatureReference1.`title` + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/quantifiers.result.json b/spec/regression/papers/tests/quantifiers/result.json similarity index 100% rename from spec/regression/papers/tests/quantifiers.result.json rename to spec/regression/papers/tests/quantifiers/result.json diff --git a/spec/regression/papers/tests/quantifiers.graphql b/spec/regression/papers/tests/quantifiers/test.graphql similarity index 100% rename from spec/regression/papers/tests/quantifiers.graphql rename to spec/regression/papers/tests/quantifiers/test.graphql diff --git a/spec/regression/papers/tests/references.result.json b/spec/regression/papers/tests/references.result.json deleted file mode 100644 index 6f11ae888..000000000 --- a/spec/regression/papers/tests/references.result.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "data": { - "allPapers": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "literatureReferences": [ - { - "paper": null, - "authors": [ - "Hagit Attiya", - "Amotz Bar-Noy", - "Danny Dolev", - "Daphne Koller", - "David Peleg", - "and Rüdiger Reischuk" - ], - "pages": { - "startPage": 337, - "endPage": 346 - } - } - ], - "tags": ["cap-theorem", "databases"] - }, - { - "title": "Object-oriented modeling and design", - "literatureReferences": [], - "tags": ["object-oriented", "modeling", "design"] - }, - { - "title": "Scalable SQL and NoSQL data stores", - "literatureReferences": [ - { - "paper": { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "publishDate": "2017-04-05", - "isPublished": true, - "tags": ["cap-theorem", "databases"] - }, - "authors": ["Seth Gilbert", "Nancy Lynch"], - "pages": { - "startPage": 51, - "endPage": 59 - } - } - ], - "tags": ["nosql"] - }, - { - "title": "Unified modeling language reference manual, the", - "literatureReferences": [], - "tags": ["uml", "specification"] - }, - { - "title": "Will NoSQL databases live up to their promise?", - "literatureReferences": [], - "tags": ["nosql"] - } - ] - } -} diff --git a/spec/regression/papers/tests/references/aql/references.aql b/spec/regression/papers/tests/references/aql/references.aql new file mode 100644 index 000000000..d784f1752 --- /dev/null +++ b/spec/regression/papers/tests/references/aql/references.aql @@ -0,0 +1,35 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + RETURN { + "title": v_paper1.`title`, + "literatureReferences": ( + FOR v_literatureReference1 + IN (IS_LIST(v_paper1.`literatureReferences`) ? v_paper1.`literatureReferences` : []) + LET v_paper2 = (IS_NULL(v_literatureReference1.`paper`) ? null : FIRST(( + FOR v_paper3 + IN @@papers + FILTER ((v_paper3.`key` > NULL) && (v_paper3.`key` == v_literatureReference1.`paper`)) + LIMIT @var1 + RETURN v_paper3 + ))) + RETURN { + "paper": (IS_NULL(v_paper2) ? null : { + "title": v_paper2.`title`, + "publishDate": v_paper2.`publishDate`, + "isPublished": v_paper2.`isPublished`, + "tags": (IS_LIST(v_paper2.`tags`) ? v_paper2.`tags` : []) + }), + "authors": (IS_LIST(v_literatureReference1.`authors`) ? v_literatureReference1.`authors` : []), + "pages": (IS_NULL(v_literatureReference1.`pages`) ? null : { + "startPage": v_literatureReference1.`pages`.`startPage`, + "endPage": v_literatureReference1.`pages`.`endPage` + }) + } + ), + "tags": (IS_LIST(v_paper1.`tags`) ? v_paper1.`tags` : []) + } + ) +} diff --git a/spec/regression/papers/tests/references/result.json b/spec/regression/papers/tests/references/result.json new file mode 100644 index 000000000..831e2789c --- /dev/null +++ b/spec/regression/papers/tests/references/result.json @@ -0,0 +1,63 @@ +{ + "references": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "literatureReferences": [ + { + "paper": null, + "authors": [ + "Hagit Attiya", + "Amotz Bar-Noy", + "Danny Dolev", + "Daphne Koller", + "David Peleg", + "and Rüdiger Reischuk" + ], + "pages": { + "startPage": 337, + "endPage": 346 + } + } + ], + "tags": ["cap-theorem", "databases"] + }, + { + "title": "Object-oriented modeling and design", + "literatureReferences": [], + "tags": ["object-oriented", "modeling", "design"] + }, + { + "title": "Scalable SQL and NoSQL data stores", + "literatureReferences": [ + { + "paper": { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "publishDate": "2017-04-05", + "isPublished": true, + "tags": ["cap-theorem", "databases"] + }, + "authors": ["Seth Gilbert", "Nancy Lynch"], + "pages": { + "startPage": 51, + "endPage": 59 + } + } + ], + "tags": ["nosql"] + }, + { + "title": "Unified modeling language reference manual, the", + "literatureReferences": [], + "tags": ["uml", "specification"] + }, + { + "title": "Will NoSQL databases live up to their promise?", + "literatureReferences": [], + "tags": ["nosql"] + } + ] + } + } +} diff --git a/spec/regression/papers/tests/references.graphql b/spec/regression/papers/tests/references/test.graphql similarity index 94% rename from spec/regression/papers/tests/references.graphql rename to spec/regression/papers/tests/references/test.graphql index 4162dec74..f5fb60c7d 100644 --- a/spec/regression/papers/tests/references.graphql +++ b/spec/regression/papers/tests/references/test.graphql @@ -1,4 +1,4 @@ -query { +query references { allPapers(orderBy: title_ASC) { title literatureReferences { diff --git a/spec/regression/papers/tests/rollback-on-error/aql/create.aql b/spec/regression/papers/tests/rollback-on-error/aql/create.aql new file mode 100644 index 000000000..ac795196f --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/create.aql @@ -0,0 +1,19 @@ +RETURN FIRST( + INSERT @var1 IN @@papers + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @v_newEntityId1) +RETURN (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` +}) + +// -------------------------------- + +WITH @@papers +RETURN { + "createPaper": @v_createPaper1 +} diff --git a/spec/regression/papers/tests/rollback-on-error/aql/createAnother.aql b/spec/regression/papers/tests/rollback-on-error/aql/createAnother.aql new file mode 100644 index 000000000..ac795196f --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/createAnother.aql @@ -0,0 +1,19 @@ +RETURN FIRST( + INSERT @var1 IN @@papers + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @v_newEntityId1) +RETURN (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` +}) + +// -------------------------------- + +WITH @@papers +RETURN { + "createPaper": @v_createPaper1 +} diff --git a/spec/regression/papers/tests/rollback-on-error/aql/queryOne.aql b/spec/regression/papers/tests/rollback-on-error/aql/queryOne.aql new file mode 100644 index 000000000..8a2bafbf7 --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/queryOne.aql @@ -0,0 +1,22 @@ +LET v_paper1 = FIRST(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`key` == @var1) + LIMIT @var2 + RETURN v_paper2 +)) +LET v_paper3 = FIRST(( + FOR v_paper4 + IN @@papers + FILTER (v_paper4.`key` == @var3) + LIMIT @var4 + RETURN v_paper4 +)) +RETURN { + "one": (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` + }), + "two": (IS_NULL(v_paper3) ? null : { + "key": v_paper3.`key` + }) +} diff --git a/spec/regression/papers/tests/rollback-on-error/aql/queryStillOne.aql b/spec/regression/papers/tests/rollback-on-error/aql/queryStillOne.aql new file mode 100644 index 000000000..8a2bafbf7 --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/queryStillOne.aql @@ -0,0 +1,22 @@ +LET v_paper1 = FIRST(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`key` == @var1) + LIMIT @var2 + RETURN v_paper2 +)) +LET v_paper3 = FIRST(( + FOR v_paper4 + IN @@papers + FILTER (v_paper4.`key` == @var3) + LIMIT @var4 + RETURN v_paper4 +)) +RETURN { + "one": (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` + }), + "two": (IS_NULL(v_paper3) ? null : { + "key": v_paper3.`key` + }) +} diff --git a/spec/regression/papers/tests/rollback-on-error/aql/queryTwo.aql b/spec/regression/papers/tests/rollback-on-error/aql/queryTwo.aql new file mode 100644 index 000000000..8a2bafbf7 --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/queryTwo.aql @@ -0,0 +1,22 @@ +LET v_paper1 = FIRST(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`key` == @var1) + LIMIT @var2 + RETURN v_paper2 +)) +LET v_paper3 = FIRST(( + FOR v_paper4 + IN @@papers + FILTER (v_paper4.`key` == @var3) + LIMIT @var4 + RETURN v_paper4 +)) +RETURN { + "one": (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` + }), + "two": (IS_NULL(v_paper3) ? null : { + "key": v_paper3.`key` + }) +} diff --git a/spec/regression/papers/tests/rollback-on-error/aql/updateMissingAndCreateAnother.aql b/spec/regression/papers/tests/rollback-on-error/aql/updateMissingAndCreateAnother.aql new file mode 100644 index 000000000..532f56b96 --- /dev/null +++ b/spec/regression/papers/tests/rollback-on-error/aql/updateMissingAndCreateAnother.aql @@ -0,0 +1,47 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1._key == @var1) + LIMIT @var2 + RETURN v_paper1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@papers + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @var1) +RETURN (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` +}) + +// -------------------------------- + +WITH @@papers +RETURN FIRST( + INSERT @var1 IN @@papers + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @v_newEntityId1) +RETURN (IS_NULL(v_paper1) ? null : { + "key": v_paper1.`key` +}) + +// -------------------------------- + +WITH @@papers +RETURN { + "updatePaper": @v_updatePaper1, + "createPaper": @v_createPaper1 +} diff --git a/spec/regression/papers/tests/rollback-on-error.meta.json b/spec/regression/papers/tests/rollback-on-error/meta.json similarity index 100% rename from spec/regression/papers/tests/rollback-on-error.meta.json rename to spec/regression/papers/tests/rollback-on-error/meta.json diff --git a/spec/regression/papers/tests/rollback-on-error.result.json b/spec/regression/papers/tests/rollback-on-error/result.json similarity index 100% rename from spec/regression/papers/tests/rollback-on-error.result.json rename to spec/regression/papers/tests/rollback-on-error/result.json diff --git a/spec/regression/papers/tests/rollback-on-error.graphql b/spec/regression/papers/tests/rollback-on-error/test.graphql similarity index 100% rename from spec/regression/papers/tests/rollback-on-error.graphql rename to spec/regression/papers/tests/rollback-on-error/test.graphql diff --git a/spec/regression/papers/tests/serial-mutations.graphql b/spec/regression/papers/tests/serial-mutations.graphql deleted file mode 100644 index 806694dbb..000000000 --- a/spec/regression/papers/tests/serial-mutations.graphql +++ /dev/null @@ -1,9 +0,0 @@ -mutation { - a: updatePaper(input: { id: "@{ids/Paper/1}", title: "Test 1" }) { - title - } - - b: updatePaper(input: { id: "@{ids/Paper/2}", title: "Test 2" }) { - title - } -} diff --git a/spec/regression/papers/tests/serial-mutations.result.json b/spec/regression/papers/tests/serial-mutations.result.json deleted file mode 100644 index fd09d0f21..000000000 --- a/spec/regression/papers/tests/serial-mutations.result.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "a": { - "title": "Test 1" - }, - "b": { - "title": "Test 2" - } - } -} diff --git a/spec/regression/papers/tests/serial-mutations/aql/a.aql b/spec/regression/papers/tests/serial-mutations/aql/a.aql new file mode 100644 index 000000000..99c27987a --- /dev/null +++ b/spec/regression/papers/tests/serial-mutations/aql/a.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1._key == @var1) + LIMIT @var2 + RETURN v_paper1 + ) + UPDATE v_currentEntity1 + WITH { + "title": @var3, + "updatedAt": @var4 + } + IN @@papers + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @var1) +RETURN (IS_NULL(v_paper1) ? null : { + "title": v_paper1.`title` +}) + +// -------------------------------- + +WITH @@papers +RETURN { + "updatePaper": @v_updatePaper1 +} diff --git a/spec/regression/papers/tests/serial-mutations/aql/b.aql b/spec/regression/papers/tests/serial-mutations/aql/b.aql new file mode 100644 index 000000000..99c27987a --- /dev/null +++ b/spec/regression/papers/tests/serial-mutations/aql/b.aql @@ -0,0 +1,33 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_paper1 + IN @@papers + FILTER (v_paper1._key == @var1) + LIMIT @var2 + RETURN v_paper1 + ) + UPDATE v_currentEntity1 + WITH { + "title": @var3, + "updatedAt": @var4 + } + IN @@papers + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@papers +LET v_paper1 = DOCUMENT(@@papers, @var1) +RETURN (IS_NULL(v_paper1) ? null : { + "title": v_paper1.`title` +}) + +// -------------------------------- + +WITH @@papers +RETURN { + "updatePaper": @v_updatePaper1 +} diff --git a/spec/regression/papers/tests/serial-mutations/result.json b/spec/regression/papers/tests/serial-mutations/result.json new file mode 100644 index 000000000..d2498707d --- /dev/null +++ b/spec/regression/papers/tests/serial-mutations/result.json @@ -0,0 +1,16 @@ +{ + "a": { + "data": { + "updatePaper": { + "title": "Test 1" + } + } + }, + "b": { + "data": { + "updatePaper": { + "title": "Test 2" + } + } + } +} diff --git a/spec/regression/papers/tests/serial-mutations/test.graphql b/spec/regression/papers/tests/serial-mutations/test.graphql new file mode 100644 index 000000000..a8a5c26fc --- /dev/null +++ b/spec/regression/papers/tests/serial-mutations/test.graphql @@ -0,0 +1,11 @@ +mutation a { + updatePaper(input: { id: "@{ids/Paper/1}", title: "Test 1" }) { + title + } +} + +mutation b { + updatePaper(input: { id: "@{ids/Paper/2}", title: "Test 2" }) { + title + } +} diff --git a/spec/regression/papers/tests/simple-sorting.result.json b/spec/regression/papers/tests/simple-sorting.result.json deleted file mode 100644 index 65876d122..000000000 --- a/spec/regression/papers/tests/simple-sorting.result.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "data": { - "allPapers": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - }, - { - "title": "Object-oriented modeling and design" - }, - { - "title": "Scalable SQL and NoSQL data stores" - }, - { - "title": "Unified modeling language reference manual, the" - }, - { - "title": "Will NoSQL databases live up to their promise?" - } - ] - } -} diff --git a/spec/regression/papers/tests/simple-sorting/aql/sort.aql b/spec/regression/papers/tests/simple-sorting/aql/sort.aql new file mode 100644 index 000000000..f72ce3b87 --- /dev/null +++ b/spec/regression/papers/tests/simple-sorting/aql/sort.aql @@ -0,0 +1,10 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + RETURN { + "title": v_paper1.`title` + } + ) +} diff --git a/spec/regression/papers/tests/simple-sorting/result.json b/spec/regression/papers/tests/simple-sorting/result.json new file mode 100644 index 000000000..d43ea1036 --- /dev/null +++ b/spec/regression/papers/tests/simple-sorting/result.json @@ -0,0 +1,23 @@ +{ + "sort": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" + }, + { + "title": "Object-oriented modeling and design" + }, + { + "title": "Scalable SQL and NoSQL data stores" + }, + { + "title": "Unified modeling language reference manual, the" + }, + { + "title": "Will NoSQL databases live up to their promise?" + } + ] + } + } +} diff --git a/spec/regression/papers/tests/simple-sorting.graphql b/spec/regression/papers/tests/simple-sorting/test.graphql similarity index 81% rename from spec/regression/papers/tests/simple-sorting.graphql rename to spec/regression/papers/tests/simple-sorting/test.graphql index e019ed233..cc09caacd 100644 --- a/spec/regression/papers/tests/simple-sorting.graphql +++ b/spec/regression/papers/tests/simple-sorting/test.graphql @@ -1,4 +1,4 @@ -{ +query sort { allPapers(orderBy: title_ASC) { title } diff --git a/spec/regression/papers/tests/sort-and-paginate.result.json b/spec/regression/papers/tests/sort-and-paginate.result.json deleted file mode 100644 index 754b7885f..000000000 --- a/spec/regression/papers/tests/sort-and-paginate.result.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "data": { - "page1": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"title\":\"Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services\"}", - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"title\":\"Object-oriented modeling and design\"}", - "title": "Object-oriented modeling and design" - } - ], - "page2": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"title\":\"Scalable SQL and NoSQL data stores\"}", - "title": "Scalable SQL and NoSQL data stores" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"title\":\"Unified modeling language reference manual, the\"}", - "title": "Unified modeling language reference manual, the" - } - ], - "page1Desc": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"title\":\"Will NoSQL databases live up to their promise?\"}", - "title": "Will NoSQL databases live up to their promise?" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"title\":\"Unified modeling language reference manual, the\"}", - "title": "Unified modeling language reference manual, the" - } - ], - "page2Desc": [ - { - "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"title\":\"Scalable SQL and NoSQL data stores\"}", - "title": "Scalable SQL and NoSQL data stores" - }, - { - "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"title\":\"Object-oriented modeling and design\"}", - "title": "Object-oriented modeling and design" - } - ], - "emptyPage": [] - } -} diff --git a/spec/regression/papers/tests/sort-and-paginate/aql/emptyPage.aql b/spec/regression/papers/tests/sort-and-paginate/aql/emptyPage.aql new file mode 100644 index 000000000..eca07736d --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/aql/emptyPage.aql @@ -0,0 +1,15 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var1 + RETURN { + "title": v_paper1.`title`, + @var2: JSON_STRINGIFY({ + "id": v_paper1._key, + "title": v_paper1.`title` + }) + } + ) +} diff --git a/spec/regression/papers/tests/sort-and-paginate/aql/page1.aql b/spec/regression/papers/tests/sort-and-paginate/aql/page1.aql new file mode 100644 index 000000000..eca07736d --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/aql/page1.aql @@ -0,0 +1,15 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var1 + RETURN { + "title": v_paper1.`title`, + @var2: JSON_STRINGIFY({ + "id": v_paper1._key, + "title": v_paper1.`title` + }) + } + ) +} diff --git a/spec/regression/papers/tests/sort-and-paginate/aql/page1Desc.aql b/spec/regression/papers/tests/sort-and-paginate/aql/page1Desc.aql new file mode 100644 index 000000000..e5df6180b --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/aql/page1Desc.aql @@ -0,0 +1,15 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) DESC, (v_paper1._key) DESC + LIMIT @var1 + RETURN { + "title": v_paper1.`title`, + @var2: JSON_STRINGIFY({ + "id": v_paper1._key, + "title": v_paper1.`title` + }) + } + ) +} diff --git a/spec/regression/papers/tests/sort-and-paginate/aql/page2.aql b/spec/regression/papers/tests/sort-and-paginate/aql/page2.aql new file mode 100644 index 000000000..57bf20f71 --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/aql/page2.aql @@ -0,0 +1,29 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN UNION(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`title` > @var1) + SORT (v_paper2.`title`) , (v_paper2._key) + LIMIT @var2 + RETURN v_paper2 + ), ( + FOR v_paper3 + IN @@papers + FILTER ((v_paper3.`title` == @var3) && (v_paper3._key > @var4)) + SORT (v_paper3.`title`) , (v_paper3._key) + LIMIT @var5 + RETURN v_paper3 + )) + SORT (v_paper1.`title`) , (v_paper1._key) + LIMIT @var6 + RETURN { + "title": v_paper1.`title`, + @var7: JSON_STRINGIFY({ + "id": v_paper1._key, + "title": v_paper1.`title` + }) + } + ) +} diff --git a/spec/regression/papers/tests/sort-and-paginate/aql/page2Desc.aql b/spec/regression/papers/tests/sort-and-paginate/aql/page2Desc.aql new file mode 100644 index 000000000..cab312a21 --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/aql/page2Desc.aql @@ -0,0 +1,29 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN UNION(( + FOR v_paper2 + IN @@papers + FILTER (v_paper2.`title` < @var1) + SORT (v_paper2.`title`) DESC, (v_paper2._key) DESC + LIMIT @var2 + RETURN v_paper2 + ), ( + FOR v_paper3 + IN @@papers + FILTER ((v_paper3.`title` == @var3) && (v_paper3._key < @var4)) + SORT (v_paper3.`title`) DESC, (v_paper3._key) DESC + LIMIT @var5 + RETURN v_paper3 + )) + SORT (v_paper1.`title`) DESC, (v_paper1._key) DESC + LIMIT @var6 + RETURN { + "title": v_paper1.`title`, + @var7: JSON_STRINGIFY({ + "id": v_paper1._key, + "title": v_paper1.`title` + }) + } + ) +} diff --git a/spec/regression/papers/tests/sort-and-paginate/result.json b/spec/regression/papers/tests/sort-and-paginate/result.json new file mode 100644 index 000000000..d47457794 --- /dev/null +++ b/spec/regression/papers/tests/sort-and-paginate/result.json @@ -0,0 +1,63 @@ +{ + "page1": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "_cursor": "{\"id\":\"@{ids/Paper/4}\",\"title\":\"Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services\"}" + }, + { + "title": "Object-oriented modeling and design", + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"title\":\"Object-oriented modeling and design\"}" + } + ] + } + }, + "page2": { + "data": { + "allPapers": [ + { + "title": "Scalable SQL and NoSQL data stores", + "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"title\":\"Scalable SQL and NoSQL data stores\"}" + }, + { + "title": "Unified modeling language reference manual, the", + "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"title\":\"Unified modeling language reference manual, the\"}" + } + ] + } + }, + "page1Desc": { + "data": { + "allPapers": [ + { + "title": "Will NoSQL databases live up to their promise?", + "_cursor": "{\"id\":\"@{ids/Paper/3}\",\"title\":\"Will NoSQL databases live up to their promise?\"}" + }, + { + "title": "Unified modeling language reference manual, the", + "_cursor": "{\"id\":\"@{ids/Paper/2}\",\"title\":\"Unified modeling language reference manual, the\"}" + } + ] + } + }, + "page2Desc": { + "data": { + "allPapers": [ + { + "title": "Scalable SQL and NoSQL data stores", + "_cursor": "{\"id\":\"@{ids/Paper/5}\",\"title\":\"Scalable SQL and NoSQL data stores\"}" + }, + { + "title": "Object-oriented modeling and design", + "_cursor": "{\"id\":\"@{ids/Paper/1}\",\"title\":\"Object-oriented modeling and design\"}" + } + ] + } + }, + "emptyPage": { + "data": { + "allPapers": [] + } + } +} diff --git a/spec/regression/papers/tests/sort-and-paginate.graphql b/spec/regression/papers/tests/sort-and-paginate/test.graphql similarity index 65% rename from spec/regression/papers/tests/sort-and-paginate.graphql rename to spec/regression/papers/tests/sort-and-paginate/test.graphql index 5ce909623..b75aa433b 100644 --- a/spec/regression/papers/tests/sort-and-paginate.graphql +++ b/spec/regression/papers/tests/sort-and-paginate/test.graphql @@ -3,28 +3,39 @@ fragment PapersPage on Paper { _cursor } -query { - page1: allPapers(orderBy: title_ASC, first: 2) { +query page1 { + allPapers(orderBy: title_ASC, first: 2) { ...PapersPage } - page2: allPapers( +} +query page2 { + allPapers( orderBy: title_ASC first: 2 after: "{\"id\":\"@{ids/Paper/1}\",\"title\":\"Object-oriented modeling and design\"}" ) { ...PapersPage } - page1Desc: allPapers(orderBy: title_DESC, first: 2) { +} + +query page1Desc { + allPapers(orderBy: title_DESC, first: 2) { ...PapersPage } - page2Desc: allPapers( +} + +query page2Desc { + allPapers( orderBy: title_DESC first: 2 after: "{\"id\":\"@{ids/Paper/2}\",\"title\":\"Unified modeling language reference manual, the\"}" ) { ...PapersPage } - emptyPage: allPapers(orderBy: title_ASC, first: 0) { +} + +query emptyPage { + allPapers(orderBy: title_ASC, first: 0) { ...PapersPage } } diff --git a/spec/regression/papers/tests/sorting.result.json b/spec/regression/papers/tests/sorting.result.json deleted file mode 100644 index a4f4eaf6e..000000000 --- a/spec/regression/papers/tests/sorting.result.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "data": { - "allPapers": [ - { - "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", - "readers": [] - }, - { - "title": "Object-oriented modeling and design", - "readers": [] - }, - { - "title": "Scalable SQL and NoSQL data stores", - "readers": [] - }, - { - "title": "Unified modeling language reference manual, the", - "readers": [] - }, - { - "title": "Will NoSQL databases live up to their promise?", - "readers": [] - } - ], - "other": [ - { - "isPublished": true - }, - { - "isPublished": true - }, - { - "isPublished": true - }, - { - "isPublished": true - }, - { - "isPublished": null - } - ] - } -} diff --git a/spec/regression/papers/tests/sorting/aql/boolean.aql b/spec/regression/papers/tests/sorting/aql/boolean.aql new file mode 100644 index 000000000..c35b574ad --- /dev/null +++ b/spec/regression/papers/tests/sorting/aql/boolean.aql @@ -0,0 +1,10 @@ +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`isPublished`) DESC + RETURN { + "isPublished": v_paper1.`isPublished` + } + ) +} diff --git a/spec/regression/papers/tests/sorting/aql/string.aql b/spec/regression/papers/tests/sorting/aql/string.aql new file mode 100644 index 000000000..dc0efd78d --- /dev/null +++ b/spec/regression/papers/tests/sorting/aql/string.aql @@ -0,0 +1,20 @@ +WITH @@users +RETURN { + "allPapers": ( + FOR v_paper1 + IN @@papers + SORT (v_paper1.`title`) + RETURN { + "title": v_paper1.`title`, + "readers": ( + FOR v_user1 + IN INBOUND v_paper1 @@users_papers + FILTER v_user1._key != null + SORT (v_user1.`firstName`) DESC + RETURN { + "firstName": v_user1.`firstName` + } + ) + } + ) +} diff --git a/spec/regression/papers/tests/sorting/result.json b/spec/regression/papers/tests/sorting/result.json new file mode 100644 index 000000000..321f4ddea --- /dev/null +++ b/spec/regression/papers/tests/sorting/result.json @@ -0,0 +1,49 @@ +{ + "string": { + "data": { + "allPapers": [ + { + "title": "Brewer's conjecture and the feasibility of consistent, available, partition-tolerant web services", + "readers": [] + }, + { + "title": "Object-oriented modeling and design", + "readers": [] + }, + { + "title": "Scalable SQL and NoSQL data stores", + "readers": [] + }, + { + "title": "Unified modeling language reference manual, the", + "readers": [] + }, + { + "title": "Will NoSQL databases live up to their promise?", + "readers": [] + } + ] + } + }, + "boolean": { + "data": { + "allPapers": [ + { + "isPublished": true + }, + { + "isPublished": true + }, + { + "isPublished": true + }, + { + "isPublished": true + }, + { + "isPublished": null + } + ] + } + } +} diff --git a/spec/regression/papers/tests/sorting.graphql b/spec/regression/papers/tests/sorting/test.graphql similarity index 67% rename from spec/regression/papers/tests/sorting.graphql rename to spec/regression/papers/tests/sorting/test.graphql index 61173fd3e..48aa108a3 100644 --- a/spec/regression/papers/tests/sorting.graphql +++ b/spec/regression/papers/tests/sorting/test.graphql @@ -1,11 +1,14 @@ -query { +query string { allPapers(orderBy: title_ASC) { title readers(orderBy: firstName_DESC) { firstName } } - other: allPapers(orderBy: isPublished_DESC) { +} + +query boolean { + allPapers(orderBy: isPublished_DESC) { isPublished } } diff --git a/spec/regression/regression-suite.ts b/spec/regression/regression-suite.ts index 50abf8a18..e8c0a5c1b 100644 --- a/spec/regression/regression-suite.ts +++ b/spec/regression/regression-suite.ts @@ -1,4 +1,4 @@ -import { existsSync, readdirSync, readFileSync, writeFileSync } from 'fs'; +import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'fs'; import { graphql, GraphQLSchema, OperationDefinitionNode, OperationTypeNode, parse } from 'graphql'; import { resolve } from 'path'; import stripJsonComments from 'strip-json-comments'; @@ -9,8 +9,19 @@ import { IDGenerationInfo, IDGenerator } from '../../src/execution/execution-opt import { ProjectOptions } from '../../src/project/project'; import { loadProjectFromDir } from '../../src/project/project-from-fs'; import { Log4jsLoggerProvider } from '../helpers/log4js-logger-provider'; -import { createTempDatabase, initTestData, TestDataEnvironment } from './initialization'; +import { + createTempDatabase, + getTempDatabaseConfig, + initTestData, + TestDataEnvironment, +} from './initialization'; +import { ErrorWithCause } from '../../src/utils/error-with-cause'; +import { InitTestDataContext } from './init-test-data-context'; import deepEqual = require('deep-equal'); +import { WarnAndErrorLoggerProvider } from '../helpers/warn-and-error-logger-provider'; +import { getLogger } from 'log4js'; +import { RequestProfile } from '../../src/config/interfaces'; +import { unlinkSync } from 'node:fs'; interface TestResult { readonly actualResult: any; @@ -21,7 +32,6 @@ type DatabaseSpecifier = 'arangodb' | 'in-memory'; export interface RegressionSuiteOptions { readonly saveActualAsExpected?: boolean; - readonly trace?: boolean; readonly database?: DatabaseSpecifier; } @@ -45,17 +55,31 @@ interface MetaOptions { }; } +export interface AqlResult { + readonly operationName: string; + readonly expected: string | null; + readonly actual: string | null; +} + +export interface RunTestResult { + readonly actualResult: unknown; + readonly expectedResult: unknown; + readonly aql: ReadonlyArray; +} + +const QUERY_MEMORY_LIMIT_FOR_TESTS = 1_000_000; +const QUERY_MEMORY_LIMIT_FOR_INITIALIZATION = 1_000_000_000; + export class RegressionSuite { private schema: GraphQLSchema | undefined; private testDataEnvironment: TestDataEnvironment | undefined; private _isSetUpClean = false; - // TODO: this is ugly but provides a quick fix for things broken with the silentAdapter - // TODO: implement better regression test architecture for different db types private inMemoryDB: InMemoryDB = new InMemoryDB(); private databaseSpecifier: DatabaseSpecifier; private readonly idGenerator = new PredictableIDGenerator(); private databaseVersion: string | undefined; private nodeVersion: string; + private lastProfile: RequestProfile | undefined; constructor( private readonly path: string, @@ -75,7 +99,6 @@ export class RegressionSuite { ? JSON.parse(stripJsonComments(readFileSync(optionsPath, 'utf-8'))) : {}; - this.inMemoryDB = new InMemoryDB(); this.idGenerator.resetToPhase('init'); const generalOptions: ProjectOptions = { processError: (e) => { @@ -91,44 +114,72 @@ export class RegressionSuite { idGenerator: this.idGenerator, implicitLimitForRootEntityQueries: context.implicitLimitForRootEntityQueries, maxLimitForRootEntityQueries: context.maxLimitForRootEntityQueries, + recordPlan: true, }), modelOptions: { forbiddenRootEntityNames: [], }, + profileConsumer: (profile) => (this.lastProfile = profile), ...options, getOperationIdentifier: ({ info }) => info.operation, }; const warnLevelOptions = { ...generalOptions, - loggerProvider: new Log4jsLoggerProvider('warn'), + loggerProvider: new WarnAndErrorLoggerProvider(), }; const debugLevelOptions = { ...generalOptions, - loggerProvider: new Log4jsLoggerProvider(this.options.trace ? 'trace' : 'warn', { - 'schema-builder': 'warn', - }), + loggerProvider: new Log4jsLoggerProvider(), }; // use a schema that logs less for initTestData and for schema migrations - const silentProject = await loadProjectFromDir( - resolve(this.path, 'model'), - warnLevelOptions, - ); - const silentAdapter = await this.createAdapter(warnLevelOptions); - const silentSchema = silentProject.createSchema(silentAdapter); + // the init db adapter also has a higher query memory limit + const initProject = await loadProjectFromDir(resolve(this.path, 'model'), warnLevelOptions); + const initAdapter = await this.createAdapter(warnLevelOptions, { isInitSchema: true }); + const initSchema = initProject.createSchema(initAdapter); + const initTestDataContext = new InitTestDataContext(initSchema); const project = await loadProjectFromDir(resolve(this.path, 'model'), debugLevelOptions); const adapter = await this.createAdapter(debugLevelOptions); this.schema = project.createSchema(adapter); - await silentAdapter.updateSchema(silentProject.getModel()); - this.testDataEnvironment = await initTestData( - resolve(this.path, 'test-data.json'), - silentSchema, - ); + await this.clearDatabase(); + await initAdapter.updateSchema(initProject.getModel()); + + const testDataJsonPath = resolve(this.path, 'test-data.json'); + const testDataTsPath = resolve(this.path, 'test-data.ts'); + if (existsSync(testDataJsonPath)) { + this.testDataEnvironment = await initTestData( + resolve(this.path, 'test-data.json'), + initTestDataContext, + ); + } else if (existsSync(testDataTsPath)) { + let testDataTsModule; + try { + testDataTsModule = await import(testDataTsPath); + } catch (e) { + throw new ErrorWithCause(`Error importing ${testDataTsPath}`, e); + } + if (!testDataTsModule.default || typeof testDataTsModule.default !== 'function') { + throw new Error(`${testDataTsPath} does not export a default function`); + } + try { + await testDataTsModule.default(initTestDataContext); + } catch (e) { + throw new ErrorWithCause( + `Error executing default function from ${testDataTsPath}`, + e, + ); + } + // if we need to reference IDs within tests, we need to let the default function return + // a map of logical to actual IDs and map that here + this.testDataEnvironment = { fillTemplateStrings: (s) => s }; + } else { + this.testDataEnvironment = { fillTemplateStrings: (s) => s }; + } if (this.databaseSpecifier === 'arangodb') { - const version = await (adapter as ArangoDBAdapter).getArangoDBVersion(); + const version = await (initAdapter as ArangoDBAdapter).getArangoDBVersion(); if (version) { this.databaseVersion = `${version.major}.${version.minor}`; } @@ -137,29 +188,55 @@ export class RegressionSuite { this._isSetUpClean = true; } - private async createAdapter(context: ProjectOptions): Promise { + private async clearDatabase() { + switch (this.databaseSpecifier) { + case 'in-memory': + this.inMemoryDB = new InMemoryDB(); + break; + case 'arangodb': + await createTempDatabase(); + break; + default: + throw new Error(`Unknown database specifier: ${this.databaseSpecifier}`); + } + } + + private async createAdapter( + context: ProjectOptions, + { isInitSchema = false } = {}, + ): Promise { switch (this.databaseSpecifier) { case 'in-memory': return new InMemoryAdapter({ db: this.inMemoryDB }, context); case 'arangodb': - const dbConfig = await createTempDatabase(); - return new ArangoDBAdapter(dbConfig, context); + return new ArangoDBAdapter( + { + ...getTempDatabaseConfig(), + // intentionally set low so we catch issues in tests + // but silent schema uses higher limit because it's used in the setup + queryMemoryLimit: isInitSchema + ? QUERY_MEMORY_LIMIT_FOR_INITIALIZATION + : QUERY_MEMORY_LIMIT_FOR_TESTS, + }, + context, + ); default: throw new Error(`Unknown database specifier: ${this.databaseSpecifier}`); } } getTestNames() { - return readdirSync(resolve(this.path, 'tests')) - .filter((name) => name.endsWith('.graphql')) - .map((name) => name.substring(0, name.length - '.graphql'.length)); + return readdirSync(resolve(this.path, 'tests')); } async shouldIgnoreTest(name: string) { if (!this._isSetUpClean) { await this.setUp(); } - const metaPath = resolve(this.testsPath, name + '.meta.json'); + let metaPath = resolve(this.testsPath, name, 'meta.json'); + if (!existsSync(metaPath)) { + metaPath = resolve(this.path, 'meta.json'); + } const meta: MetaOptions | undefined = existsSync(metaPath) ? JSON.parse(stripJsonComments(readFileSync(metaPath, 'utf-8'))) : undefined; @@ -182,7 +259,7 @@ export class RegressionSuite { return false; } - async runTest(name: string) { + async runTest(name: string): Promise { if (!this._isSetUpClean) { await this.setUp(); } @@ -192,11 +269,11 @@ export class RegressionSuite { throw new Error(`Regression suite not set up correctly`); } - const gqlPath = resolve(this.testsPath, name + '.graphql'); - const resultPath = resolve(this.testsPath, name + '.result.json'); - const variablesPath = resolve(this.testsPath, name + '.vars.json'); - let contextPath = resolve(this.testsPath, name + '.context.json'); - const metaPath = resolve(this.testsPath, name + '.meta.json'); + const gqlPath = resolve(this.testsPath, name, 'test.graphql'); + const resultPath = resolve(this.testsPath, name, 'result.json'); + const variablesPath = resolve(this.testsPath, name, 'vars.json'); + let contextPath = resolve(this.testsPath, name, 'context.json'); + const metaPath = resolve(this.testsPath, name, 'meta.json'); if (!existsSync(contextPath)) { contextPath = resolve(this.path, 'default-context.json'); } @@ -209,7 +286,6 @@ export class RegressionSuite { ) as ReadonlyArray; this._isSetUpClean = this._isSetUpClean && !operations.some((op) => op.operation == 'mutation'); - const hasNamedOperations = operations.length && operations[0].name; const expectedResultTemplate = JSON.parse( stripJsonComments(readFileSync(resultPath, 'utf-8')), @@ -225,71 +301,126 @@ export class RegressionSuite { ? JSON.parse(stripJsonComments(readFileSync(metaPath, 'utf-8'))) : {}; - let actualResult: any; - if (hasNamedOperations) { - const operationNames = operations.map((def) => def.name!.value); - actualResult = {}; - let arangoSearchPending = true; - for (const operationName of operationNames) { - const operation = operations.find((o) => o.name?.value === operationName); - if (!operation) { - throw new Error(`Exected operation ${operationName} to exist`); - } - - // we need to wait for arangosearch views to catch up before we can perform a query - if ( - meta.waitForArangoSearch && - this.databaseSpecifier === 'arangodb' && - arangoSearchPending && - operation.operation === OperationTypeNode.QUERY - ) { - await new Promise((resolve) => setTimeout(resolve, 2000)); - arangoSearchPending = false; - } + let actualResult: Record = {}; + let arangoSearchPending = true; + const aqlResults: AqlResult[] = []; + const aqlDir = resolve(this.testsPath, name, 'aql'); + let superfluousAqlFiles: Set = new Set(); - let operationContext = context; - if (context && context.operations && context.operations[operationName]) { - operationContext = context.operations[operationName]; - } - let operationResult = await graphql({ - schema: this.schema, - source: gqlSource, - rootValue: {}, - contextValue: operationContext, - variableValues, - operationName, - }); - operationResult = JSON.parse(JSON.stringify(operationResult)); // serialize e.g. errors as they would be in a GraphQL server - actualResult[operationName] = operationResult; + if (this.databaseSpecifier === 'arangodb') { + if (existsSync(aqlDir)) { + superfluousAqlFiles = new Set( + readdirSync(aqlDir) + .filter((f) => f.endsWith('.aql')) + .map((f) => f.substring(0, f.length - '.aql'.length)), + ); + } + } - if (operation.operation === OperationTypeNode.MUTATION) { - // we need to wait for arangosearch again if we performed a mutation - arangoSearchPending = true; - } + for (const operation of operations) { + const operationName = operation.name?.value; + if (!operationName) { + throw new Error(`Anonymous operations are not sppported in regression tests`); } - } else { - if (meta.waitForArangoSearch && this.databaseSpecifier === 'arangodb') { + + // we need to wait for arangosearch views to catch up before we can perform a query + if ( + meta.waitForArangoSearch && + this.databaseSpecifier === 'arangodb' && + arangoSearchPending && + operation.operation === OperationTypeNode.QUERY + ) { await new Promise((resolve) => setTimeout(resolve, 2000)); + arangoSearchPending = false; } - actualResult = await graphql({ + + let operationContext = context; + if (context && context.operations && context.operations[operationName]) { + operationContext = context.operations[operationName]; + } + this.lastProfile = undefined; + let operationResult = await graphql({ schema: this.schema, source: gqlSource, rootValue: {}, - contextValue: context, + contextValue: operationContext, variableValues, + operationName, + }); + operationResult = JSON.parse(JSON.stringify(operationResult)); // serialize e.g. errors as they would be in a GraphQL server + actualResult[operationName] = operationResult; + + if (this.databaseSpecifier === 'arangodb') { + // typescript incorrectly narrows down this.lastProfile to undefined + const profile = this.lastProfile as RequestProfile | undefined; + const queries = (profile?.plan?.transactionSteps ?? []).map((s) => s.query); + const actualAql = queries.length + ? formatWhitespaceInFile( + queries.join('\n\n// --------------------------------\n\n'), + ) + : null; + + const aqlFilePath = resolve(aqlDir, `${operationName}.aql`); + + const expectedAql = existsSync(aqlFilePath) + ? readFileSync(aqlFilePath, 'utf-8') + : null; + + if (this.options.saveActualAsExpected && actualAql !== expectedAql) { + if (actualAql !== null) { + mkdirSync(aqlDir, { recursive: true }); + writeFileSync(aqlFilePath, actualAql, 'utf-8'); + } else { + unlinkSync(aqlFilePath); + } + } + + if (expectedAql !== null) { + superfluousAqlFiles.delete(operationName); + } + + aqlResults.push({ + operationName, + expected: expectedAql, + actual: actualAql, + }); + } + + if (operation.operation === OperationTypeNode.MUTATION) { + // we need to wait for arangosearch again if we performed a mutation + arangoSearchPending = true; + } + } + + for (const superfluousAqlFile of superfluousAqlFiles) { + const aqlFilePath = resolve(aqlDir, `${superfluousAqlFile}.aql`); + aqlResults.push({ + operationName: superfluousAqlFile, + expected: readFileSync(aqlFilePath, 'utf8'), + actual: null, }); - actualResult = JSON.parse(JSON.stringify(actualResult)); // serialize e.g. errors as they would be in a GraphQL server + + if (this.options.saveActualAsExpected) { + unlinkSync(aqlFilePath); + } } if (this.options.saveActualAsExpected && !deepEqual(actualResult, expectedResult)) { - writeFileSync(resultPath, JSON.stringify(actualResult, undefined, ' '), 'utf-8'); + writeFileSync( + resultPath, + formatWhitespaceInFile(JSON.stringify(actualResult, undefined, ' ')), + 'utf-8', + ); } return { actualResult, expectedResult, + aql: aqlResults, }; } + + private async runOperation(operation: OperationDefinitionNode) {} } class PredictableIDGenerator implements IDGenerator { @@ -308,3 +439,17 @@ class PredictableIDGenerator implements IDGenerator { this.nextNumberPerTarget = new Map(); } } + +function formatWhitespaceInFile(s: string) { + if (!s.endsWith('\n')) { + s += '\n'; + } + + // remove trailing whitespace in lines + // (editors remove that, so it's hard to keep it in expected files) + s = s + .split('\n') + .map((line) => line.replace(/\s+$/g, '')) + .join('\n'); + return s; +} diff --git a/spec/regression/regressions.spec.ts b/spec/regression/regressions.spec.ts index 1d776f1f7..6b39fcb17 100644 --- a/spec/regression/regressions.spec.ts +++ b/spec/regression/regressions.spec.ts @@ -1,8 +1,9 @@ -import { expect } from 'chai'; +import { expect, assert } from 'chai'; import { readdirSync, statSync } from 'fs'; import { resolve } from 'path'; import { likePatternToRegExp } from '../../src/database/like-helpers'; import { RegressionSuite, RegressionSuiteOptions } from './regression-suite'; +import { getLogger } from 'log4js'; const regressionRootDir = __dirname; @@ -28,6 +29,26 @@ describe('regression tests', async () => { testNameFilter = (name) => !!name.match(regex); } + // log levels can only bet set globally in log4js, so we're doing it here + const trace = process.argv.includes('--log-trace'); + const traceLogNames = ['ArangoDBAdapter', 'InMemoryAdapter', 'query-resolvers']; + const traceLoggers = traceLogNames.map((name) => getLogger(name)); + const previousLevels = traceLoggers.map((logger) => logger.level); + beforeEach(async () => { + if (trace) { + for (const logger of traceLoggers) { + logger.level = 'trace'; + } + } + }); + afterEach(async () => { + if (trace) { + for (let i = 0; i < traceLoggers.length; i++) { + traceLoggers[i].level = previousLevels[i]; + } + } + }); + for (const database of databases) { describe(`for ${database}`, async () => { for (const suiteName of dirs) { @@ -36,19 +57,47 @@ describe('regression tests', async () => { // (first npm test run still marked as failure, subsequent runs will pass) const options: RegressionSuiteOptions = { saveActualAsExpected: process.argv.includes('--save-actual-as-expected'), - trace: process.argv.includes('--log-trace'), database, }; const suite = new RegressionSuite(suitePath, options); describe(suiteName, async () => { - for (const testName of suite.getTestNames().filter(testNameFilter)) { + const testNames = suite + .getTestNames() + .filter((testName) => testNameFilter(`${suiteName}/${testName}`)); + + for (const testName of testNames) { it(testName, async function () { if (await suite.shouldIgnoreTest(testName)) { this.skip(); } - const { expectedResult, actualResult } = await suite.runTest(testName); - expect(actualResult).to.deep.equal(expectedResult); + const result = await suite.runTest(testName); + expect(result.actualResult).to.deep.equal(result.expectedResult); + + for (const aqlResult of result.aql) { + const aqlFileName = `regression/${suiteName}/tests/${testName}/aql/${aqlResult.operationName}.aql`; + + // "actual" is the generated AQL, expected is the file contents + // the messages just turn "expected" around to say the file (which should contain the expected AQL) + // is *expected* to exist or not, that's why this looks inverted here + if (aqlResult.actual !== null && aqlResult.expected === null) { + assert.fail( + `AQL file at "${aqlFileName}" missing (run with --save-actual-as-expected to create it)`, + ); + } else if ( + aqlResult.expected !== null && + aqlResult.actual === null + ) { + assert.fail( + `AQL file at "${aqlFileName}" should not exist because there is no operation called ${aqlResult.operationName} (or it does not produce AQL)`, + ); + } else { + expect(aqlResult.actual).to.equal( + aqlResult.expected, + `AQL of operation ${aqlResult.operationName} does not match expected AQL in "${aqlFileName}" (run with --save-actual-as-expected to update the file)`, + ); + } + } }).timeout(10000); // travis is sometimes on the slower side } }); diff --git a/spec/regression/relation-delete-actions/tests/cascade/aql/createEdges.aql b/spec/regression/relation-delete-actions/tests/cascade/aql/createEdges.aql new file mode 100644 index 000000000..7b7be94a2 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/cascade/aql/createEdges.aql @@ -0,0 +1,119 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_to1 IN [@var1] + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + UPSERT {_from: CONCAT(@var1, FIRST(@v_updatedIds1))} + INSERT {_from: CONCAT(@var2, FIRST(@v_updatedIds1)), _to: @var3} + UPDATE {_from: CONCAT(@var4, FIRST(@v_updatedIds1)), _to: @var5} + IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN DOCUMENT(@@alternativeDependents, @var1) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN DOCUMENT(@@alternativeDependents, @var1) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +LET v_main1 = DOCUMENT(@@mains, @var1) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN { + "updateMain": @v_updateMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/cascade/aql/delete.aql b/spec/regression/relation-delete-actions/tests/cascade/aql/delete.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/cascade/aql/delete.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/cascade/aql/everything.aql b/spec/regression/relation-delete-actions/tests/cascade/aql/everything.aql new file mode 100644 index 000000000..655536a6d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/cascade/aql/everything.aql @@ -0,0 +1,26 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ), + "allDependents": ( + FOR v_dependent1 + IN @@dependents + SORT (v_dependent1.`key`) + RETURN { + "key": v_dependent1.`key` + } + ), + "allAlternativeDependents": ( + FOR v_alternativeDependent1 + IN @@alternativeDependents + SORT (v_alternativeDependent1.`key`) + RETURN { + "key": v_alternativeDependent1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/cascade.result.json b/spec/regression/relation-delete-actions/tests/cascade/result.json similarity index 100% rename from spec/regression/relation-delete-actions/tests/cascade.result.json rename to spec/regression/relation-delete-actions/tests/cascade/result.json diff --git a/spec/regression/relation-delete-actions/tests/cascade.graphql b/spec/regression/relation-delete-actions/tests/cascade/test.graphql similarity index 100% rename from spec/regression/relation-delete-actions/tests/cascade.graphql rename to spec/regression/relation-delete-actions/tests/cascade/test.graphql diff --git a/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/createEdges.aql b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/createEdges.aql new file mode 100644 index 000000000..c043b2536 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/createEdges.aql @@ -0,0 +1,196 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN DOCUMENT(@@alternativeDependents, @var1) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +LET v_main1 = DOCUMENT(@@mains, @var1) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_dependent1 + IN @@dependents + FILTER (v_dependent1._key == @var1) + LIMIT @var2 + RETURN v_dependent1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@dependents + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN DOCUMENT(@@alternativeDependents, @var1) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_dependent1 + IN @@dependents + FILTER (v_dependent1._key == @var1) + LIMIT @var2 + RETURN v_dependent1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@dependents + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN DOCUMENT(@@alternativeDependents, @var1) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN ( + FOR v_dependent1 + IN [ + DOCUMENT(@@dependents, @var1), + DOCUMENT(@@dependents, @var2) + ] + RETURN { + "key": v_dependent1.`key` + } +) + +// -------------------------------- + +WITH @@dependents, @@alternativeDependents, @@mains +RETURN { + "updateMain": @v_updateMain1, + "updateDependents": @v_updateDependents1 +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/delete.aql b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/delete.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/delete.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/everything.aql b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/everything.aql new file mode 100644 index 000000000..655536a6d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-cascade/aql/everything.aql @@ -0,0 +1,26 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ), + "allDependents": ( + FOR v_dependent1 + IN @@dependents + SORT (v_dependent1.`key`) + RETURN { + "key": v_dependent1.`key` + } + ), + "allAlternativeDependents": ( + FOR v_alternativeDependent1 + IN @@alternativeDependents + SORT (v_alternativeDependent1.`key`) + RETURN { + "key": v_alternativeDependent1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-cascade.result.json b/spec/regression/relation-delete-actions/tests/indirect-cascade/result.json similarity index 100% rename from spec/regression/relation-delete-actions/tests/indirect-cascade.result.json rename to spec/regression/relation-delete-actions/tests/indirect-cascade/result.json diff --git a/spec/regression/relation-delete-actions/tests/indirect-cascade.graphql b/spec/regression/relation-delete-actions/tests/indirect-cascade/test.graphql similarity index 100% rename from spec/regression/relation-delete-actions/tests/indirect-cascade.graphql rename to spec/regression/relation-delete-actions/tests/indirect-cascade/test.graphql diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/createEdges.aql b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/createEdges.aql new file mode 100644 index 000000000..1a4851d17 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/createEdges.aql @@ -0,0 +1,169 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents +RETURN DOCUMENT(@@dependents, @var1) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_dependents +) + +// -------------------------------- + +WITH @@dependents, @@mains +RETURN ( + FOR v_main1 + IN [ + DOCUMENT(@@mains, @var1), + DOCUMENT(@@mains, @var2) + ] + RETURN { + "key": v_main1.`key` + } +) + +// -------------------------------- + +WITH @@dependents, @@mains +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_dependent1 + IN @@dependents + FILTER (v_dependent1._key == @var1) + LIMIT @var2 + RETURN v_dependent1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@dependents + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@dependents, @@mains, @@blockers +RETURN DOCUMENT(@@blockers, @var1) + +// -------------------------------- + +WITH @@dependents, @@mains, @@blockers +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@dependents, @@mains, @@blockers +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@dependents, @@mains, @@blockers +RETURN ( + FOR v_dependent1 + IN [ + DOCUMENT(@@dependents, @var1) + ] + RETURN { + "key": v_dependent1.`key` + } +) + +// -------------------------------- + +WITH @@dependents, @@mains, @@blockers +RETURN { + "updateMains": @v_updateMains1, + "updateDependents": @v_updateDependents1 +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteRestricted.aql b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteRestricted.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteRestricted.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteSuccessfully.aql b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteSuccessfully.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/deleteSuccessfully.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/everything.aql b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/everything.aql new file mode 100644 index 000000000..5f432d2b4 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/indirect-restrict/aql/everything.aql @@ -0,0 +1,26 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ), + "allDependents": ( + FOR v_dependent1 + IN @@dependents + SORT (v_dependent1.`key`) + RETURN { + "key": v_dependent1.`key` + } + ), + "allBlockers": ( + FOR v_blocker1 + IN @@blockers + SORT (v_blocker1.`key`) + RETURN { + "key": v_blocker1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict.result.json b/spec/regression/relation-delete-actions/tests/indirect-restrict/result.json similarity index 100% rename from spec/regression/relation-delete-actions/tests/indirect-restrict.result.json rename to spec/regression/relation-delete-actions/tests/indirect-restrict/result.json diff --git a/spec/regression/relation-delete-actions/tests/indirect-restrict.graphql b/spec/regression/relation-delete-actions/tests/indirect-restrict/test.graphql similarity index 100% rename from spec/regression/relation-delete-actions/tests/indirect-restrict.graphql rename to spec/regression/relation-delete-actions/tests/indirect-restrict/test.graphql diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/createEdges.aql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/createEdges.aql new file mode 100644 index 000000000..866c2e50c --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/createEdges.aql @@ -0,0 +1,62 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@mains +RETURN DOCUMENT(@@mains, @var1) + +// -------------------------------- + +WITH @@mains +RETURN DOCUMENT(@@mains, @var1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains +LET v_main1 = DOCUMENT(@@mains, @var1) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains +RETURN { + "updateMain": @v_updateMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteRestricted.aql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteRestricted.aql new file mode 100644 index 000000000..b67909395 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteRestricted.aql @@ -0,0 +1,364 @@ +WITH @@mains +RETURN ( + FOR v_item1 + IN [ + DOCUMENT(@@mains, @var1), + DOCUMENT(@@mains, @var2) + ] + FILTER (v_item1 > NULL) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_main1 + IN ( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD + ) + RETURN { + "key": v_main1.`key` + } +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMains": @v_deleteMains1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteSuccessfully.aql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteSuccessfully.aql new file mode 100644 index 000000000..25445e571 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/deleteSuccessfully.aql @@ -0,0 +1,365 @@ +WITH @@mains +RETURN ( + FOR v_item1 + IN [ + DOCUMENT(@@mains, @var1), + DOCUMENT(@@mains, @var2), + DOCUMENT(@@mains, @var3) + ] + FILTER (v_item1 > NULL) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_main1 + IN ( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD + ) + RETURN { + "key": v_main1.`key` + } +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMains": @v_deleteMains1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything1.aql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything1.aql new file mode 100644 index 000000000..63e8119db --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything1.aql @@ -0,0 +1,10 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything2.aql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything2.aql new file mode 100644 index 000000000..63e8119db --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/aql/everything2.aql @@ -0,0 +1,10 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion.result.json b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/result.json similarity index 100% rename from spec/regression/relation-delete-actions/tests/restrict-with-recursion.result.json rename to spec/regression/relation-delete-actions/tests/restrict-with-recursion/result.json diff --git a/spec/regression/relation-delete-actions/tests/restrict-with-recursion.graphql b/spec/regression/relation-delete-actions/tests/restrict-with-recursion/test.graphql similarity index 100% rename from spec/regression/relation-delete-actions/tests/restrict-with-recursion.graphql rename to spec/regression/relation-delete-actions/tests/restrict-with-recursion/test.graphql diff --git a/spec/regression/relation-delete-actions/tests/restrict/aql/createEdges.aql b/spec/regression/relation-delete-actions/tests/restrict/aql/createEdges.aql new file mode 100644 index 000000000..cb57af0e3 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict/aql/createEdges.aql @@ -0,0 +1,57 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_main1 + IN @@mains + FILTER (v_main1._key == @var1) + LIMIT @var2 + RETURN v_main1 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@mains + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@blockers +RETURN DOCUMENT(@@blockers, @var1) + +// -------------------------------- + +WITH @@blockers +RETURN ( + FOR v_to1 IN @var1 + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@blockers +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@mains_blockers +) + +// -------------------------------- + +WITH @@blockers, @@mains +LET v_main1 = DOCUMENT(@@mains, @var1) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@blockers, @@mains +RETURN { + "updateMain": @v_updateMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict/aql/deleteRestricted.aql b/spec/regression/relation-delete-actions/tests/restrict/aql/deleteRestricted.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict/aql/deleteRestricted.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict/aql/deleteSuccessfully.aql b/spec/regression/relation-delete-actions/tests/restrict/aql/deleteSuccessfully.aql new file mode 100644 index 000000000..67a9b501d --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict/aql/deleteSuccessfully.aql @@ -0,0 +1,358 @@ +RETURN ( + FOR v_main1 + IN @@mains + FILTER (v_main1.`key` == @var1) + LIMIT @var2 + RETURN v_main1._key +) + +// -------------------------------- + +WITH @@mains +RETURN MINUS(( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockingMains + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +), @v_ids1) + +// -------------------------------- + +WITH @@mains +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@mains_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_additionalDependent + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_additionalDependentIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_additionalDependentIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@mains_dependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_blockers + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_from1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_blockers + FILTER v_edge1._from == v_from1 + REMOVE v_edge1 IN @@dependents_blockers +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_item1 + IN ( + FOR v_sourceEntity1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_node1, v_edge1, v_path1 IN @var2..@var3 OUTBOUND v_sourceEntity1 @@dependents_alternativeDependents + FILTER v_node1._key != null + RETURN v_node1 + ) + RETURN v_item1._key +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_alternativeDependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@dependents_alternativeDependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@dependents_alternativeDependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_alternativeDependent1 + IN @v_alternativeDependentsIDs1 + REMOVE v_alternativeDependent1 + IN @@alternativeDependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_dependents + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_dependents +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_dependentsIDs1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_additionalDependent + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_additionalDependent +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_dependent1 + IN @v_dependentsIDs1 + REMOVE v_dependent1 + IN @@dependents + RETURN OLD +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN ( + FOR v_to1 IN (FOR v_id1 IN @v_ids1 RETURN CONCAT(@var1, v_id1)) + FOR v_edge1 IN @@mains_blockingMains + FILTER v_edge1._to == v_to1 + REMOVE v_edge1 IN @@mains_blockingMains +) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +LET v_main1 = FIRST(( + FOR v_main2 + IN @v_ids1 + REMOVE v_main2 + IN @@mains + RETURN OLD +)) +RETURN (IS_NULL(v_main1) ? null : { + "key": v_main1.`key` +}) + +// -------------------------------- + +WITH @@mains, @@blockers, @@alternativeDependents, @@dependents +RETURN { + "deleteMain": @v_deleteMain1 +} diff --git a/spec/regression/relation-delete-actions/tests/restrict/aql/everything.aql b/spec/regression/relation-delete-actions/tests/restrict/aql/everything.aql new file mode 100644 index 000000000..3e188b5e7 --- /dev/null +++ b/spec/regression/relation-delete-actions/tests/restrict/aql/everything.aql @@ -0,0 +1,18 @@ +RETURN { + "allMains": ( + FOR v_main1 + IN @@mains + SORT (v_main1.`key`) + RETURN { + "key": v_main1.`key` + } + ), + "allBlockers": ( + FOR v_blocker1 + IN @@blockers + SORT (v_blocker1.`key`) + RETURN { + "key": v_blocker1.`key` + } + ) +} diff --git a/spec/regression/relation-delete-actions/tests/restrict.result.json b/spec/regression/relation-delete-actions/tests/restrict/result.json similarity index 100% rename from spec/regression/relation-delete-actions/tests/restrict.result.json rename to spec/regression/relation-delete-actions/tests/restrict/result.json diff --git a/spec/regression/relation-delete-actions/tests/restrict.graphql b/spec/regression/relation-delete-actions/tests/restrict/test.graphql similarity index 100% rename from spec/regression/relation-delete-actions/tests/restrict.graphql rename to spec/regression/relation-delete-actions/tests/restrict/test.graphql diff --git a/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/createEdge.aql b/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/createEdge.aql new file mode 100644 index 000000000..5877e7735 --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/createEdge.aql @@ -0,0 +1,52 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_root21 + IN @@root2s + FILTER (v_root21._key == @var1) + LIMIT @var2 + RETURN v_root21 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@root2s + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@roots +RETURN DOCUMENT(@@roots, @var1) + +// -------------------------------- + +WITH @@roots +RETURN DOCUMENT(@@roots, @var1) + +// -------------------------------- + +WITH @@roots +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@root2s_roots +) + +// -------------------------------- + +WITH @@roots, @@root2s +LET v_root21 = DOCUMENT(@@root2s, @var1) +RETURN (IS_NULL(v_root21) ? null : { + "name": v_root21.`name` +}) + +// -------------------------------- + +WITH @@roots, @@root2s +RETURN { + "updateRoot2": @v_updateRoot21 +} diff --git a/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/q.aql b/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/q.aql new file mode 100644 index 000000000..f32305eac --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent-with-collect/aql/q.aql @@ -0,0 +1,66 @@ +WITH @@roots +RETURN { + "allRoot2s": ( + FOR v_root21 + IN @@root2s + RETURN { + "name": v_root21.`name`, + "roots": ( + FOR v_root1 + IN OUTBOUND v_root21 @@root2s_roots + FILTER v_root1._key != null + SORT (v_root1.`name`) + RETURN { + "grandchildren": v_root1.`children`[*].`children`[*][** RETURN { + "parent": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "root": { + "name": v_root1.`name` + } + }], + "extensionGrandchildren": v_root1.`children`[*].`extension`.`children`[*][** RETURN { + "parent": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 }, + "root": { + "name": v_root1.`name` + } + }] + } + ), + "rootGrandchildren": ( + FOR v_root2, v_edge1, v_path1 IN @var5..@var6 OUTBOUND v_root21 @@root2s_roots + FILTER v_root2._key != null + FOR v_item1 IN v_root2.`children`[*].`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "parent": { __cruddl_runtime_error_code: @var7, __cruddl_runtime_error: @var8 }, + "root": { + "name": v_root2.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ), + "rootExtensionGrandchildren": ( + FOR v_root3, v_edge2, v_path2 IN @var9..@var10 OUTBOUND v_root21 @@root2s_roots + FILTER v_root3._key != null + FOR v_item2 IN v_root3.`children`[*].`extension`.`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "parent": { __cruddl_runtime_error_code: @var11, __cruddl_runtime_error: @var12 }, + "root": { + "name": v_root3.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item2.sortValues[0] + RETURN v_item2.value + ) + } + ) +} diff --git a/spec/regression/root-fields/tests/root-and-parent-with-collect.result.json b/spec/regression/root-fields/tests/root-and-parent-with-collect/result.json similarity index 100% rename from spec/regression/root-fields/tests/root-and-parent-with-collect.result.json rename to spec/regression/root-fields/tests/root-and-parent-with-collect/result.json diff --git a/spec/regression/root-fields/tests/root-and-parent-with-collect.graphql b/spec/regression/root-fields/tests/root-and-parent-with-collect/test.graphql similarity index 100% rename from spec/regression/root-fields/tests/root-and-parent-with-collect.graphql rename to spec/regression/root-fields/tests/root-and-parent-with-collect/test.graphql diff --git a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.result.json b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.result.json deleted file mode 100644 index eaadcc923..000000000 --- a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.result.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "errors": [ - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 6, - "column": 13 - }, - { - "line": 24, - "column": 13 - } - ], - "path": ["allRoots", 0, "grandchildren", 0, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 6, - "column": 13 - }, - { - "line": 24, - "column": 13 - } - ], - "path": ["allRoots", 1, "grandchildren", 0, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 6, - "column": 13 - }, - { - "line": 24, - "column": 13 - } - ], - "path": ["allRoots", 1, "grandchildren", 1, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 6, - "column": 13 - }, - { - "line": 24, - "column": 13 - } - ], - "path": ["allRoots", 1, "grandchildren", 2, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 6, - "column": 13 - }, - { - "line": 24, - "column": 13 - } - ], - "path": ["allRoots", 1, "grandchildren", 3, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 30, - "column": 13 - }, - { - "line": 48, - "column": 13 - } - ], - "path": ["allRoots", 1, "extensionGrandchildren", 0, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 30, - "column": 13 - }, - { - "line": 48, - "column": 13 - } - ], - "path": ["allRoots", 1, "extensionGrandchildren", 1, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 30, - "column": 13 - }, - { - "line": 48, - "column": 13 - } - ], - "path": ["allRoots", 1, "extensionGrandchildren", 2, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - }, - { - "message": "Parent entity is not available here", - "locations": [ - { - "line": 30, - "column": 13 - }, - { - "line": 48, - "column": 13 - } - ], - "path": ["allRoots", 1, "extensionGrandchildren", 3, "parent"], - "extensions": { - "code": "NOT_SUPPORTED" - } - } - ], - "data": { - "allRoots": [ - { - "name": "r1", - "grandchildren": [ - { - "name": "r1c1g1", - "parent": null, - "root": { - "name": "r1" - } - } - ], - "extensionGrandchildren": [] - }, - { - "name": "r2", - "grandchildren": [ - { - "name": "r2c1g1", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c1g2", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2g1", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2g2", - "parent": null, - "root": { - "name": "r2" - } - } - ], - "extensionGrandchildren": [ - { - "name": "r2c1eg1", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c1eg2", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2eg1", - "parent": null, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2ge2", - "parent": null, - "root": { - "name": "r2" - } - } - ] - } - ] - } -} diff --git a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/aql/test.aql b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/aql/test.aql new file mode 100644 index 000000000..6cb9a16b0 --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/aql/test.aql @@ -0,0 +1,24 @@ +RETURN { + "allRoots": ( + FOR v_root1 + IN @@roots + SORT (v_root1.`name`) + RETURN { + "name": v_root1.`name`, + "grandchildren": v_root1.`children`[*].`children`[*][** RETURN { + "name": CURRENT.`name`, + "parent": { __cruddl_runtime_error_code: @var1, __cruddl_runtime_error: @var2 }, + "root": { + "name": v_root1.`name` + } + }], + "extensionGrandchildren": v_root1.`children`[*].`extension`.`children`[*][** RETURN { + "name": CURRENT.`name`, + "parent": { __cruddl_runtime_error_code: @var3, __cruddl_runtime_error: @var4 }, + "root": { + "name": v_root1.`name` + } + }] + } + ) +} diff --git a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/result.json b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/result.json new file mode 100644 index 000000000..20ac45ffe --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/result.json @@ -0,0 +1,239 @@ +{ + "test": { + "errors": [ + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 6, + "column": 13 + }, + { + "line": 24, + "column": 13 + } + ], + "path": ["allRoots", 0, "grandchildren", 0, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 6, + "column": 13 + }, + { + "line": 24, + "column": 13 + } + ], + "path": ["allRoots", 1, "grandchildren", 0, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 6, + "column": 13 + }, + { + "line": 24, + "column": 13 + } + ], + "path": ["allRoots", 1, "grandchildren", 1, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 6, + "column": 13 + }, + { + "line": 24, + "column": 13 + } + ], + "path": ["allRoots", 1, "grandchildren", 2, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 6, + "column": 13 + }, + { + "line": 24, + "column": 13 + } + ], + "path": ["allRoots", 1, "grandchildren", 3, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 30, + "column": 13 + }, + { + "line": 48, + "column": 13 + } + ], + "path": ["allRoots", 1, "extensionGrandchildren", 0, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 30, + "column": 13 + }, + { + "line": 48, + "column": 13 + } + ], + "path": ["allRoots", 1, "extensionGrandchildren", 1, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 30, + "column": 13 + }, + { + "line": 48, + "column": 13 + } + ], + "path": ["allRoots", 1, "extensionGrandchildren", 2, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + }, + { + "message": "Parent entity is not available here", + "locations": [ + { + "line": 30, + "column": 13 + }, + { + "line": 48, + "column": 13 + } + ], + "path": ["allRoots", 1, "extensionGrandchildren", 3, "parent"], + "extensions": { + "code": "NOT_SUPPORTED" + } + } + ], + "data": { + "allRoots": [ + { + "name": "r1", + "grandchildren": [ + { + "name": "r1c1g1", + "parent": null, + "root": { + "name": "r1" + } + } + ], + "extensionGrandchildren": [] + }, + { + "name": "r2", + "grandchildren": [ + { + "name": "r2c1g1", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c1g2", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2g1", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2g2", + "parent": null, + "root": { + "name": "r2" + } + } + ], + "extensionGrandchildren": [ + { + "name": "r2c1eg1", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c1eg2", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2eg1", + "parent": null, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2ge2", + "parent": null, + "root": { + "name": "r2" + } + } + ] + } + ] + } + } +} diff --git a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.graphql b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/test.graphql similarity index 98% rename from spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.graphql rename to spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/test.graphql index 244dd2d08..6179c5383 100644 --- a/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect.graphql +++ b/spec/regression/root-fields/tests/root-and-parent-with-intra-root-entity-collect/test.graphql @@ -1,4 +1,4 @@ -query { +query test { allRoots(orderBy: name_ASC) { name grandchildren { diff --git a/spec/regression/root-fields/tests/root-and-parent.result.json b/spec/regression/root-fields/tests/root-and-parent.result.json deleted file mode 100644 index 8c1a9bf02..000000000 --- a/spec/regression/root-fields/tests/root-and-parent.result.json +++ /dev/null @@ -1,200 +0,0 @@ -{ - "data": { - "allRoots": [ - { - "name": "r1", - "children": [ - { - "name": "r1c1", - "children": [ - { - "name": "r1c1g1", - "parent": { - "name": "r1c1", - "parent": { - "name": "r1" - }, - "children": [ - { - "name": "r1c1g1", - "parent": { - "name": "r1c1", - "parent": { - "name": "r1" - } - } - } - ] - }, - "root": { - "name": "r1" - } - } - ], - "parent": { - "name": "r1" - }, - "root": { - "name": "r1" - } - } - ] - }, - { - "name": "r2", - "children": [ - { - "name": "r2c1", - "children": [ - { - "name": "r2c1g1", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - }, - "children": [ - { - "name": "r2c1g1", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - } - } - }, - { - "name": "r2c1g2", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - } - } - } - ] - }, - "root": { - "name": "r2" - } - }, - { - "name": "r2c1g2", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - }, - "children": [ - { - "name": "r2c1g1", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - } - } - }, - { - "name": "r2c1g2", - "parent": { - "name": "r2c1", - "parent": { - "name": "r2" - } - } - } - ] - }, - "root": { - "name": "r2" - } - } - ], - "parent": { - "name": "r2" - }, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2", - "children": [ - { - "name": "r2c2g1", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - }, - "children": [ - { - "name": "r2c2g1", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - } - } - }, - { - "name": "r2c2g2", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - } - } - } - ] - }, - "root": { - "name": "r2" - } - }, - { - "name": "r2c2g2", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - }, - "children": [ - { - "name": "r2c2g1", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - } - } - }, - { - "name": "r2c2g2", - "parent": { - "name": "r2c2", - "parent": { - "name": "r2" - } - } - } - ] - }, - "root": { - "name": "r2" - } - } - ], - "parent": { - "name": "r2" - }, - "root": { - "name": "r2" - } - } - ] - } - ] - } -} diff --git a/spec/regression/root-fields/tests/root-and-parent/aql/test.aql b/spec/regression/root-fields/tests/root-and-parent/aql/test.aql new file mode 100644 index 000000000..e327dadc2 --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent/aql/test.aql @@ -0,0 +1,52 @@ +RETURN { + "allRoots": ( + FOR v_root1 + IN @@roots + SORT (v_root1.`name`) + RETURN { + "name": v_root1.`name`, + "children": ( + FOR v_child1 + IN (IS_LIST(v_root1.`children`) ? v_root1.`children` : []) + RETURN { + "name": v_child1.`name`, + "children": ( + FOR v_grandchild1 + IN (IS_LIST(v_child1.`children`) ? v_child1.`children` : []) + RETURN { + "name": v_grandchild1.`name`, + "parent": { + "name": v_child1.`name`, + "parent": { + "name": v_root1.`name` + }, + "children": ( + FOR v_grandchild2 + IN (IS_LIST(v_child1.`children`) ? v_child1.`children` : []) + RETURN { + "name": v_grandchild2.`name`, + "parent": { + "name": v_child1.`name`, + "parent": { + "name": v_root1.`name` + } + } + } + ) + }, + "root": { + "name": v_root1.`name` + } + } + ), + "parent": { + "name": v_root1.`name` + }, + "root": { + "name": v_root1.`name` + } + } + ) + } + ) +} diff --git a/spec/regression/root-fields/tests/root-and-parent/result.json b/spec/regression/root-fields/tests/root-and-parent/result.json new file mode 100644 index 000000000..5fc8bc5ff --- /dev/null +++ b/spec/regression/root-fields/tests/root-and-parent/result.json @@ -0,0 +1,202 @@ +{ + "test": { + "data": { + "allRoots": [ + { + "name": "r1", + "children": [ + { + "name": "r1c1", + "children": [ + { + "name": "r1c1g1", + "parent": { + "name": "r1c1", + "parent": { + "name": "r1" + }, + "children": [ + { + "name": "r1c1g1", + "parent": { + "name": "r1c1", + "parent": { + "name": "r1" + } + } + } + ] + }, + "root": { + "name": "r1" + } + } + ], + "parent": { + "name": "r1" + }, + "root": { + "name": "r1" + } + } + ] + }, + { + "name": "r2", + "children": [ + { + "name": "r2c1", + "children": [ + { + "name": "r2c1g1", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + }, + "children": [ + { + "name": "r2c1g1", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + } + } + }, + { + "name": "r2c1g2", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + } + } + } + ] + }, + "root": { + "name": "r2" + } + }, + { + "name": "r2c1g2", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + }, + "children": [ + { + "name": "r2c1g1", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + } + } + }, + { + "name": "r2c1g2", + "parent": { + "name": "r2c1", + "parent": { + "name": "r2" + } + } + } + ] + }, + "root": { + "name": "r2" + } + } + ], + "parent": { + "name": "r2" + }, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2", + "children": [ + { + "name": "r2c2g1", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + }, + "children": [ + { + "name": "r2c2g1", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + } + } + }, + { + "name": "r2c2g2", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + } + } + } + ] + }, + "root": { + "name": "r2" + } + }, + { + "name": "r2c2g2", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + }, + "children": [ + { + "name": "r2c2g1", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + } + } + }, + { + "name": "r2c2g2", + "parent": { + "name": "r2c2", + "parent": { + "name": "r2" + } + } + } + ] + }, + "root": { + "name": "r2" + } + } + ], + "parent": { + "name": "r2" + }, + "root": { + "name": "r2" + } + } + ] + } + ] + } + } +} diff --git a/spec/regression/root-fields/tests/root-and-parent.graphql b/spec/regression/root-fields/tests/root-and-parent/test.graphql similarity index 98% rename from spec/regression/root-fields/tests/root-and-parent.graphql rename to spec/regression/root-fields/tests/root-and-parent/test.graphql index a5a9a9d26..c759f0790 100644 --- a/spec/regression/root-fields/tests/root-and-parent.graphql +++ b/spec/regression/root-fields/tests/root-and-parent/test.graphql @@ -1,4 +1,4 @@ -query { +query test { allRoots(orderBy: name_ASC) { name children { diff --git a/spec/regression/root-fields/tests/root-with-collect/aql/createEdge.aql b/spec/regression/root-fields/tests/root-with-collect/aql/createEdge.aql new file mode 100644 index 000000000..5877e7735 --- /dev/null +++ b/spec/regression/root-fields/tests/root-with-collect/aql/createEdge.aql @@ -0,0 +1,52 @@ +RETURN ( + FOR v_currentEntity1 + IN ( + FOR v_root21 + IN @@root2s + FILTER (v_root21._key == @var1) + LIMIT @var2 + RETURN v_root21 + ) + UPDATE v_currentEntity1 + WITH {} + IN @@root2s + OPTIONS { mergeObjects: false } + RETURN NEW._key +) + +// -------------------------------- + +WITH @@roots +RETURN DOCUMENT(@@roots, @var1) + +// -------------------------------- + +WITH @@roots +RETURN DOCUMENT(@@roots, @var1) + +// -------------------------------- + +WITH @@roots +RETURN ( + FOR v_edge1 + IN [ {_from: CONCAT(@var1, FIRST(@v_updatedIds1)), _to: @var2}, {_from: CONCAT(@var3, FIRST(@v_updatedIds1)), _to: @var4} ] + UPSERT { _from: v_edge1._from, _to: v_edge1._to } + INSERT v_edge1 + UPDATE {} + IN @@root2s_roots +) + +// -------------------------------- + +WITH @@roots, @@root2s +LET v_root21 = DOCUMENT(@@root2s, @var1) +RETURN (IS_NULL(v_root21) ? null : { + "name": v_root21.`name` +}) + +// -------------------------------- + +WITH @@roots, @@root2s +RETURN { + "updateRoot2": @v_updateRoot21 +} diff --git a/spec/regression/root-fields/tests/root-with-collect/aql/filter.aql b/spec/regression/root-fields/tests/root-with-collect/aql/filter.aql new file mode 100644 index 000000000..7da181d74 --- /dev/null +++ b/spec/regression/root-fields/tests/root-with-collect/aql/filter.aql @@ -0,0 +1,105 @@ +WITH @@roots +RETURN { + "allRoot2s": ( + FOR v_root21 + IN @@root2s + RETURN { + "name": v_root21.`name`, + "roots": ( + FOR v_root1 + IN OUTBOUND v_root21 @@root2s_roots + FILTER v_root1._key != null + SORT (v_root1.`name`) + RETURN { + "grandchildren": v_root1.`children`[*].`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var1)) == @var2) RETURN { + "name": CURRENT.`name`, + "root": { + "name": v_root1.`name` + } + }], + @var3: { + "count": FIRST( + FOR v_item1 + IN v_root1.`children`[*].`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var4)) == @var5)] + COLLECT WITH COUNT INTO v_count1 + RETURN v_count1 + ) + }, + "extensionGrandchildren": v_root1.`children`[*].`extension`.`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var6)) == @var7) RETURN { + "root": { + "name": v_root1.`name` + } + }], + @var8: { + "count": FIRST( + FOR v_item2 + IN v_root1.`children`[*].`extension`.`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var9)) == @var10)] + COLLECT WITH COUNT INTO v_count2 + RETURN v_count2 + ) + } + } + ), + "rootGrandchildren": ( + FOR v_root2, v_edge1, v_path1 IN @var11..@var12 OUTBOUND v_root21 @@root2s_roots + FILTER v_root2._key != null + FOR v_item3 IN v_root2.`children`[*].`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var13)) == @var14) RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root2.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item3.sortValues[0] + RETURN v_item3.value + ), + @var15: { + "count": FIRST( + FOR v_item4 + IN ( + FOR v_root3, v_edge2, v_path2 IN @var16..@var17 OUTBOUND v_root21 @@root2s_roots + FILTER v_root3._key != null + FOR v_item5 IN v_root3.`children`[*].`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var18)) == @var19)] + RETURN v_item5 + ) + COLLECT WITH COUNT INTO v_count3 + RETURN v_count3 + ) + }, + "rootExtensionGrandchildren": ( + FOR v_root4, v_edge3, v_path3 IN @var20..@var21 OUTBOUND v_root21 @@root2s_roots + FILTER v_root4._key != null + FOR v_item6 IN v_root4.`children`[*].`extension`.`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var22)) == @var23) RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root4.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item6.sortValues[0] + RETURN v_item6.value + ), + @var24: { + "count": FIRST( + FOR v_item7 + IN ( + FOR v_root5, v_edge4, v_path4 IN @var25..@var26 OUTBOUND v_root21 @@root2s_roots + FILTER v_root5._key != null + FOR v_item8 IN v_root5.`children`[*].`extension`.`children`[*][** FILTER (RIGHT(CURRENT.`name`, LENGTH(@var27)) == @var28)] + RETURN v_item8 + ) + COLLECT WITH COUNT INTO v_count4 + RETURN v_count4 + ) + } + } + ) +} diff --git a/spec/regression/root-fields/tests/root-with-collect/aql/order.aql b/spec/regression/root-fields/tests/root-with-collect/aql/order.aql new file mode 100644 index 000000000..9cc103842 --- /dev/null +++ b/spec/regression/root-fields/tests/root-with-collect/aql/order.aql @@ -0,0 +1,130 @@ +WITH @@roots +RETURN { + "allRoot2s": ( + FOR v_root21 + IN @@root2s + RETURN { + "name": v_root21.`name`, + "roots": ( + FOR v_root1 + IN OUTBOUND v_root21 @@root2s_roots + FILTER v_root1._key != null + SORT (v_root1.`name`) + RETURN { + "grandchildren": ( + FOR v_item1 + IN v_root1.`children`[*].`children`[*][**] + SORT (v_item1.`name`) + RETURN { + "name": v_item1.`name`, + "root": { + "name": v_root1.`name` + } + } + ), + "grandchildrenReverse": ( + FOR v_item2 + IN v_root1.`children`[*].`children`[*][**] + SORT (v_item2.`name`) DESC + RETURN { + "name": v_item2.`name`, + "root": { + "name": v_root1.`name` + } + } + ), + "extensionGrandchildren": ( + FOR v_item3 + IN v_root1.`children`[*].`extension`.`children`[*][**] + SORT (v_item3.`name`) + RETURN { + "name": v_item3.`name`, + "root": { + "name": v_root1.`name` + } + } + ), + "extensionGrandchildrenReverse": ( + FOR v_item4 + IN v_root1.`children`[*].`extension`.`children`[*][**] + SORT (v_item4.`name`) DESC + RETURN { + "name": v_item4.`name`, + "root": { + "name": v_root1.`name` + } + } + ) + } + ), + "rootGrandchildren": ( + FOR v_root2, v_edge1, v_path1 IN @var1..@var2 OUTBOUND v_root21 @@root2s_roots + FILTER v_root2._key != null + FOR v_item5 IN v_root2.`children`[*].`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root2.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item5.sortValues[0] + RETURN v_item5.value + ), + "rootGrandchildrenReverse": ( + FOR v_root3, v_edge2, v_path2 IN @var3..@var4 OUTBOUND v_root21 @@root2s_roots + FILTER v_root3._key != null + FOR v_item6 IN v_root3.`children`[*].`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root3.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item6.sortValues[0] DESC + RETURN v_item6.value + ), + "rootExtensionGrandchildren": ( + FOR v_root4, v_edge3, v_path3 IN @var5..@var6 OUTBOUND v_root21 @@root2s_roots + FILTER v_root4._key != null + FOR v_item7 IN v_root4.`children`[*].`extension`.`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root4.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item7.sortValues[0] + RETURN v_item7.value + ), + "rootExtensionGrandchildrenReverse": ( + FOR v_root5, v_edge4, v_path4 IN @var7..@var8 OUTBOUND v_root21 @@root2s_roots + FILTER v_root5._key != null + FOR v_item8 IN v_root5.`children`[*].`extension`.`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root5.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item8.sortValues[0] DESC + RETURN v_item8.value + ) + } + ) +} diff --git a/spec/regression/root-fields/tests/root-with-collect/aql/q.aql b/spec/regression/root-fields/tests/root-with-collect/aql/q.aql new file mode 100644 index 000000000..34e23c421 --- /dev/null +++ b/spec/regression/root-fields/tests/root-with-collect/aql/q.aql @@ -0,0 +1,62 @@ +WITH @@roots +RETURN { + "allRoot2s": ( + FOR v_root21 + IN @@root2s + RETURN { + "name": v_root21.`name`, + "roots": ( + FOR v_root1 + IN OUTBOUND v_root21 @@root2s_roots + FILTER v_root1._key != null + SORT (v_root1.`name`) + RETURN { + "grandchildren": v_root1.`children`[*].`children`[*][** RETURN { + "root": { + "name": v_root1.`name` + } + }], + "extensionGrandchildren": v_root1.`children`[*].`extension`.`children`[*][** RETURN { + "root": { + "name": v_root1.`name` + } + }] + } + ), + "rootGrandchildren": ( + FOR v_root2, v_edge1, v_path1 IN @var1..@var2 OUTBOUND v_root21 @@root2s_roots + FILTER v_root2._key != null + FOR v_item1 IN v_root2.`children`[*].`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root2.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + ), + "rootExtensionGrandchildren": ( + FOR v_root3, v_edge2, v_path2 IN @var3..@var4 OUTBOUND v_root21 @@root2s_roots + FILTER v_root3._key != null + FOR v_item2 IN v_root3.`children`[*].`extension`.`children`[*][** RETURN { + value: { + "name": CURRENT.`name`, + "root": { + "name": v_root3.`name` + } + }, + sortValues: [ + CURRENT.`name` + ] + }] + SORT v_item2.sortValues[0] + RETURN v_item2.value + ) + } + ) +} diff --git a/spec/regression/root-fields/tests/root-with-collect.result.json b/spec/regression/root-fields/tests/root-with-collect/result.json similarity index 100% rename from spec/regression/root-fields/tests/root-with-collect.result.json rename to spec/regression/root-fields/tests/root-with-collect/result.json diff --git a/spec/regression/root-fields/tests/root-with-collect.graphql b/spec/regression/root-fields/tests/root-with-collect/test.graphql similarity index 100% rename from spec/regression/root-fields/tests/root-with-collect.graphql rename to spec/regression/root-fields/tests/root-with-collect/test.graphql diff --git a/spec/regression/traversal-performance/default-context.json b/spec/regression/traversal-performance/default-context.json new file mode 100644 index 000000000..ad79fe796 --- /dev/null +++ b/spec/regression/traversal-performance/default-context.json @@ -0,0 +1,3 @@ +{ + "authRoles": ["user"] +} diff --git a/spec/regression/traversal-performance/meta.json b/spec/regression/traversal-performance/meta.json new file mode 100644 index 000000000..431f5096e --- /dev/null +++ b/spec/regression/traversal-performance/meta.json @@ -0,0 +1,9 @@ +{ + "databases": { + // performance is only relevant for arangodb + // in-memory has other ordering behavior so we would need to use orderBy, which affects performance tests + "in-memory": { + "ignore": true + } + } +} diff --git a/spec/regression/traversal-performance/model/model.graphqls b/spec/regression/traversal-performance/model/model.graphqls new file mode 100644 index 000000000..b4c047eba --- /dev/null +++ b/spec/regression/traversal-performance/model/model.graphqls @@ -0,0 +1,40 @@ +type Super @rootEntity { + key: String @key + roots: [Root] @relation + rootChildren: [Child] @collect(path: "roots.children") + rootGrandchildren: [Grandchild] @collect(path: "roots.children.children") + rootExtensionGrandchildren: [ExtensionGrandchild] + @collect(path: "roots.children.extension.children") +} + +type Root @rootEntity { + key: String @key + children: [Child] + grandchildren: [Grandchild] @collect(path: "children.children") + extensionGrandchildren: [ExtensionGrandchild] @collect(path: "children.extension.children") + payload: String +} + +type Child @childEntity { + key: String + children: [Grandchild] + extension: Extension + parent: Root @parent + root: Root @root +} + +type Extension @entityExtension { + children: [ExtensionGrandchild] +} + +type Grandchild @childEntity { + key: String + parent: Child @parent + root: Root @root +} + +type ExtensionGrandchild @childEntity { + key: String + root: Root @root + parent: Child @parent +} diff --git a/spec/regression/traversal-performance/model/permission-profiles.json b/spec/regression/traversal-performance/model/permission-profiles.json new file mode 100644 index 000000000..bf92fe42d --- /dev/null +++ b/spec/regression/traversal-performance/model/permission-profiles.json @@ -0,0 +1,12 @@ +{ + "permissionProfiles": { + "default": { + "permissions": [ + { + "roles": ["user"], + "access": "readWrite" + } + ] + } + } +} diff --git a/spec/regression/traversal-performance/test-data.ts b/spec/regression/traversal-performance/test-data.ts new file mode 100644 index 000000000..5d4868ff8 --- /dev/null +++ b/spec/regression/traversal-performance/test-data.ts @@ -0,0 +1,37 @@ +import { InitTestDataContext } from '../init-test-data-context'; +import gql from 'graphql-tag'; + +export default async function init(context: InitTestDataContext) { + await context.executeGraphql( + gql` + mutation Init($input: CreateSuperInput!) { + createSuper(input: $input) { + key + } + } + `, + { + variables: { + input: { + key: 'super1', + createRoots: [...Array(10).keys()].map((rootIndex) => ({ + key: `root${rootIndex}`, + payload: generateRandomString(5_000_000), + children: [...Array(10).keys()].map((childIndex) => ({ + key: `child${rootIndex}_${childIndex}`, + })), + })), + }, + }, + authRoles: ['user'], + }, + ); +} + +function generateRandomString(length: number): string { + return Array(Math.floor(length / 2)) + .fill(0) + .map(() => Math.floor(Math.random() * 256)) + .map((b) => ('0' + b.toString(16)).slice(-2)) + .join(''); +} diff --git a/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversal.aql b/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversal.aql new file mode 100644 index 000000000..574b9e9ad --- /dev/null +++ b/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversal.aql @@ -0,0 +1,20 @@ +WITH @@roots +LET v_super1 = FIRST(( + FOR v_super2 + IN @@supers + FILTER (v_super2.`key` == @var1) + LIMIT @var2 + RETURN v_super2 +)) +RETURN { + "Super": (IS_NULL(v_super1) ? null : { + "rootChildren": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`children`[* RETURN { + "key": CURRENT.`key` + }] + RETURN v_item1 + ) + }) +} diff --git a/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversalWithParent.aql b/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversalWithParent.aql new file mode 100644 index 000000000..b577e5548 --- /dev/null +++ b/spec/regression/traversal-performance/tests/collect/aql/RelationAndFieldTraversalWithParent.aql @@ -0,0 +1,23 @@ +WITH @@roots +LET v_super1 = FIRST(( + FOR v_super2 + IN @@supers + FILTER (v_super2.`key` == @var1) + LIMIT @var2 + RETURN v_super2 +)) +RETURN { + "Super": (IS_NULL(v_super1) ? null : { + "rootChildren": ( + FOR v_root1, v_edge1, v_path1 IN @var3..@var4 OUTBOUND v_super1 @@supers_roots + FILTER v_root1._key != null + FOR v_item1 IN v_root1.`children`[* RETURN { + "key": CURRENT.`key`, + "parent": { + "key": v_root1.`key` + } + }] + RETURN v_item1 + ) + }) +} diff --git a/spec/regression/traversal-performance/tests/collect/result.json b/spec/regression/traversal-performance/tests/collect/result.json new file mode 100644 index 000000000..be2c3c8da --- /dev/null +++ b/spec/regression/traversal-performance/tests/collect/result.json @@ -0,0 +1,918 @@ +{ + "RelationAndFieldTraversal": { + "data": { + "Super": { + "rootChildren": [ + { + "key": "child9_0" + }, + { + "key": "child9_1" + }, + { + "key": "child9_2" + }, + { + "key": "child9_3" + }, + { + "key": "child9_4" + }, + { + "key": "child9_5" + }, + { + "key": "child9_6" + }, + { + "key": "child9_7" + }, + { + "key": "child9_8" + }, + { + "key": "child9_9" + }, + { + "key": "child8_0" + }, + { + "key": "child8_1" + }, + { + "key": "child8_2" + }, + { + "key": "child8_3" + }, + { + "key": "child8_4" + }, + { + "key": "child8_5" + }, + { + "key": "child8_6" + }, + { + "key": "child8_7" + }, + { + "key": "child8_8" + }, + { + "key": "child8_9" + }, + { + "key": "child7_0" + }, + { + "key": "child7_1" + }, + { + "key": "child7_2" + }, + { + "key": "child7_3" + }, + { + "key": "child7_4" + }, + { + "key": "child7_5" + }, + { + "key": "child7_6" + }, + { + "key": "child7_7" + }, + { + "key": "child7_8" + }, + { + "key": "child7_9" + }, + { + "key": "child6_0" + }, + { + "key": "child6_1" + }, + { + "key": "child6_2" + }, + { + "key": "child6_3" + }, + { + "key": "child6_4" + }, + { + "key": "child6_5" + }, + { + "key": "child6_6" + }, + { + "key": "child6_7" + }, + { + "key": "child6_8" + }, + { + "key": "child6_9" + }, + { + "key": "child5_0" + }, + { + "key": "child5_1" + }, + { + "key": "child5_2" + }, + { + "key": "child5_3" + }, + { + "key": "child5_4" + }, + { + "key": "child5_5" + }, + { + "key": "child5_6" + }, + { + "key": "child5_7" + }, + { + "key": "child5_8" + }, + { + "key": "child5_9" + }, + { + "key": "child4_0" + }, + { + "key": "child4_1" + }, + { + "key": "child4_2" + }, + { + "key": "child4_3" + }, + { + "key": "child4_4" + }, + { + "key": "child4_5" + }, + { + "key": "child4_6" + }, + { + "key": "child4_7" + }, + { + "key": "child4_8" + }, + { + "key": "child4_9" + }, + { + "key": "child3_0" + }, + { + "key": "child3_1" + }, + { + "key": "child3_2" + }, + { + "key": "child3_3" + }, + { + "key": "child3_4" + }, + { + "key": "child3_5" + }, + { + "key": "child3_6" + }, + { + "key": "child3_7" + }, + { + "key": "child3_8" + }, + { + "key": "child3_9" + }, + { + "key": "child2_0" + }, + { + "key": "child2_1" + }, + { + "key": "child2_2" + }, + { + "key": "child2_3" + }, + { + "key": "child2_4" + }, + { + "key": "child2_5" + }, + { + "key": "child2_6" + }, + { + "key": "child2_7" + }, + { + "key": "child2_8" + }, + { + "key": "child2_9" + }, + { + "key": "child1_0" + }, + { + "key": "child1_1" + }, + { + "key": "child1_2" + }, + { + "key": "child1_3" + }, + { + "key": "child1_4" + }, + { + "key": "child1_5" + }, + { + "key": "child1_6" + }, + { + "key": "child1_7" + }, + { + "key": "child1_8" + }, + { + "key": "child1_9" + }, + { + "key": "child0_0" + }, + { + "key": "child0_1" + }, + { + "key": "child0_2" + }, + { + "key": "child0_3" + }, + { + "key": "child0_4" + }, + { + "key": "child0_5" + }, + { + "key": "child0_6" + }, + { + "key": "child0_7" + }, + { + "key": "child0_8" + }, + { + "key": "child0_9" + } + ] + } + } + }, + "RelationAndFieldTraversalWithParent": { + "data": { + "Super": { + "rootChildren": [ + { + "key": "child9_0", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_1", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_2", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_3", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_4", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_5", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_6", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_7", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_8", + "parent": { + "key": "root9" + } + }, + { + "key": "child9_9", + "parent": { + "key": "root9" + } + }, + { + "key": "child8_0", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_1", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_2", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_3", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_4", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_5", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_6", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_7", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_8", + "parent": { + "key": "root8" + } + }, + { + "key": "child8_9", + "parent": { + "key": "root8" + } + }, + { + "key": "child7_0", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_1", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_2", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_3", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_4", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_5", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_6", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_7", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_8", + "parent": { + "key": "root7" + } + }, + { + "key": "child7_9", + "parent": { + "key": "root7" + } + }, + { + "key": "child6_0", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_1", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_2", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_3", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_4", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_5", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_6", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_7", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_8", + "parent": { + "key": "root6" + } + }, + { + "key": "child6_9", + "parent": { + "key": "root6" + } + }, + { + "key": "child5_0", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_1", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_2", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_3", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_4", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_5", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_6", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_7", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_8", + "parent": { + "key": "root5" + } + }, + { + "key": "child5_9", + "parent": { + "key": "root5" + } + }, + { + "key": "child4_0", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_1", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_2", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_3", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_4", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_5", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_6", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_7", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_8", + "parent": { + "key": "root4" + } + }, + { + "key": "child4_9", + "parent": { + "key": "root4" + } + }, + { + "key": "child3_0", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_1", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_2", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_3", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_4", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_5", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_6", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_7", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_8", + "parent": { + "key": "root3" + } + }, + { + "key": "child3_9", + "parent": { + "key": "root3" + } + }, + { + "key": "child2_0", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_1", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_2", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_3", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_4", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_5", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_6", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_7", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_8", + "parent": { + "key": "root2" + } + }, + { + "key": "child2_9", + "parent": { + "key": "root2" + } + }, + { + "key": "child1_0", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_1", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_2", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_3", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_4", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_5", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_6", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_7", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_8", + "parent": { + "key": "root1" + } + }, + { + "key": "child1_9", + "parent": { + "key": "root1" + } + }, + { + "key": "child0_0", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_1", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_2", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_3", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_4", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_5", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_6", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_7", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_8", + "parent": { + "key": "root0" + } + }, + { + "key": "child0_9", + "parent": { + "key": "root0" + } + } + ] + } + } + } +} diff --git a/spec/regression/traversal-performance/tests/collect/test.graphql b/spec/regression/traversal-performance/tests/collect/test.graphql new file mode 100644 index 000000000..1831bfa74 --- /dev/null +++ b/spec/regression/traversal-performance/tests/collect/test.graphql @@ -0,0 +1,18 @@ +query RelationAndFieldTraversal { + Super(key: "super1") { + rootChildren { + key + } + } +} + +query RelationAndFieldTraversalWithParent { + Super(key: "super1") { + rootChildren { + key + parent { + key + } + } + } +} diff --git a/spec/regression/traversal-performance/tests/relations/aql/Relation.aql b/spec/regression/traversal-performance/tests/relations/aql/Relation.aql new file mode 100644 index 000000000..3b24554cd --- /dev/null +++ b/spec/regression/traversal-performance/tests/relations/aql/Relation.aql @@ -0,0 +1,20 @@ +WITH @@roots +LET v_super1 = FIRST(( + FOR v_super2 + IN @@supers + FILTER (v_super2.`key` == @var1) + LIMIT @var2 + RETURN v_super2 +)) +RETURN { + "Super": (IS_NULL(v_super1) ? null : { + "roots": ( + FOR v_root1 + IN OUTBOUND v_super1 @@supers_roots + FILTER v_root1._key != null + RETURN { + "key": v_root1.`key` + } + ) + }) +} diff --git a/spec/regression/traversal-performance/tests/relations/result.json b/spec/regression/traversal-performance/tests/relations/result.json new file mode 100644 index 000000000..b2fe3e693 --- /dev/null +++ b/spec/regression/traversal-performance/tests/relations/result.json @@ -0,0 +1,40 @@ +{ + "Relation": { + "data": { + "Super": { + "roots": [ + { + "key": "root9" + }, + { + "key": "root8" + }, + { + "key": "root7" + }, + { + "key": "root6" + }, + { + "key": "root5" + }, + { + "key": "root4" + }, + { + "key": "root3" + }, + { + "key": "root2" + }, + { + "key": "root1" + }, + { + "key": "root0" + } + ] + } + } + } +} diff --git a/spec/regression/traversal-performance/tests/relations/test.graphql b/spec/regression/traversal-performance/tests/relations/test.graphql new file mode 100644 index 000000000..4c22a33e3 --- /dev/null +++ b/spec/regression/traversal-performance/tests/relations/test.graphql @@ -0,0 +1,8 @@ +# Root has a big payload field - make sure that's not read into memory +query Relation { + Super(key: "super1") { + roots { + key + } + } +} diff --git a/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToFail.aql b/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToFail.aql new file mode 100644 index 000000000..677501b10 --- /dev/null +++ b/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToFail.aql @@ -0,0 +1,13 @@ +LET v_root1 = FIRST(( + FOR v_root2 + IN @@roots + FILTER (v_root2.`key` == @var1) + LIMIT @var2 + RETURN v_root2 +)) +RETURN { + "Root": (IS_NULL(v_root1) ? null : { + "payload": v_root1.`payload`, + "key": v_root1.`key` + }) +} diff --git a/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToSucceed.aql b/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToSucceed.aql new file mode 100644 index 000000000..0ee5a141a --- /dev/null +++ b/spec/regression/traversal-performance/tests/test-memory-limit/aql/ExpectedToSucceed.aql @@ -0,0 +1,12 @@ +LET v_super1 = FIRST(( + FOR v_super2 + IN @@supers + FILTER (v_super2.`key` == @var1) + LIMIT @var2 + RETURN v_super2 +)) +RETURN { + "Super": (IS_NULL(v_super1) ? null : { + "key": v_super1.`key` + }) +} diff --git a/spec/regression/traversal-performance/tests/test-memory-limit/result.json b/spec/regression/traversal-performance/tests/test-memory-limit/result.json new file mode 100644 index 000000000..20cc8c164 --- /dev/null +++ b/spec/regression/traversal-performance/tests/test-memory-limit/result.json @@ -0,0 +1,26 @@ +{ + "ExpectedToSucceed": { + "data": { + "Super": { + "key": "super1" + } + } + }, + "ExpectedToFail": { + "errors": [ + { + "message": "AQL: query would use more memory than allowed [node #12: IndexNode] [node #6: LimitNode] [node #14: SubqueryEndNode] [node #9: CalculationNode] [node #10: CalculationNode] [node #11: ReturnNode] (while executing)", + "locations": [ + { + "line": 8, + "column": 5 + } + ], + "path": ["Root"] + } + ], + "data": { + "Root": null + } + } +} diff --git a/spec/regression/traversal-performance/tests/test-memory-limit/test.graphql b/spec/regression/traversal-performance/tests/test-memory-limit/test.graphql new file mode 100644 index 000000000..88f35568b --- /dev/null +++ b/spec/regression/traversal-performance/tests/test-memory-limit/test.graphql @@ -0,0 +1,12 @@ +query ExpectedToSucceed { + Super(key: "super1") { + key + } +} + +query ExpectedToFail { + Root(key: "root1") { + payload + key + } +} diff --git a/src/authorization/move-errors-to-output-nodes.ts b/src/authorization/move-errors-to-output-nodes.ts index 15fbba0c7..381bec4eb 100644 --- a/src/authorization/move-errors-to-output-nodes.ts +++ b/src/authorization/move-errors-to-output-nodes.ts @@ -12,6 +12,7 @@ import { TransformListQueryNode, VariableAssignmentQueryNode, WithPreExecutionQueryNode, + TraversalQueryNode, } from '../query-tree'; import { visitQueryNode } from '../query-tree/visitor'; import { VisitResult } from '../utils/visitor'; @@ -154,6 +155,7 @@ namespace outputNodes { add(ListQueryNode, 'itemNodes'); add(ConditionalQueryNode, 'expr1', 'expr2'); add(TransformListQueryNode, 'innerNode'); + add(TraversalQueryNode, 'innerNode'); addExt( WithPreExecutionQueryNode, OutputNodeKind.OUTPUT_INTERMEDIATE, diff --git a/src/authorization/transformers/traversal.ts b/src/authorization/transformers/traversal.ts index a111dd4a2..a82c70628 100644 --- a/src/authorization/transformers/traversal.ts +++ b/src/authorization/transformers/traversal.ts @@ -4,6 +4,7 @@ import { QueryNode, RuntimeErrorQueryNode, TraversalQueryNode, + TraversalQueryNodeParams, VariableQueryNode, } from '../../query-tree'; import { AccessOperation, AuthContext } from '../auth-basics'; @@ -12,6 +13,8 @@ import { getPermissionDescriptorOfField, getPermissionDescriptorOfRootEntityType, } from '../permission-descriptors-in-model'; +import { decapitalize } from '../../utils/utils'; +import { RequireAllProperties } from '../../utils/util-types'; export function transformTraversalQueryNode( node: TraversalQueryNode, @@ -61,7 +64,7 @@ export function transformTraversalQueryNode( case PermissionResult.DENIED: throw new Error(`Unexpected DENIED permission - should have been caught earlier`); case PermissionResult.CONDITIONAL: - const variableNode = new VariableQueryNode(targetType.name); + const variableNode = new VariableQueryNode(decapitalize(targetType.name)); const filter = entityPermissionDescriptor.getAccessCondition( authContext, AccessOperation.READ, @@ -82,8 +85,18 @@ export function transformTraversalQueryNode( sourceEntityNode: node.sourceEntityNode, relationSegments: filteredRelationSegments, fieldSegments: fieldSegments, - captureRootEntities: node.captureRootEntity, - }); + orderBy: node.orderBy, + filterNode: node.filterNode, + sourceIsList: node.sourceIsList, + innerNode: node.innerNode, + rootEntityVariable: node.rootEntityVariable, + itemVariable: node.itemVariable, + alwaysProduceList: node.alwaysProduceList, + preserveNullValues: node.preserveNullValues, + entitiesIdentifierKind: node.entitiesIdentifierKind, + skip: node.skip, + maxCount: node.maxCount, + } satisfies RequireAllProperties); } return node; diff --git a/src/database/arangodb/aql-generator.ts b/src/database/arangodb/aql-generator.ts index 4a361b104..20ff85d47 100644 --- a/src/database/arangodb/aql-generator.ts +++ b/src/database/arangodb/aql-generator.ts @@ -373,6 +373,10 @@ const inFlexSearchFilterSymbol = Symbol('inFlexSearchFilter'); namespace aqlExt { export function safeJSONKey(key: string): AQLFragment { if (aql.isSafeIdentifier(key)) { + // TODO meta fields are currently not considered safe because of the leading underscore + // think about if we should generally allow leading underscores in isSafeIdentifier + // or just allow them here (here it would definitely be safe) + // we could always collide with a (future) keyword, so use "name" syntax instead of identifier // ("" looks more natural than `` in json keys) return aql`${aql.string(key)}`; @@ -604,25 +608,14 @@ function generateInClauseWithFilterAndOrderAndLimit({ let filterDanglingEdges = aql``; if (node.listNode instanceof FollowEdgeQueryNode) { list = getSimpleFollowEdgeFragment(node.listNode, context); - filterDanglingEdges = aql`FILTER ${itemVar} != null`; + // using $var._key != null instead of $var != null because the latter prevents ArangoDB + // from applying the reduce-extraction-to-projection optimization + filterDanglingEdges = aql`FILTER ${itemVar}._key != null`; } else { list = processNode(node.listNode, context); } let filter = simplifyBooleans(node.filterNode); - let limitClause; - if (node.maxCount != undefined) { - if (node.skip === 0) { - limitClause = aql`LIMIT ${node.maxCount}`; - } else { - limitClause = aql`LIMIT ${node.skip}, ${node.maxCount}`; - } - } else if (node.skip > 0) { - limitClause = aql`LIMIT ${node.skip}, ${Number.MAX_SAFE_INTEGER}`; - } else { - limitClause = aql``; - } - return aql.lines( aql`IN ${list}`, filter instanceof ConstBoolQueryNode && filter.value @@ -630,10 +623,31 @@ function generateInClauseWithFilterAndOrderAndLimit({ : aql`FILTER ${processNode(filter, itemContext)}`, filterDanglingEdges, generateSortAQL(node.orderBy, itemContext), - limitClause, + generateLimitClause(node) ?? aql``, ); } +interface LimitClauseArgs { + readonly skip?: number; + readonly maxCount?: number; +} + +function generateLimitClause({ skip = 0, maxCount }: LimitClauseArgs): AQLFragment | undefined { + // Todo use something like aql.integer() which validates the number is an integer and within range + // (that way, we don't have so many bound parameters) + if (maxCount != undefined) { + if (skip === 0) { + return aql`LIMIT ${maxCount}`; + } else { + return aql`LIMIT ${skip}, ${maxCount}`; + } + } else if (skip > 0) { + return aql`LIMIT ${skip}, ${Number.MAX_SAFE_INTEGER}`; + } else { + return undefined; + } +} + /** * Generates an IN... clause for a list to be used within a query / subquery (FOR ... IN ...) */ @@ -704,6 +718,7 @@ register(AggregationQueryNode, (node, context) => { break; case AggregationOperator.COUNT: + // TODO NXT-7991-now: not covered by regression tests aggregationFunction = aql`COUNT`; break; case AggregationOperator.SOME: @@ -782,6 +797,9 @@ register(AggregationQueryNode, (node, context) => { // these should also remove NULL values by definition case AggregationOperator.DISTINCT: + // TODO NXT-7991-now move the distinct aggregation into TraversalQueryNode + // if we do it here, the DISTINCT operates on the mapped result, which might be + // identical for different nodes (if you don't selct the "id" field or similar) // use COLLECT a = a instead of RETURN DISTINCT to be able to sort distinct = true; filterFrag = aql`${itemVar} != null`; @@ -790,6 +808,7 @@ register(AggregationQueryNode, (node, context) => { break; case AggregationOperator.COUNT_DISTINCT: + // TODO NXT-7991-now: not covered by regression tests aggregationFunction = aql`COUNT_DISTINCT`; filterFrag = aql`${itemVar} != null`; break; @@ -1385,114 +1404,431 @@ register(EntitiesQueryNode, (node, context) => { register(FollowEdgeQueryNode, (node, context) => { const tmpVar = aql.variable('node'); - // need to wrap this in a subquery because ANY is not possible as first token of an expression node in AQL return aqlExt.parenthesizeList( aql`FOR ${tmpVar}`, aql`IN ${getSimpleFollowEdgeFragment(node, context)}`, - aql`FILTER ${tmpVar} != null`, + // filter out dangling edges (edges that point to non-existing entities) + // using $var._key != null instead of $var != null because the latter prevents ArangodB + // from applying the reduce-extraction-to-projection optimization + aql`FILTER ${tmpVar}._key != null`, aql`RETURN ${tmpVar}`, ); }); register(TraversalQueryNode, (node, context) => { - const sourceFrag = processNode(node.sourceEntityNode, context); - const fieldDepth = node.fieldSegments.filter((s) => s.isListSegment).length; - - if (node.relationSegments.length) { - let mapFrag: ((itemFrag: AQLFragment) => AQLFragment) | undefined; - - let remainingDepth = fieldDepth; - if (node.fieldSegments.length) { - // if we have both, it might be beneficial to do the field traversal within the mapping node - // because it may allow ArangoDB to figure out that only one particular field is of interest, and e.g. - // discard the root entities earlier - - if (node.captureRootEntity) { - if (fieldDepth === 0) { - // fieldSegments.length && fieldDepth === 0 means we only traverse through entity extensions - // actually, shouldn't really occur because a collect path can't end with an entity extension and - // value objects don't capture root entities - // however, we can easily implement this so let's do it - mapFrag = (nodeFrag) => - aql`{ obj: ${getFieldTraversalFragmentWithoutFlattening( - node.fieldSegments, - nodeFrag, - )}, root: ${nodeFrag}) }`; - } else { - // the result of getFieldTraversalFragmentWithoutFlattening() now is a list, so we need to iterate - // over it. if the depth is > 1, we need to flatten the deeper ones so we can do one FOR loop over them - // we still return a list, so we just reduce the depth to 1 and not to 0 - const entityVar = aql.variable('entity'); - mapFrag = (rootEntityFrag) => - aqlExt.parenthesizeList( - aql`FOR ${entityVar} IN ${getFlattenFrag( - getFieldTraversalFragmentWithoutFlattening( - node.fieldSegments, - rootEntityFrag, - ), - fieldDepth - 1, - )}`, - aql`RETURN { obj: ${entityVar}, root: ${rootEntityFrag} }`, - ); - remainingDepth = 1; - } - } else { - mapFrag = (nodeFrag) => - getFieldTraversalFragmentWithoutFlattening(node.fieldSegments, nodeFrag); - } - } else { - if (node.captureRootEntity) { - // doesn't make sense to capture the root entity if we're returning the root entities - throw new Error(`captureRootEntity without fieldSegments detected`); - } - } - - // traversal requires real ids - let fixedSourceFrag = sourceFrag; - if (node.entitiesIdentifierKind === EntitiesIdentifierKind.ID) { - if (node.sourceIsList) { - fixedSourceFrag = getFullIDFromKeysFragment( - sourceFrag, - node.relationSegments[0].relationSide.sourceType, + // We have a lot of different methods here for different cases + // The AQL looks very different depending on the case, and separate methods are easiser to + // understand than lots of conditionals in one big method + + if (node.relationSegments.length && node.fieldSegments.length) { + if (!node.fieldSegments.some((f) => f.isListSegment)) { + if (node.resultIsList) { + return processTraversalWithListRelationSegmentsAndNonListFieldSegments( + node, + context, ); } else { - fixedSourceFrag = getFullIDFromKeyFragment( - sourceFrag, - node.relationSegments[0].relationSide.sourceType, + // TODO we currently don't allow non-list collect paths. Allow or remove code? + return processTraversalWithNonListRelationSegmentsAndNonListFieldSegments( + node, + context, ); } + } else if (node.orderBy.isUnordered()) { + return processTraversalWithRelationAndListFieldSegmentsWithoutSort(node, context); + } else { + return processTraversalWithRelationAndListFieldSegmentsWithSort(node, context); } - - const frag = getRelationTraversalFragment({ - segments: node.relationSegments, - sourceFrag: fixedSourceFrag, - sourceIsList: node.sourceIsList, - alwaysProduceList: node.alwaysProduceList, - mapFrag, - context, - }); - if (node.relationSegments.some((s) => s.isListSegment) || node.sourceIsList) { - // if the relation contains a list segment, getRelationTraversalFragment will return a list - // if we already returned lists within the mapFrag (-> current value of remainingDepth), we need to add that - remainingDepth++; + } else if (node.relationSegments.length) { + if (node.resultIsList) { + return processTraversalWithOnlyRelationSegmentsAsList(node, context); + } else { + // TODO we currently don't allow non-list collect paths. Allow or remove code? + return processTraversalWithOnlyRelationSegmentsNoList(node, context); } - // flatten 1 less than the depth, see below - return getFlattenFrag(frag, remainingDepth - 1); + } else if (node.fieldSegments.length) { + return processTraversalWithOnlyFieldSegments(node, context); + } else { + // don't need this case, so better guard against it + throw new Error(`TraversalQueryNode must have at least one segment`); } +}); - if (node.captureRootEntity) { - // doesn't make sense (and isn't possible) to capture the root entity if we're not even crossing root entities - throw new Error(`captureRootEntity without relationSegments detected`); +// TODO we currently don't allow non-list collect paths. Allow or remove code? +function processTraversalWithOnlyRelationSegmentsNoList( + node: TraversalQueryNode, + context: QueryContext, +) { + if (node.fieldSegments.length > 0) { + throw new Error(`Did not expect any field segments`); } + if ( + node.filterNode || + !node.orderBy.isUnordered() || + node.skip !== undefined || + node.maxCount !== undefined + ) { + throw new Error( + `Cannot have filter, orderBy, skip or maxCount on non-list relation traversal`, + ); + } + + const itemVar = aql.variable(`node`); + const innerContext = context.introduceVariableAlias(node.itemVariable, itemVar); + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: itemVar, + preserveNullValues: node.preserveNullValues, + context, + }); + + return aqlExt.parenthesizeObject( + forStatementsFrag, + aql`RETURN ${node.innerNode ? processNode(node.innerNode, innerContext) : itemVar}`, + ); +} + +function processTraversalWithOnlyRelationSegmentsAsList( + node: TraversalQueryNode, + context: QueryContext, +) { + if (node.fieldSegments.length > 0) { + throw new Error(`Did not expect any field segments`); + } + + // note: this is the only variant where sourceIsList and alwaysProduceList is supported + // (used in getPreEntityRemovalStatementsForRelationSide()) + // - sourceIsList is handled in getRelationTraversalForStatements() + // - alwaysProduceList is automatically handled because we always RETURN a list here + // we could refactor the single usage so it does not use a TraversalQueryNode in the first place + + const itemVar = aql.variable(`node`); + const innerContext = context.introduceVariableAlias(node.itemVariable, itemVar); + + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: itemVar, + context, + preserveNullValues: node.preserveNullValues, + }); + + return aqlExt.parenthesizeList( + forStatementsFrag, + node.filterNode ? aql`FILTER ${processNode(node.filterNode, context)}` : aql``, + + // yes, we can SORT and LIMIT like this even if there are multiple FOR statements + // because there is one result set for the cross product of all FOR statements + // see https://docs.arangodb.com/3.12/aql/high-level-operations/for/#usage + generateSortAQL(node.orderBy, innerContext), + generateLimitClause(node) ?? aql``, + aql`RETURN ${node.innerNode ? processNode(node.innerNode, innerContext) : itemVar}`, + ); +} + +function processTraversalWithListRelationSegmentsAndNonListFieldSegments( + node: TraversalQueryNode, + context: QueryContext, +) { + if (!node.relationSegments.some((f) => f.isListSegment)) { + throw new Error(`Expected at least one relation list segment`); + } + if (node.fieldSegments.some((f) => f.isListSegment)) { + throw new Error(`Did not expect any field list segments`); + } + + // this is very similar to processTraversalWithOnlyRelationSegmentsAsList(), + // but instead of using the rootVar in filter, sort and mapping, we use the field traversal result + + const rootVar = aql.variable(`root`); + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: rootVar, + context, + preserveNullValues: node.preserveNullValues, + }); + const fieldTraversalFrag = getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag: rootVar, + }); + const innerContext = context.introduceVariableAlias(node.itemVariable, fieldTraversalFrag); + + // note: we don't filter out NULL values even if preserveNullValues is false because that's currently + // only a flag for performance - actually filtering out NULLs is done by a surrounding AggregationQueryNode + // TODO NXT-7991-later remove this note once the NULL filtering / preserving has moved out of AggregationQueryNode + return aqlExt.parenthesizeList( + forStatementsFrag, + node.filterNode ? aql`FILTER ${processNode(node.filterNode, context)}` : aql``, + generateSortAQL(node.orderBy, innerContext), + generateLimitClause(node) ?? aql``, + aql`RETURN ${node.innerNode ? processNode(node.innerNode, innerContext) : fieldTraversalFrag}`, + ); +} + +// TODO we currently don't allow non-list collect paths. Allow or remove code? +function processTraversalWithNonListRelationSegmentsAndNonListFieldSegments( + node: TraversalQueryNode, + context: QueryContext, +) { + if (node.fieldSegments.some((f) => f.isListSegment)) { + throw new Error(`Did not expect any field list segments`); + } + if (node.relationSegments.some((f) => f.isListSegment)) { + throw new Error(`Did not expect any relation list segments`); + } + if ( + node.filterNode || + !node.orderBy.isUnordered() || + node.skip !== undefined || + node.maxCount !== undefined + ) { + throw new Error(`Cannot have filter, orderBy, skip or maxCount on non-list traversal`); + } + + // this is very similar to processTraversalWithOnlyRelationSegmentsNoList(), + // but instead of using the rootVar in mapping, we use the field traversal result + + const rootVar = aql.variable(`root`); + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: rootVar, + preserveNullValues: node.preserveNullValues, + context, + }); + + const fieldTraversalFrag = getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag: rootVar, + }); + const innerContext = context.introduceVariableAlias(node.itemVariable, fieldTraversalFrag); + + return aqlExt.parenthesizeObject( + forStatementsFrag, + aql`RETURN ${node.innerNode ? processNode(node.innerNode, innerContext) : fieldTraversalFrag}`, + ); +} + +function processTraversalWithRelationAndListFieldSegmentsWithoutSort( + node: TraversalQueryNode, + context: QueryContext, +) { + if (!node.relationSegments.length || !node.fieldSegments) { + throw new Error(`Expected both relation and field segments`); + } + if (!node.fieldSegments.some((s) => s.isListSegment)) { + throw new Error(`Expected at least one list field segment`); + } + if (!node.orderBy.isUnordered()) { + throw new Error(`Did not expect orderBy clauses`); + } + + // this will hold the node of the innermost relation traversal + const rootVar = aql.variable('root'); + + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: rootVar, + preserveNullValues: node.preserveNullValues, + context, + }); - if (node.sourceIsList) { - // don't need, don't bother - throw new Error(`sourceIsList without relationSegments detected`); + const innerNode = node.innerNode; + const innerMapFrag = innerNode + ? (itemFrag: AQLFragment) => { + const innerContext = context + .introduceVariableAlias(node.itemVariable, itemFrag) + .introduceVariableAlias(node.rootEntityVariable, rootVar); + return processNode(innerNode, innerContext); + } + : undefined; + + // We can do the LIMIT within the field traversal's mapping function using an array expansion, + // but only if the relation traversal yields at most one result (i.e. if it only follows 1:1 relations) + const lastRelationSegment = node.relationSegments[node.relationSegments.length - 1]; + let limitArgs: LimitClauseArgs | undefined; + let innerLimitArgs: LimitClauseArgs; + if (lastRelationSegment.resultIsList) { + limitArgs = { + skip: node.skip, + maxCount: node.maxCount, + }; + innerLimitArgs = {}; + } else { + limitArgs = {}; + innerLimitArgs = { + skip: node.skip, + maxCount: node.maxCount, + }; + } + + let innerFilterFrag: ((item: AQLFragment) => AQLFragment) | undefined; + const filterNode = node.filterNode; + if (filterNode) { + innerFilterFrag = (itemFrag: AQLFragment) => { + // don't map rootEntityVariable + // (if we want to filter on root, it should happen outside already) + const innerContext = context.introduceVariableAlias(node.itemVariable, itemFrag); + return processNode(filterNode, innerContext); + }; + } + + const outerMapFrag = getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag: rootVar, + mapFrag: innerMapFrag, + filterFrag: innerFilterFrag, + ...innerLimitArgs, + }); + + // the mapFrag will produce a list, so a simple RETURN mapFrag would result in nested lists + // -> we iterate over the items again to flatten the lists + // Note: If the relation traversal only consists of 1:1, we could theoretically use something like this: + // LET root = FIRST(FOR obj IN OUTBOUND source edge_collection RETURN obj) + // RETURN root.children + // however, that would prevent the reduce-extraction-to-projection optimization + // (because we would access the whole root object) + // -> it's better to produce the same structure as we do for 1:n relation traversals: + // FOR root IN OUTBOUND source edge_collection + // FOR item IN root.children + // RETURN item + // (could also use FLATTEN(), but since we're already using nested FORs, this is probably cleaner) + const itemVar = aql.variable(`item`); + return aqlExt.parenthesizeList( + aql`${forStatementsFrag}`, + aql`FOR ${itemVar} IN ${outerMapFrag}`, + generateLimitClause(limitArgs) ?? aql``, + aql`RETURN ${itemVar}`, + ); +} + +function processTraversalWithRelationAndListFieldSegmentsWithSort( + node: TraversalQueryNode, + context: QueryContext, +) { + if (!node.relationSegments.length || !node.fieldSegments) { + throw new Error(`Expected both relation and field segments`); + } + if (!node.fieldSegments.some((s) => s.isListSegment)) { + throw new Error(`Expected at least one list field segment`); + } + if (!node.resultIsList) { + throw new Error(`Cannot have sort on non-list traversal`); } - if (node.alwaysProduceList) { - // don't need, don't bother - throw new Error(`alwaysProduceList without relationSegments detected`); + // this will hold the node of the innermost relation traversal + const rootVar = aql.variable('root'); + + const forStatementsFrag = getRelationTraversalForStatements({ + node, + innermostItemVar: rootVar, + preserveNullValues: node.preserveNullValues, + context, + }); + + /* + A simple way to implement this would be to first SORT, and then map: + + FOR v_root1 IN 1..1 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[**] + SORT v_item1.`itemNumber` + RETURN { + "itemNumber": v_item1.`itemNumber` + } + + Instead, we map first, then SORT: + + FOR v_root1 IN 1..1 INBOUND v_order1 @@deliveries_order + FOR v_item1 IN v_root1.`deliveryContents`[*].`items`[** RETURN { + value: { + "itemNumber": CURRENT.`itemNumber` + }, + sortValues: [ + CURRENT.`itemNumber` + ] + }] + SORT v_item1.sortValues[0] + RETURN v_item1.value + + This seems to reduce the memory consumption by up to factor 2 + if there are many / large fields in the items that are not needed at all + (because sorting probably copies the whole item into some temporary structure) + */ + + // we sort after mapping roots to items, so we need to preserve the sort values that are based on the item + // -> we produce items like this: { value: ..., sortValues: [...] } + const innerMapFrag = (itemFrag: AQLFragment) => { + const innerContext = context + .introduceVariableAlias(node.itemVariable, itemFrag) + .introduceVariableAlias(node.rootEntityVariable, rootVar); + const valueFrag = node.innerNode ? processNode(node.innerNode, innerContext) : itemFrag; + + return aql.lines( + aql`{`, + aql.indent( + aql.lines( + aql`value: ${valueFrag},`, + aql`sortValues: [`, + aql.indent( + aql.join( + node.orderBy.clauses.map((c) => processNode(c.valueNode, innerContext)), + aql`,\n`, + ), + ), + aql`]`, + ), + ), + aql`}`, + ); + }; + + const filterNode = node.filterNode; + const innerFilterFrag = filterNode + ? (itemFrag: AQLFragment) => { + // don't provide rootEntityVariable + // (if we want to filter on root, it should happen outside already) + const innerContext = context.introduceVariableAlias(node.itemVariable, itemFrag); + return processNode(filterNode, innerContext); + } + : undefined; + + const outerMapFrag = getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag: rootVar, + mapFrag: innerMapFrag, + filterFrag: innerFilterFrag, + }); + + // holds the { value, sortValues } + const itemVar = aql.variable(`item`); + + // if there is a list field segment, the mapFrag will produce a list, + // so a simple RETURN mapFrag would result in nested lists + // -> we iterate over the items again to flatten the lists + const forOrLetItemStatement = node.fieldSegments.some((f) => f.isListSegment) + ? aql`FOR ${itemVar} IN ${outerMapFrag}` + : aql`LET ${itemVar} = ${outerMapFrag}`; + + const clauseFrags = node.orderBy.clauses.map( + (clause, index) => + aql`${itemVar}.sortValues[${aql.integer(index)}]${dirAQL(clause.direction)}`, + ); + + return aqlExt.parenthesizeList( + aql`${forStatementsFrag}`, + aql`${forOrLetItemStatement}`, + aql`SORT ${aql.join(clauseFrags, aql`, `)}`, + generateLimitClause(node) ?? aql``, + aql`RETURN ${itemVar}.value`, + ); +} + +function processTraversalWithOnlyFieldSegments( + node: TraversalQueryNode, + context: QueryContext, +): AQLFragment { + const sourceFrag = processNode(node.sourceEntityNode, context); + + if (node.relationSegments.length) { + throw new Error(`Expected no relation segments`); } if (node.entitiesIdentifierKind !== EntitiesIdentifierKind.ENTITY) { @@ -1504,44 +1840,134 @@ register(TraversalQueryNode, (node, context) => { return sourceFrag; } - // flatten 1 less than the fieldDepth: - // - no list segments -> evaluate to the object - // - one list segment -> evaluate to the list, so no flattening - // - two list segments -> needs flattening once to get one list - return getFlattenFrag( - getFieldTraversalFragmentWithoutFlattening(node.fieldSegments, sourceFrag), - fieldDepth - 1, - ); -}); + // If we don't have a SORT clause, we can put everything into array expansions. + // This is more efficient than using subqueries. + if (node.orderBy.isUnordered()) { + const innerNode = node.innerNode; + const mapFrag = innerNode + ? (itemFrag: AQLFragment) => + processNode( + innerNode, + context.introduceVariableAlias(node.itemVariable, itemFrag), + ) + : undefined; + + const filterNode = node.filterNode; + const filterFrag = filterNode + ? (itemFrag: AQLFragment) => + processNode( + filterNode, + context.introduceVariableAlias(node.itemVariable, itemFrag), + ) + : undefined; + + // if there are no list segments, this will just be a simple path access + // -> will naturally be either a list or not, depending on what's needed + return getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag, + mapFrag, + filterFrag, + skip: node.skip, + maxCount: node.maxCount, + }); + } else { + if (!node.resultIsList) { + // this branch would always create a list due to the subquery + throw new Error(`Cannot have orderBy on non-list field traversal`); + } -function getRelationTraversalFragment({ - segments, - sourceFrag, - sourceIsList, - alwaysProduceList, - mapFrag, + // need to use a subquery because array inline expressions don't support SORT + // this also means we can't do the innerNode mapping in inline expressions using [* RETURN ...] + // because otherwise we could not access the sort fields outside + // theoretically we could map the sort fields like we do in the relation + field traversal case, + // but we wouldn't gain anything from this here + // -> a simple subquery + + const fieldTraversalFrag = getFieldTraversalFragment({ + segments: node.fieldSegments, + sourceFrag, + }); + + const itemVar = aql.variable('item'); + + const innerContext = context.introduceVariableAlias(node.itemVariable, itemVar); + const returnValueFrag = node.innerNode + ? processNode(node.innerNode, innerContext) + : itemVar; + + // we could also do the filter in getFieldTraversalFragment(), but if we have a subquery anyway, this is simpler + const filterFrag = node.filterNode + ? aql`FILTER ${processNode(node.filterNode, innerContext)}` + : aql``; + + return aqlExt.parenthesizeList( + aql`FOR ${itemVar}`, + aql`IN ${fieldTraversalFrag}`, + filterFrag, + generateSortAQL(node.orderBy, innerContext), + generateLimitClause(node) ?? aql``, + aql`RETURN ${returnValueFrag}`, + ); + } +} + +function getRelationTraversalForStatements({ + node, + innermostItemVar, context, + preserveNullValues = false, }: { - readonly segments: ReadonlyArray; - readonly sourceFrag: AQLFragment; - readonly sourceIsList: boolean; - readonly alwaysProduceList: boolean; - readonly mapFrag?: (itemFrag: AQLFragment) => AQLFragment; + readonly node: TraversalQueryNode; + // TODO NXT-7991-now: this is a bit awkward, maybe switch back to just returning the effective var + readonly innermostItemVar: AQLVariable; readonly context: QueryContext; -}) { - if (!segments.length) { - return sourceFrag; + readonly preserveNullValues?: boolean; +}): AQLFragment { + if (!node.relationSegments.length) { + throw new Error(`Expected at least one relation segment`); + } + const segments = node.relationSegments; + const sourceIsList = node.sourceIsList; + + const plainSourceFrag = processNode(node.sourceEntityNode, context); + // traversal requires real ids + let sourceFrag: AQLFragment; + if (node.entitiesIdentifierKind === EntitiesIdentifierKind.ID) { + if (node.sourceIsList) { + sourceFrag = getFullIDFromKeysFragment( + plainSourceFrag, + node.relationSegments[0].relationSide.sourceType, + ); + } else { + sourceFrag = getFullIDFromKeyFragment( + plainSourceFrag, + node.relationSegments[0].relationSide.sourceType, + ); + } + } else { + sourceFrag = plainSourceFrag; } + const sourceEntityVar = aql.variable(`sourceEntity`); + let currentObjectFrag = sourceIsList ? sourceEntityVar : sourceFrag; + const forFragments: AQLFragment[] = sourceIsList + ? [aql`FOR ${sourceEntityVar} IN ${sourceFrag}`] + : []; + // ArangoDB 3.4.5 introduced PRUNE which also supports IS_SAME_COLLECTION so we may be able to use just one // traversal which lists all affected edge collections and prunes on the path in the future. - const forFragments: AQLFragment[] = []; - const sourceEntityVar = aql.variable(`sourceEntity`); - let currentObjectFrag = sourceIsList ? sourceEntityVar : sourceFrag; let segmentIndex = 0; + const lastListSegmentIndex = segments.findLastIndex((s) => s.isListSegment); for (const segment of segments) { - const nodeVar = aql.variable(`node`); + const isLastSegment = segmentIndex === segments.length - 1; + // if there is no list segment, lastListSegmentIndex is -1, so needsNullableVar is true for all segments + const needsNullableVar = preserveNullValues && segmentIndex > lastListSegmentIndex; // see below + // the caller can specify the result var because they will need it to work with it + const nodeVar = + isLastSegment && !needsNullableVar ? innermostItemVar : aql.variable(`node`); + const edgeVar = aql.variable(`edge`); const pathVar = aql.variable(`path`); const dir = segment.relationSide.isFromSide ? aql`OUTBOUND` : aql`INBOUND`; @@ -1595,20 +2021,33 @@ function getRelationTraversalFragment({ AccessType.EXPLICIT_READ, context, )}${pruneFrag}${filterFrag}`; - if (segment.isListSegment || (alwaysProduceList && segmentIndex === segments.length - 1)) { - // this is simple - we can just push one FOR statement after the other - forFragments.push(traversalFrag); - currentObjectFrag = nodeVar; - } else { - // if this is not a list, we need to preserve NULL values - // (actually, we don't in some cases, but we need to figure out when) - // to preserve null values, we need to use FIRST - // to ignore dangling edges, add a FILTER though (if there was one dangling edge and one real edge collected, we should use the real one) - const nullableVar = aql.variable(`nullableNode`); + + // if we just put one FOR after the other, we never get NULL values: + // consider Consignment has-many Delivery has-one Order + // LET consignment = ... + // FOR delivery IN OUTBOUND consignment consignment_deliveries + // FOR order IN OUTBOUND delivery delivery_order + // RETURN order + // The second FOR would simply not find any orders, so the whole subquery would be []. + // This is ok most of the time because regular lists in cruddl never have NULL values + // but for some aggregations, we need to count NULL values (-> preserveNullValues is true) + // to not break these cases, we use a LET statement. This is inefficient though as it + // retrieves the whole document and prevents reduce-extraction-to-projection optimizations + // TODO NXT-7991-later we should refactor those cases to embed the aggregation in the traversal + if (needsNullableVar) { + // to ignore dangling edges, add a FILTER though + // (if there was one dangling edge and one real edge collected, we should use the real one) + // using $var._key != null instead of $var != null because the latter prevents ArangoDB + // from applying the reduce-extraction-to-projection optimization + const nullableVar = isLastSegment ? innermostItemVar : aql.variable(`nullableNode`); forFragments.push( - aql`LET ${nullableVar} = FIRST(${traversalFrag} FILTER ${nodeVar} != null RETURN ${nodeVar})`, + aql`LET ${nullableVar} = FIRST(${traversalFrag} FILTER ${nodeVar}._key != NULL RETURN ${nodeVar})`, ); currentObjectFrag = nullableVar; + } else { + // this is simple - we can just push one FOR statement after the other + forFragments.push(traversalFrag); + currentObjectFrag = nodeVar; } context.addCollectionAccess( @@ -1619,51 +2058,125 @@ function getRelationTraversalFragment({ segmentIndex++; } - const lastSegment = segments[segments.length - 1]; - - // remove dangling edges, unless we already did because the last segment wasn't a list segment (see above, we add the FILTER there) - if (lastSegment.isListSegment) { - forFragments.push(aql`FILTER ${currentObjectFrag} != null`); + // each FOR automatically removes NULLs of the previous step (just how FOR works) + // This does not apply to the last FOR though + // - if it's not a list, this is correct: we would want the NULL values there + // (e.g. deliveries.order should have as many NULLs as there are deliveries without an order) + // dangling edges are already filtered out above in the LET (needsNullableVar) + // - if it's a list, we shouldn't have any NULLs because we don't have "relation to NULL"s + // in case of dangling edges however (i.e. edge without corresponding document) + // we could generate NULLS. We generally ignore those in cruddl. -> filter them out + // preserveNullValues is handled above (the dangling edge filter is in the LET there) + if (segments[segments.length - 1].isListSegment) { + // using $var._key != null instead of $var != null because the latter prevents ArangoDB + // from applying the reduce-extraction-to-projection optimization + forFragments.push(aql`FILTER ${currentObjectFrag}._key != null`); } - const returnFrag = mapFrag ? mapFrag(currentObjectFrag) : currentObjectFrag; - const returnList = lastSegment.resultIsList || sourceIsList || alwaysProduceList; // make sure we don't return a list with one element - return aqlExt[returnList ? 'parenthesizeList' : 'parenthesizeObject']( - sourceIsList ? aql`FOR ${sourceEntityVar} IN ${sourceFrag}` : aql``, - ...forFragments, - aql`RETURN ${returnFrag}`, - ); + return aql.lines(...forFragments); } -function getFlattenFrag(listFrag: AQLFragment, depth: number) { - if (depth <= 0) { - return listFrag; - } - if (depth === 1) { - return aql`${listFrag}[**]`; - } - return aql`FLATTEN(${listFrag}, ${aql.integer(depth)})`; +interface FieldTraversalFragment { + readonly segments: ReadonlyArray; + readonly sourceFrag: AQLFragment; + readonly mapFrag?: (itemFrag: AQLFragment) => AQLFragment; + readonly filterFrag?: (itemFrag: AQLFragment) => AQLFragment; + readonly skip?: number; + readonly maxCount?: number; } -function getFieldTraversalFragmentWithoutFlattening( - segments: ReadonlyArray, - sourceFrag: AQLFragment, -) { +function getFieldTraversalFragment({ + segments, + sourceFrag, + mapFrag, + filterFrag, + skip = 0, + maxCount, +}: FieldTraversalFragment) { if (!segments.length) { return sourceFrag; } + if ( + (mapFrag || filterFrag || maxCount !== undefined || skip > 0) && + !segments.some((s) => s.isListSegment) + ) { + // if this is needed, it needs to happen outside the field traversal + // (it can just use the result of the field traversal as loop "variable") + throw new Error( + `Cannot have map, filter or limit on field traversal without list segments`, + ); + } + + const limitFrag = generateLimitClause({ skip, maxCount }); + + // We use array inline expressions instead of FOR ... IN ... RETURN ... because this reduces the number of + // execution nodes which would need to pass the data between them. Inline expressions are more efficient. + // + // We flatten on the go + // -> source[*].field1[**].field2[**] + // (instead of (source[*].field1[*].field2[*])[***}) + // because this allows us to put a LIMIT on the last item and have it apply to the list as a whole. + // Every access "into" an array requires a [*] or [**] operator because otherwise you would just get NULL + // + // The first array access uses [*], further ones use [**] because using [*] again would result in nested arrays. + // It's basically sourceFrag.map(o => o.field1).flatMap(o => o.field2).flatMap(o => ...) + // + // If there are non-list segments in the middle, those can just be put without an operator: + // source.items[*].extension.children[**].extension.children[**] + // (equivalent to source.items.map(o => o.extension.children).flatMap(o => o.extension.children)) + // + // [*] treats NULL as an empty list, even though this is undocumented: + // https://docs.arangodb.com/stable/aql/operators/#array-expansion + // > It is required that the expanded variable is an array. + // TODO NXT-7991-now ask arangodb whether this is stable behavior + // [**] does not treat NULL as an empty list though: ([NULL])[**] == [ NULL ] + // -> we need to use [*][**] instead of just [**] + // + // We also append [**] at the end if there were two list segments because we still need to flatten then + // If there was only one list segment, we append [*] at the end because it converts NULL to an empty list let frag = sourceFrag; + let index = 0; + let hasSeenList = false; + const lastListSegmentIndex = segments.findLastIndex((s) => s.isListSegment); for (const segment of segments) { frag = aql`${frag}${getPropertyAccessFragment(segment.field.name)}`; if (segment.isListSegment) { - // the array expansion operator [*] does two useful things: - // - it performs the next field access basically as .map(o => o.fieldName). - // - it converts non-lists to lists (important so that if we flatten afterwards, we don't include NULL lists - // the latter is why we also add the [*] at the end of the expression, which might look strange in the AQL. - frag = aql`${frag}[*]`; + // use ** to flatten / flatMap if this is a nested list + // always use * to convert NULLs to empty lists + const operatorPrefixFrag = hasSeenList ? aql`[*][**` : aql`[*`; + if (index === lastListSegmentIndex) { + // If there is a non-list segment at the end, we stop the regular expression at the last list segment + // and instead put the non-list segments into the RETURN / FILTER + // (e.g. source.items[*].children[** FILTER CURRENT.extension.field > 0 RETURN CURRENT.extension) + const remainingSegments = segments.slice(index + 1); + const itemAccessFrag = remainingSegments.reduce( + (currentFrag, seg) => + aql`${currentFrag ?? aql``}${getPropertyAccessFragment(seg.field.name)}`, + undefined, + ); + const itemFrag = aql`CURRENT${itemAccessFrag ?? aql``}`; + + // if there are remaining segments to access, and we don't have a map, just append the item + // access at the end: source.items[*].field + const suffixFrag = itemAccessFrag && !mapFrag ? itemAccessFrag : aql``; + + // TODO NXT-7991-now LIMIT with remainingSegments only works if items are non-null + // (otherwise, we would count null items as well) + + const returnExprFrag = mapFrag ? aql` RETURN ${mapFrag(itemFrag)}` : aql``; + const filterExprFrag = filterFrag ? aql` FILTER ${filterFrag(itemFrag)}` : aql``; + const limitExprFrag = limitFrag ? aql` ${limitFrag}` : aql``; + return aql`${frag}${operatorPrefixFrag}${filterExprFrag}${limitExprFrag}${returnExprFrag}]${suffixFrag}`; + } else { + frag = aql`${frag}${operatorPrefixFrag}]`; + } + + hasSeenList = true; } + + index++; } return frag; @@ -1943,15 +2456,15 @@ function getAQLOperator(op: BinaryOperator): AQLFragment | undefined { } } -function generateSortAQL(orderBy: OrderSpecification, context: QueryContext): AQLFragment { - if (orderBy.isUnordered()) { - return aql``; +function dirAQL(dir: OrderDirection) { + if (dir == OrderDirection.DESCENDING) { + return aql` DESC`; } + return aql``; +} - function dirAQL(dir: OrderDirection) { - if (dir == OrderDirection.DESCENDING) { - return aql` DESC`; - } +function generateSortAQL(orderBy: OrderSpecification, context: QueryContext): AQLFragment { + if (orderBy.isUnordered()) { return aql``; } diff --git a/src/database/arangodb/config.ts b/src/database/arangodb/config.ts index 44eb1b7cb..f365b4619 100644 --- a/src/database/arangodb/config.ts +++ b/src/database/arangodb/config.ts @@ -1,9 +1,8 @@ import { Database } from 'arangojs'; import { CreateCollectionOptions } from 'arangojs/collection'; import { Config } from 'arangojs/connection'; -import { globalContext } from '../../config/global'; import { ProjectOptions } from '../../config/interfaces'; -import { Logger } from '../../config/logging'; +import { DEFAULT_LOGGER_PROVIDER, Logger } from '../../config/logging'; import { CustomDatabase } from './arangojs-instrumentation/custom-database'; import { ArangoSearchConfiguration } from './schema-migration/arango-search-helpers'; @@ -92,10 +91,6 @@ export function initDatabase(config: ArangoDBConfig): Database { } export function getArangoDBLogger(schemaContext: ProjectOptions | undefined): Logger { - globalContext.registerContext(schemaContext); - try { - return globalContext.loggerProvider.getLogger('ArangoDBAdapter'); - } finally { - globalContext.unregisterContext(); - } + const loggerProvider = schemaContext?.loggerProvider ?? DEFAULT_LOGGER_PROVIDER; + return loggerProvider.getLogger('ArangoDBAdapter'); } diff --git a/src/database/inmemory/inmemory-adapter.ts b/src/database/inmemory/inmemory-adapter.ts index c99da4a0a..8be162971 100644 --- a/src/database/inmemory/inmemory-adapter.ts +++ b/src/database/inmemory/inmemory-adapter.ts @@ -1,6 +1,6 @@ import { globalContext } from '../../config/global'; import { ProjectOptions } from '../../config/interfaces'; -import { Logger } from '../../config/logging'; +import { DEFAULT_LOGGER_PROVIDER, Logger } from '../../config/logging'; import { Model } from '../../model'; import { ALL_QUERY_RESULT_VALIDATOR_FUNCTION_PROVIDERS, QueryNode } from '../../query-tree'; import { FlexSearchTokenization } from '../../query-tree/flex-search'; @@ -33,12 +33,8 @@ export class InMemoryAdapter implements DatabaseAdapter { if (options.db) { this.db = options.db; } - globalContext.registerContext(schemaContext); - try { - this.logger = globalContext.loggerProvider.getLogger('InMemoryAdapter'); - } finally { - globalContext.unregisterContext(); - } + const loggerProvider = schemaContext?.loggerProvider ?? DEFAULT_LOGGER_PROVIDER; + this.logger = loggerProvider.getLogger('InMemoryAdapter'); } /** diff --git a/src/database/inmemory/js-generator.ts b/src/database/inmemory/js-generator.ts index 44c2ef565..987562753 100644 --- a/src/database/inmemory/js-generator.ts +++ b/src/database/inmemory/js-generator.ts @@ -857,12 +857,6 @@ register(TraversalQueryNode, (node, context) => { const relationTraversalReturnsList = isList; let rootVar: JSVariable | undefined; let relationFrag: JSFragment | undefined; - if (node.captureRootEntity) { - relationFrag = currentFrag; - rootVar = js.variable('root'); - currentFrag = rootVar; - isList = false; // we're going to be within the mapper, so not in a list - } for (const segment of node.fieldSegments) { if (isList) { @@ -897,37 +891,6 @@ register(TraversalQueryNode, (node, context) => { } } - if (relationFrag && rootVar && node.captureRootEntity) { - if (relationTraversalReturnsList) { - if (node.fieldSegments.some((f) => f.isListSegment)) { - const accVar = js.variable('acc'); - const objVar = js.variable('obj'); - const mapper = js`${objVar} => ({ obj: ${objVar}, root: ${rootVar} })`; - const reducer = js`(${accVar}, ${rootVar}) => ${accVar}.concat((${currentFrag}).map(${mapper}))`; - currentFrag = js`${relationFrag}.reduce(${reducer}, [])`; - } else { - const mapper = js`${rootVar} => ({ obj: ${currentFrag}, root: ${rootVar} })`; - currentFrag = js`${relationFrag}.map(${mapper})`; - } - } else { - if (node.fieldSegments.some((f) => f.isListSegment)) { - const objVar = js.variable('obj'); - const mapper = js`${objVar} => ({ obj: ${objVar}, root: ${rootVar} })`; - currentFrag = jsExt.evaluatingLambda( - rootVar, - js`(${currentFrag}).map(${mapper})`, - relationFrag, - ); - } else { - currentFrag = jsExt.evaluatingLambda( - rootVar, - js`({ obj: ${currentFrag}, root: ${rootVar} })`, - relationFrag, - ); - } - } - } - if (node.alwaysProduceList && !isList) { const resultVar = js.variable('result'); currentFrag = jsExt.evaluatingLambda( diff --git a/src/query-tree/queries.ts b/src/query-tree/queries.ts index f23265fac..307b18e5f 100644 --- a/src/query-tree/queries.ts +++ b/src/query-tree/queries.ts @@ -7,6 +7,9 @@ import { import { blue } from '../utils/colors'; import { QueryNode } from './base'; import { EntitiesIdentifierKind } from './mutations'; +import { VariableQueryNode } from './variables'; +import { indent } from '../utils/utils'; +import { OrderSpecification } from './lists'; export class EntityFromIdQueryNode extends QueryNode { constructor( @@ -156,14 +159,73 @@ export class FollowEdgeQueryNode extends QueryNode { } } -interface TraversalQueryNodeParams { +export interface TraversalQueryNodeParams { readonly entitiesIdentifierKind?: EntitiesIdentifierKind; readonly sourceEntityNode: QueryNode; - readonly sourceIsList?: boolean; - readonly alwaysProduceList?: boolean; readonly relationSegments: ReadonlyArray; readonly fieldSegments: ReadonlyArray; - readonly captureRootEntities: boolean; + + /** + * Specifies if sourceEntityNode resolves to a list of entities instead of a single entity + */ + readonly sourceIsList?: boolean; + + /** + * Specifies if the result should be a list of one value if the path results in a single object instead of a list + * + * Only supported if fieldSegments is empty + */ + readonly alwaysProduceList?: boolean; + + /** + * If true and this traversal results in a list, NULL values will be preserved in the list + * + * Note: this only exists for aggregations, so it might not work in every case + * + * @default false + */ + readonly preserveNullValues?: boolean; + + /** + * An optional transformation (map) to apply on the traversal result + */ + readonly innerNode?: QueryNode; + + /** + * The variable under which each item will be available in the innerNode + */ + readonly itemVariable?: VariableQueryNode; + + /** + * The variable under which the root entity (result after relation traversal, but before child entity traversals) + * will be available in the innerNode + */ + readonly rootEntityVariable?: VariableQueryNode; + + /** + * An optional filter that is applied on the resulting items of the traversal + * + * Don't access rootEntityVariable here (if we need that, we should add a rootFilterNode that is + * applied after the relation traversal but before the field traversal) + */ + readonly filterNode?: QueryNode; + + /** + * An optional filter that is applied on the resulting items of the traversal + * + * Both item and root can be accessed here + */ + readonly orderBy?: OrderSpecification; + + /** + * Number of items to skip at the start + */ + readonly skip?: number; + + /** + * Maximum number of items to return + */ + readonly maxCount?: number; } /** @@ -174,7 +236,6 @@ export class TraversalQueryNode extends QueryNode { readonly sourceEntityNode: QueryNode; readonly relationSegments: ReadonlyArray; readonly fieldSegments: ReadonlyArray; - readonly captureRootEntity: boolean; /** * Specifies if sourceEntityNode resolves to a list of entities instead of a single entity @@ -182,43 +243,117 @@ export class TraversalQueryNode extends QueryNode { readonly sourceIsList: boolean; /** - * Specifies if the result should be a list one value if the path results in a single object instead of a list + * Specifies if the result should be a list of one value if the path results in a single object instead of a list + * + * Only supported if fieldSegments is empty */ readonly alwaysProduceList: boolean; + /** + * True if either alwaysProduceList is true or there is at least one list segment + */ + readonly resultIsList: boolean; + + /** + * If true and this traversal results in a list, NULL values will be preserved in the list + * + * Note: this only exists for aggregations, so it might not work in every case + */ + readonly preserveNullValues: boolean; + + /** + * An optional transformation (map) to apply on the traversal result + */ + readonly innerNode?: QueryNode; + + /** + * An optional filter that is applied on the resulting items of the traversal + * + * Don't access rootEntityVariable here (if we need that, we should add a rootFilterNode that is + * applied after the relation traversal but before the field traversal) + */ + readonly filterNode?: QueryNode; + + /** + * An optional filter that is applied on the resulting items of the traversal + * + * Both item and root can be accessed here + */ + readonly orderBy: OrderSpecification; + + /** + * The variable under which each item will be available in the innerNode + */ + readonly itemVariable: VariableQueryNode; + + /** + * The variable under which the root entity (result after relation traversal, but before child entity traversals) + * will be available in the innerNode + */ + readonly rootEntityVariable: VariableQueryNode; + + /** + * Number of items to skip at the start + */ + readonly skip: number; + + /** + * Maximum number of items to return + */ + readonly maxCount?: number; + constructor(params: TraversalQueryNodeParams) { super(); - if (params.captureRootEntities && (!params.relationSegments || !params.fieldSegments)) { + // don't need those with field segments, so don't support it + if (params.sourceIsList && params.fieldSegments.length > 0) { throw new Error( - `A TraversalQueryNode with captureRootEntity=true requires both relationSegments and fieldSegments`, + `TraversalQueryNode with sourceIsList=true can only be used when there are no fieldSegments`, ); } - - if (params.sourceIsList && !params.relationSegments) { - // only need this, so keep it simpler + if (params.alwaysProduceList && params.fieldSegments.length > 0) { throw new Error( - `A TraversalQueryNode with sourceIsList=true requires relationSegments`, + `TraversalQueryNode with alwaysProduceList=true can only be used when there are no fieldSegments`, ); } this.sourceEntityNode = params.sourceEntityNode; this.relationSegments = params.relationSegments; this.fieldSegments = params.fieldSegments; - this.captureRootEntity = params.captureRootEntities; this.sourceIsList = params.sourceIsList ?? false; this.alwaysProduceList = params.alwaysProduceList ?? false; + this.preserveNullValues = params.preserveNullValues ?? false; this.entitiesIdentifierKind = params.entitiesIdentifierKind || EntitiesIdentifierKind.ENTITY; + this.innerNode = params.innerNode; + this.filterNode = params.filterNode; + this.orderBy = params.orderBy ?? OrderSpecification.UNORDERED; + this.itemVariable = params.itemVariable ?? new VariableQueryNode(`collectItem`); + this.rootEntityVariable = params.rootEntityVariable ?? new VariableQueryNode(`collectRoot`); + this.skip = params.skip ?? 0; + this.maxCount = params.maxCount; + + this.resultIsList = + this.alwaysProduceList || + this.fieldSegments.some((s) => s.resultIsList) || + this.relationSegments.some((s) => s.resultIsList); } describe() { const segments = [...this.relationSegments, ...this.fieldSegments]; return ( - `traverse ${segments.map((s) => this.describeSegment(s)).join('.')}` + - `from ${this.sourceEntityNode.describe()}${this.sourceIsList ? ' (as list)' : ''}${ - this.captureRootEntity ? ` into { obj, root }` : '' - }${this.alwaysProduceList ? ` as list` : ''}` + `traverse "${segments.map((s) => this.describeSegment(s)).join('.')}" (\n` + + indent( + `from ${this.sourceEntityNode.describe()}${this.sourceIsList ? ' (as list)' : ''}${this.alwaysProduceList ? ` as list` : ''}` + + `\nitem var: ${this.itemVariable?.describe()}, root var: ${this.rootEntityVariable?.describe()}` + + (this.filterNode ? `\nwith filter: ${this.filterNode.describe()}` : '') + + (!this.orderBy.isUnordered() ? `\norder by: ${this.orderBy.describe()}` : '') + + (this.skip != 0 ? `skip ${this.skip}\n` : '') + + (this.maxCount != undefined ? `limit ${this.maxCount}\n` : '') + + (this.preserveNullValues ? `preserving null values\n` : '') + + (this.innerNode ? `\nas ${this.innerNode.describe()}` : ''), + ) + + `\n)` ); } diff --git a/src/schema-generation/field-nodes.ts b/src/schema-generation/field-nodes.ts index 6d2dcc44f..805fa963c 100644 --- a/src/schema-generation/field-nodes.ts +++ b/src/schema-generation/field-nodes.ts @@ -14,7 +14,6 @@ import { FollowEdgeQueryNode, NullQueryNode, ObjectQueryNode, - PropertyAccessQueryNode, QueryNode, RootEntityIDQueryNode, SafeListQueryNode, @@ -24,17 +23,34 @@ import { VariableQueryNode, } from '../query-tree'; import { ID_FIELD } from '../schema/constants'; -import { GraphQLOffsetDateTime, TIMESTAMP_PROPERTY } from '../schema/scalars/offset-date-time'; +import { GraphQLOffsetDateTime } from '../schema/scalars/offset-date-time'; import { getScalarFilterValueNode } from './filter-input-types/filter-fields'; import { and } from './utils/input-types'; +export interface CreateFieldNodeOptions { + readonly skipNullFallbackForEntityExtensions?: boolean; + readonly rootEntityVar?: VariableQueryNode; + + /** + * Call this on collect fields that traverse root entities to store a reference to the root entity in the stack + */ + readonly registerRootNode?: (rootNode: QueryNode) => void; +} + +// collect fields without aggregation or with a different operator can and should discard NULL values +const aggregationsThatNeedNullValues: ReadonlySet = new Set([ + AggregationOperator.COUNT, + AggregationOperator.SOME, + AggregationOperator.NONE, + AggregationOperator.COUNT_NULL, + AggregationOperator.SOME_NULL, + AggregationOperator.NONE_NULL, +]); + export function createFieldNode( field: Field, sourceNode: QueryNode, - options: { - skipNullFallbackForEntityExtensions?: boolean; - captureRootEntitiesOnCollectFields?: boolean; - } = {}, + options: CreateFieldNodeOptions = {}, ): QueryNode { // make use of the fact that field access on non-objects is NULL, so that type checks for OBJECT are redundant // this e.g. reverses the effect of the isEntityExtensionType check below @@ -57,12 +73,24 @@ export function createFieldNode( if (field.collectPath) { const { relationSegments, fieldSegments } = getEffectiveCollectSegments(field.collectPath); + const itemVariable = new VariableQueryNode('collectItem'); + const rootEntityVariable = options.registerRootNode + ? new VariableQueryNode('collectRoot') + : undefined; + const preserveNullValues = + !!field.aggregationOperator && + aggregationsThatNeedNullValues.has(field.aggregationOperator); const traversalNode = new TraversalQueryNode({ sourceEntityNode: sourceNode, relationSegments, fieldSegments, - captureRootEntities: !!options.captureRootEntitiesOnCollectFields, + rootEntityVariable, + itemVariable, + preserveNullValues, }); + if (options.registerRootNode && rootEntityVariable) { + options.registerRootNode(rootEntityVariable); + } if (!field.aggregationOperator) { return traversalNode; @@ -77,6 +105,7 @@ export function createFieldNode( field.collectPath.resultingType.isScalarType && field.collectPath.resultingType.graphQLScalarType === GraphQLOffsetDateTime ) { + // TODO NXT-7991-later move this into the TraversalQueryNode's innerNode const offsetDateTimeNode = new VariableQueryNode('offsetDateTime'); items = new TransformListQueryNode({ listNode: items, diff --git a/src/schema-generation/filter-augmentation.ts b/src/schema-generation/filter-augmentation.ts index 026136e2a..662de3535 100644 --- a/src/schema-generation/filter-augmentation.ts +++ b/src/schema-generation/filter-augmentation.ts @@ -36,8 +36,6 @@ export class FilterAugmentation { filterValue: args[FILTER_ARG], filterType, itemType, - objectNodeCallback: (itemNode) => - this.rootFieldHelper.getRealItemNode(itemNode, info), }); }, }; diff --git a/src/schema-generation/flex-search-post-filter-augmentation.ts b/src/schema-generation/flex-search-post-filter-augmentation.ts index ea94a70b6..e6b2a8a19 100644 --- a/src/schema-generation/flex-search-post-filter-augmentation.ts +++ b/src/schema-generation/flex-search-post-filter-augmentation.ts @@ -68,8 +68,6 @@ export class FlexSearchPostFilterAugmentation { filterValue: filterValue || legacyFilterValue, filterType, itemType, - objectNodeCallback: (itemNode) => - this.rootFieldHelper.getRealItemNode(itemNode, info), }); }, }; diff --git a/src/schema-generation/order-by-and-pagination-augmentation.ts b/src/schema-generation/order-by-and-pagination-augmentation.ts index b6dd7cc17..774ed816f 100644 --- a/src/schema-generation/order-by-and-pagination-augmentation.ts +++ b/src/schema-generation/order-by-and-pagination-augmentation.ts @@ -10,8 +10,8 @@ import { ConstBoolQueryNode, INVALID_CURSOR_ERROR, LiteralQueryNode, - NOT_SUPPORTED_ERROR, NoImplicitlyTruncatedListValidator, + NOT_SUPPORTED_ERROR, OrderDirection, OrderSpecification, PreExecQueryParms, @@ -19,6 +19,8 @@ import { RuntimeError, RuntimeErrorQueryNode, TransformListQueryNode, + TraversalQueryNode, + TraversalQueryNodeParams, VariableQueryNode, WithPreExecutionQueryNode, } from '../query-tree'; @@ -49,6 +51,7 @@ import { getSortClausesForPrimarySort, orderArgMatchesPrimarySort, } from './utils/flex-search-utils'; +import { RequireAllProperties } from '../utils/util-types'; export enum LimitTypeCheckType { RESULT_VALIDATOR = 'RESULT_VALIDATOR', @@ -134,7 +137,6 @@ export class OrderByAndPaginationAugmentation { resolve: (sourceNode, args, info) => { let listNode = schemaField.resolve(sourceNode, args, info); let itemVariable = new VariableQueryNode(decapitalize(type.name)); - let objectNode = this.rootFieldHelper.getRealItemNode(itemVariable, info); let maxCount: number | undefined = args[FIRST_ARG]; @@ -181,17 +183,28 @@ export class OrderByAndPaginationAugmentation { const originalListNode = listNode; if ( listNode instanceof TransformListQueryNode && - listNode.skip === 0 && + // TODO NXT-7991-later we could theoretically append this to the new sort order if it's not absolute + // but the more sane thing is probably just to throw listNode.orderBy.isUnordered() && + // TODO NXT-7991-later it's probably better to throw instead of checking because two LIMITs in a row is probably bad + listNode.skip === 0 && listNode.maxCount == undefined && + // TODO NXT-7991-later why is this condition necessary? listNode.innerNode === listNode.itemVariable ) { filterNode = listNode.filterNode.equals(ConstBoolQueryNode.TRUE) ? undefined : listNode.filterNode; itemVariable = listNode.itemVariable; - objectNode = this.rootFieldHelper.getRealItemNode(itemVariable, info); listNode = listNode.listNode; + } else if (listNode instanceof TraversalQueryNode) { + // a bit down, we check again whether it's a TraversalQueryNode and then merge the sort and pagination into it + itemVariable = listNode.itemVariable; + if (listNode.skip !== 0 || listNode.maxCount !== undefined) { + throw new Error( + `Pagination augmentation does not expect existing skip/maxCount on TraversalQueryNode`, + ); + } } // flexsearch? @@ -259,7 +272,7 @@ export class OrderByAndPaginationAugmentation { afterArg, // pagination acts on the listNode (which is a FlexSearchQueryNode) and not on the resulting // TransformListQueryNode, so we need to use listNode.itemVariable in the pagination filter - itemNode: this.rootFieldHelper.getRealItemNode(listNode.itemVariable, info), + itemNode: listNode.itemVariable, orderByValues, isFlexSearch: true, }); @@ -280,7 +293,7 @@ export class OrderByAndPaginationAugmentation { : getOrderByValues(args, orderByType, { isAbsoluteOrderRequired }); paginationFilter = this.createPaginationFilterNode({ afterArg, - itemNode: objectNode, + itemNode: itemVariable, orderByValues, isFlexSearch: false, }); @@ -290,13 +303,13 @@ export class OrderByAndPaginationAugmentation { const orderBy = !orderByType ? OrderSpecification.UNORDERED : new OrderSpecification( - orderByValues.map((value) => value.getClause(objectNode)), + orderByValues.map((value) => value.getClause(itemVariable)), ); if ( orderBy.isUnordered() && maxCount == undefined && - paginationFilter === ConstBoolQueryNode.TRUE + (!paginationFilter || paginationFilter === ConstBoolQueryNode.TRUE) ) { return originalListNode; } @@ -321,6 +334,7 @@ export class OrderByAndPaginationAugmentation { if ( !(listNode instanceof FlexSearchQueryNode) && + !(listNode instanceof TraversalQueryNode) && // does not make use of indices for sorting !skip && maxCount != undefined && orderBy.clauses.length > 1 && @@ -336,7 +350,6 @@ export class OrderByAndPaginationAugmentation { const optimizedQueryNode = this.getPaginatedNodeUsingMultiIndexOptimization({ orderBy, itemVariable, - objectNode, orderByType, listNode, args, @@ -359,6 +372,31 @@ export class OrderByAndPaginationAugmentation { return optimizedQueryNode; } + if (listNode instanceof TraversalQueryNode) { + if (wrapQueryNodeInResultValidator && options.operation) { + // traversals are always limited in nature, so we don't check item count + throw new Error(`result validator not supported on TraversalQueryNode`); + } + + return new TraversalQueryNode({ + entitiesIdentifierKind: listNode.entitiesIdentifierKind, + sourceEntityNode: listNode.sourceEntityNode, + relationSegments: listNode.relationSegments, + fieldSegments: listNode.fieldSegments, + sourceIsList: listNode.sourceIsList, + alwaysProduceList: listNode.alwaysProduceList, + preserveNullValues: listNode.preserveNullValues, + filterNode: listNode.filterNode, + innerNode: listNode.innerNode, + rootEntityVariable: listNode.rootEntityVariable, + skip, + maxCount, + + itemVariable, + orderBy, + } satisfies RequireAllProperties); + } + const transformListNode = new TransformListQueryNode({ listNode, itemVariable, @@ -406,7 +444,6 @@ export class OrderByAndPaginationAugmentation { args, orderByType, itemVariable, - objectNode, listNode, orderBy, maxCount, @@ -415,7 +452,6 @@ export class OrderByAndPaginationAugmentation { args: { [name: string]: any }; orderByType: OrderByEnumType; itemVariable: VariableQueryNode; - objectNode: QueryNode; listNode: QueryNode; orderBy: OrderSpecification; maxCount: number | undefined; @@ -454,7 +490,7 @@ export class OrderByAndPaginationAugmentation { ); } const cursorValue = cursorObj[cursorProperty]; - const valueNode = clause.getValueNode(objectNode); + const valueNode = clause.getValueNode(itemVariable); const operator = clause.direction == OrderDirection.ASCENDING diff --git a/src/schema-generation/output-type-generator.ts b/src/schema-generation/output-type-generator.ts index e4fcc7885..b81a3158c 100644 --- a/src/schema-generation/output-type-generator.ts +++ b/src/schema-generation/output-type-generator.ts @@ -227,7 +227,10 @@ export class OutputTypeGenerator { // a check that they return null if the source node is null. // if we skip both, entity extensions will be passed as null, but they will only ever be used to look up // fields in them, and a FieldQueryNode returns null if the source is null. - skipNullCheck: field.type.isEntityExtensionType, + // parent fields and root fields can never be null (either they exist, or querying them throws an error) + // it's important to skip the null check because ArangoDB would otherwise no longer use the reduce-extraction-to-projection optimiztion + skipNullCheck: + field.type.isEntityExtensionType || field.isParentField || field.isRootField, isPure: true, resolve: (sourceNode, args, info) => this.resolveField(field, sourceNode, info), }; @@ -254,9 +257,9 @@ export class OutputTypeGenerator { return rootHelperResult.resultNode; } - return createFieldNode(field, rootHelperResult.sourceNode, { + return createFieldNode(field, sourceNode, { skipNullFallbackForEntityExtensions: true, - captureRootEntitiesOnCollectFields: rootHelperResult.captureRootEntitiesOnCollectFields, + registerRootNode: (rootNode) => rootHelperResult.registerRootNode(rootNode), }); } diff --git a/src/schema-generation/query-node-object-type/context.ts b/src/schema-generation/query-node-object-type/context.ts index 670c2f775..cbc608ae3 100644 --- a/src/schema-generation/query-node-object-type/context.ts +++ b/src/schema-generation/query-node-object-type/context.ts @@ -7,7 +7,7 @@ import { FieldSelection } from '../../graphql/query-distiller'; * * There usually is a 1:1 relationship between a FieldSelection/FieldRequest and the SelectionToken. However, instances * of a FieldSelection do not convey an identity per se. Usage of the SelectionToken class makes it clear that it's not - * taken for its values bot for the identity within an execution. This is a useful property for caches and external + * taken for its values but for the identity within an execution. This is a useful property for caches and external * state management. */ export class SelectionToken { diff --git a/src/schema-generation/query-node-object-type/query-node-generator.ts b/src/schema-generation/query-node-object-type/query-node-generator.ts index b6b12880a..571a03d50 100644 --- a/src/schema-generation/query-node-object-type/query-node-generator.ts +++ b/src/schema-generation/query-node-object-type/query-node-generator.ts @@ -3,6 +3,7 @@ import { FieldRequest, FieldSelection } from '../../graphql/query-distiller'; import { BasicType, ConditionalQueryNode, + EntitiesIdentifierKind, FieldQueryNode, LiteralQueryNode, NullQueryNode, @@ -10,7 +11,10 @@ import { PreExecQueryParms, PropertySpecification, QueryNode, + RuntimeErrorQueryNode, TransformListQueryNode, + TraversalQueryNode, + TraversalQueryNodeParams, TypeCheckQueryNode, VariableAssignmentQueryNode, VariableQueryNode, @@ -22,6 +26,8 @@ import { FieldContext, SelectionToken } from './context'; import { QueryNodeField, QueryNodeObjectType } from './definition'; import { extractQueryTreeObjectType, isListTypeIgnoringNonNull } from './utils'; import { DefaultClock, UUIDGenerator } from '../../execution/execution-options'; +import { FieldSegment, RelationSegment } from '../../model/implementation/collect-path'; +import { RequireAllProperties } from '../../utils/util-types'; export function createRootFieldContext( options: Partial< @@ -194,6 +200,16 @@ function buildFieldQueryNode0( // object if (field.skipNullCheck) { + // if there is no null check, this output node does not access fieldQueryNode at all, so + // moveErrorsToOutputNodes() won't move errors here. Without this logic here, runtime errors + // would only be moved to the fields that use fieldQueryNode, and the main object would + // still exist (without error) + // Limitation: if fieldQueryNode is a complex expression that can sometimes result in a + // RuntimeErrorQueryNode, we still have the problem. Currently, we don't generate such a pattern. + if (fieldQueryNode instanceof RuntimeErrorQueryNode) { + return fieldQueryNode; + } + return buildObjectQueryNode( fieldQueryNode, queryTreeObjectType, @@ -258,7 +274,36 @@ function buildTransformListQueryNode( }); } - const itemVariable = new VariableQueryNode(itemType.name); + // same applies to TraversalQueryNode which is used for collect fields + // this is actually functionally required because otherwise we would not have access to the rootEntityNode + // (needed for @root fields) + if (listNode instanceof TraversalQueryNode) { + const itemVariable = listNode.itemVariable ?? new VariableQueryNode(`collectItem`); + const rootEntityVariable = + listNode.rootEntityVariable ?? new VariableQueryNode(`collectRoot`); + const oldInnerNode = listNode.innerNode ?? itemVariable; + const innerNode = buildObjectQueryNode(oldInnerNode, itemType, selectionSet, context); + + return new TraversalQueryNode({ + entitiesIdentifierKind: listNode.entitiesIdentifierKind, + sourceEntityNode: listNode.sourceEntityNode, + relationSegments: listNode.relationSegments, + fieldSegments: listNode.fieldSegments, + sourceIsList: listNode.sourceIsList, + alwaysProduceList: listNode.alwaysProduceList, + preserveNullValues: listNode.preserveNullValues, + filterNode: listNode.filterNode, + orderBy: listNode.orderBy, + skip: listNode.skip, + maxCount: listNode.maxCount, + + innerNode, + itemVariable, + rootEntityVariable, + } satisfies RequireAllProperties); + } + + const itemVariable = new VariableQueryNode(decapitalize(itemType.name)); const innerNode = buildObjectQueryNode(itemVariable, itemType, selectionSet, context); return new TransformListQueryNode({ listNode, diff --git a/src/schema-generation/root-field-helper.ts b/src/schema-generation/root-field-helper.ts index 854fe39a2..50c08fe64 100644 --- a/src/schema-generation/root-field-helper.ts +++ b/src/schema-generation/root-field-helper.ts @@ -16,23 +16,19 @@ export interface ProcessFieldResult { readonly resultNode: QueryNode | undefined; /** - * The source node, which might differ from the sourceNode passed in in case of root entity capture. - * - * Only relevant if resultNode is undefined. + * Call this on collect fields that traverse root entities to store a reference to the root entity in the stack */ - readonly sourceNode: QueryNode; - - /** - * if this field is a collect field, specifies whether it should capture root entities - */ - readonly captureRootEntitiesOnCollectFields: boolean; + registerRootNode(rootNode: QueryNode): void; } interface HierarchyStackFrame { readonly currentEntityNode?: QueryNode; readonly parentEntityFrame?: HierarchyStackFrame; - // keep root explicitly because sometimes, we might have the root entity, but not the parent entity readonly rootEntityNode?: QueryNode; + + // keep root explicitly because sometimes, we might have the root entity, but not the parent entity + // set by registerRootNode() + rootEntityNodeForChildFrames?: QueryNode; } export class RootFieldHelper { @@ -41,7 +37,6 @@ export class RootFieldHelper { HierarchyStackFrame >(); private readonly fieldsBySelection = new WeakMap(); - private readonly selectionsThatCaptureRootEntities = new WeakSet(); /** * Should be called whenever a field is resolved. Will maintain a hierarchy structure, and may produce a value node @@ -88,13 +83,6 @@ export class RootFieldHelper { const existingHierarchyFrame = this.getHierarchyStackFrame(fieldContext.selectionToken); const outerField = this.getFieldAtSelection(parentSelectionToken); - let collectRootNode: QueryNode | undefined; - if (this.capturesRootEntity(parentSelectionToken)) { - collectRootNode = new PropertyAccessQueryNode(sourceNode, 'root'); - // we will return the sourceNode below - sourceNode = new PropertyAccessQueryNode(sourceNode, 'obj'); - } - // if this is the first time at this layer, calculate the hierarchy frame for this layer let hierarchyFrame: HierarchyStackFrame; if (existingHierarchyFrame) { @@ -120,7 +108,7 @@ export class RootFieldHelper { // traversing root entities, so need to take new root. parent is not available. hierarchyFrame = { currentEntityNode, - rootEntityNode: collectRootNode, + rootEntityNode: outerFrame?.rootEntityNodeForChildFrames, }; } else { // not traversing root entities just throw away the parent but keep root @@ -142,41 +130,23 @@ export class RootFieldHelper { this.setHierarchyStackFrame(fieldContext.selectionToken, hierarchyFrame); } - const captureRootEntitiesOnCollectFields = this.shouldCaptureRootEntity( - field, - fieldContext.selectionStack[fieldContext.selectionStack.length - 1].fieldRequest, - ); - - if (captureRootEntitiesOnCollectFields) { - this.selectionsThatCaptureRootEntities.add(fieldContext.selectionToken); - } - return { - sourceNode, resultNode: this.tryResolveField(field, hierarchyFrame), - captureRootEntitiesOnCollectFields, + registerRootNode(rootNode: QueryNode) { + if (hierarchyFrame.rootEntityNodeForChildFrames) { + throw new Error( + `Root query node already registered for field "${field.declaringType.name}.${field.name}"`, + ); + } + hierarchyFrame.rootEntityNodeForChildFrames = rootNode; + }, }; } - getRealItemNode(itemNode: QueryNode, fieldContext: FieldContext) { - if (this.capturesRootEntity(fieldContext.selectionToken)) { - return new PropertyAccessQueryNode(itemNode, 'obj'); - } - return itemNode; - } - - /** - * Determines whether a selection has been instructed (by captureRootEntitiesOnCollectFields) to capture root entities - */ - capturesRootEntity(selectionToken: SelectionToken) { - return this.selectionsThatCaptureRootEntities.has(selectionToken); - } - private tryResolveField( field: Field, hierarchyFrame: HierarchyStackFrame, ): QueryNode | undefined { - let resultNode: QueryNode | undefined; // parent fields that have root entity types are effectively root fields, and those are a bit easier to manage, // so use the logic for root fields in these cases. if (field.isRootField || (field.isParentField && field.type.isRootEntityType)) { @@ -184,101 +154,22 @@ export class RootFieldHelper { return new RuntimeErrorQueryNode(`Root entity is not available here`, { code: NOT_SUPPORTED_ERROR, }); - } else { - return hierarchyFrame.rootEntityNode; } - } else if (field.isParentField) { + + return hierarchyFrame.rootEntityNode; + } + + if (field.isParentField) { if (!hierarchyFrame.parentEntityFrame?.currentEntityNode) { return new RuntimeErrorQueryNode(`Parent entity is not available here`, { code: NOT_SUPPORTED_ERROR, }); } - return hierarchyFrame.parentEntityFrame.currentEntityNode; - } - return undefined; - } - - private shouldCaptureRootEntity(field: Field, fieldRequest: FieldRequest) { - if (!field.collectPath) { - return false; - } - - // we will only ever need it for collect paths that cross both inter- and intra-root-entity fields - // (and it's not allowed to capture it in other cases anyway) - // we also only need it if the result is a child entity type. It can't be an entity extension (that would be a - // validation error), and value objects can't declare parent fields. - // note that isChildEntityType + traversesRootEntityTypes implies that there are field traversals as well. - if (!field.type.isChildEntityType || !field.collectPath.traversesRootEntityTypes) { - return false; - } - - return this.selectsRootField(fieldRequest, field.type); - } - // caching is helpful because it might get called further down in the hierarchy again - // caching is ok because it only keeps a small boolean in the case of a kept-alive FieldRequest - @memorize() - private selectsRootField(fieldRequest: FieldRequest, type: ObjectType): boolean { - // hasReachableRootField can be cached request-independently, so we can save the time to crawl the selections - // if we know there aren't any reachable root fields - if (!this.hasReachableRootField(type)) { - return false; + return hierarchyFrame.parentEntityFrame.currentEntityNode; } - // assumes that parent/root fields, child entity fields and entity extension fields are always called - // exactly like in the model (to do this properly, using the output-type-generator itself, we would need several - // passes, or we would need to run the query-node-generator upfront and associate metadata with the - // QueryNodeFields - - return fieldRequest.selectionSet.some((f) => { - const field = type.getField(f.fieldRequest.field.name); - if (!field) { - return false; - } - if (field.isRootField || (field.isParentField && field.type.isRootEntityType)) { - return true; - } - // don't walk out of the current root entity, we're not interested in them (that would change the root) - if ( - (field.type.isChildEntityType || field.type.isEntityExtensionType) && - (!field.collectPath || !field.collectPath.traversesRootEntityTypes) - ) { - return this.selectsRootField(f.fieldRequest, field.type); - } - return false; - }); - } - - /** - * Determines whether a @root field can be reached from anywhere within the given type. - * - * Stops at root entity boundaries - */ - @memorize() - private hasReachableRootField(type: ObjectType): boolean { - const seen = new Set([type]); - let fringe = [type]; - do { - const newFringe: ObjectType[] = []; - for (const type of fringe) { - for (const field of type.fields) { - // parent fields of root entity types are basically root fields (and they will make use of captureRootEntity) - if (field.isRootField || (field.isParentField && field.type.isRootEntityType)) { - return true; - } - if ( - (field.type.isChildEntityType || field.type.isEntityExtensionType) && - !seen.has(field.type) && - (!field.collectPath || !field.collectPath.traversesRootEntityTypes) - ) { - seen.add(field.type); - newFringe.push(field.type); - } - } - } - fringe = newFringe; - } while (fringe.length); - return false; + return undefined; } private getHierarchyStackFrame( diff --git a/src/schema-generation/utils/filtering.ts b/src/schema-generation/utils/filtering.ts index fdc873cf3..72fb1a8e1 100644 --- a/src/schema-generation/utils/filtering.ts +++ b/src/schema-generation/utils/filtering.ts @@ -5,35 +5,64 @@ import { ConstBoolQueryNode, QueryNode, TransformListQueryNode, + TraversalQueryNode, + TraversalQueryNodeParams, VariableQueryNode, } from '../../query-tree'; import { simplifyBooleans } from '../../query-tree/utils'; import { FILTER_ARG } from '../../schema/constants'; import { decapitalize } from '../../utils/utils'; import { FilterObjectType } from '../filter-input-types'; +import { RequireAllProperties } from '../../utils/util-types'; interface BuildFilteredListNodeParams { readonly listNode: QueryNode; readonly filterValue: any; readonly filterType: FilterObjectType; readonly itemType: Type; - readonly objectNodeCallback: (itemNode: QueryNode) => QueryNode; } -export function buildFilteredListNode(params: BuildFilteredListNodeParams) { +export function buildFilteredListNode({ listNode, ...params }: BuildFilteredListNodeParams) { const filterValue = params.filterValue || {}; - const itemVariable = new VariableQueryNode(decapitalize(params.itemType.name)); + const existingItemVariable = + listNode instanceof TraversalQueryNode ? listNode.itemVariable : undefined; + const itemVariable = + existingItemVariable ?? new VariableQueryNode(decapitalize(params.itemType.name)); // simplification is important for the shortcut with check for TRUE below in the case of e.g. { AND: [] } - const objectNode = params.objectNodeCallback(itemVariable); - const filterNode = simplifyBooleans(params.filterType.getFilterNode(objectNode, filterValue)); + const filterNode = simplifyBooleans(params.filterType.getFilterNode(itemVariable, filterValue)); // avoid unnecessary TransformLists especially for count queries, so that it can be optimized to LENGTH(collection) if (filterNode === ConstBoolQueryNode.TRUE) { - return params.listNode; + return listNode; } + if (listNode instanceof TraversalQueryNode) { + const effectiveFilterNode = listNode.filterNode + ? new BinaryOperationQueryNode(listNode.filterNode, BinaryOperator.AND, filterNode) + : filterNode; + + return new TraversalQueryNode({ + entitiesIdentifierKind: listNode.entitiesIdentifierKind, + sourceEntityNode: listNode.sourceEntityNode, + relationSegments: listNode.relationSegments, + fieldSegments: listNode.fieldSegments, + sourceIsList: listNode.sourceIsList, + alwaysProduceList: listNode.alwaysProduceList, + preserveNullValues: listNode.preserveNullValues, + innerNode: listNode.innerNode, + rootEntityVariable: listNode.rootEntityVariable, + orderBy: listNode.orderBy, + skip: listNode.skip, + maxCount: listNode.maxCount, + + itemVariable, + filterNode: effectiveFilterNode, + } satisfies RequireAllProperties); + } + + // TODO NXT-7991-later also merge with existing TransformListQueryNode if any return new TransformListQueryNode({ - listNode: params.listNode, + listNode, itemVariable, filterNode, }); diff --git a/src/schema-generation/utils/relations.ts b/src/schema-generation/utils/relations.ts index c670f4cc3..15ffc162a 100644 --- a/src/schema-generation/utils/relations.ts +++ b/src/schema-generation/utils/relations.ts @@ -393,7 +393,6 @@ function getPreEntityRemovalStatementsForRelationSide( sourceIsList: true, relationSegments: [segment], fieldSegments: [], - captureRootEntities: false, alwaysProduceList: true, }); diff --git a/src/utils/util-types.ts b/src/utils/util-types.ts index 3f8ec8491..2dcc04dc1 100644 --- a/src/utils/util-types.ts +++ b/src/utils/util-types.ts @@ -1,3 +1,10 @@ export type Mutable = { -readonly [key in keyof T]: T[key]; }; + +/** + * Like Required<>, but allow undefined if it's allowed in the source type + */ +export type RequireAllProperties = { + readonly [K in keyof Required]: T[K]; +}; diff --git a/tsconfig.json b/tsconfig.json index 55c8e7599..8c4caef6a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,7 +14,7 @@ "downlevelIteration": true, "experimentalDecorators": true, "esModuleInterop": true, - "lib": ["ES2022"], + "lib": ["ES2023"], "paths": { "*": ["./src/typings/*"] },