From 72a0c82cc1cabd3eb1146d2c96b6837d4893b66d Mon Sep 17 00:00:00 2001 From: angrykoala Date: Tue, 10 Dec 2024 15:52:51 +0000 Subject: [PATCH 1/5] Aggregation filters in schema --- .../BigIntScalarAggregationFilters.ts | 41 ++ .../DateTimeScalarAggregationFilters.ts | 39 ++ .../DurationScalarAggregationFilters.ts | 40 ++ .../FloatScalarAggregationFilters.ts | 41 ++ .../IDScalarAggregationFilters.ts | 39 ++ .../IntScalarAggregationFilters.ts | 42 ++ .../LocalDateTimeScalarAggregationFilters.ts | 39 ++ .../LocalTimeScalarAggregationFilters.ts | 39 ++ .../StringScalarAggregationFilters.ts | 41 ++ .../TimeScalarAggregationFilters.ts | 39 ++ .../src/schema/generation/aggregate-types.ts | 6 + ...-aggregation-filter-from-attribute-type.ts | 129 +++++ .../graphql/tests/schema/aggregations.test.ts | 88 +++ .../tests/schema/array-methods.test.ts | 34 ++ .../tests/schema/authorization.test.ts | 37 ++ .../graphql/tests/schema/comments.test.ts | 55 ++ .../tests/schema/connections/enums.test.ts | 29 + .../schema/connections/interfaces.test.ts | 11 + .../tests/schema/connections/sort.test.ts | 28 + .../tests/schema/connections/unions.test.ts | 28 + .../tests/schema/directive-preserve.test.ts | 119 ++++ .../tests/schema/directives/alias.test.ts | 27 + .../schema/directives/filterable.test.ts | 377 +++++++++++++ .../schema/directives/populatedBy.test.ts | 67 +++ .../directives/relationship-aggregate.test.ts | 116 ++++ .../relationship-nested-operations.test.ts | 515 ++++++++++++++++++ .../relationship-properties.test.ts | 113 ++++ .../schema/directives/relationship.test.ts | 35 ++ .../schema/directives/selectable.test.ts | 116 ++++ .../tests/schema/directives/settable.test.ts | 296 ++++++++++ .../graphql/tests/schema/federation.test.ts | 57 ++ .../graphql/tests/schema/inheritance.test.ts | 28 + .../schema/interface-relationships.test.ts | 262 +++++++++ .../graphql/tests/schema/interfaces.test.ts | 16 + .../graphql/tests/schema/issues/1182.test.ts | 42 ++ .../graphql/tests/schema/issues/1614.test.ts | 28 + .../graphql/tests/schema/issues/162.test.ts | 26 + .../graphql/tests/schema/issues/2187.test.ts | 27 + .../graphql/tests/schema/issues/2377.test.ts | 43 ++ .../graphql/tests/schema/issues/2993.test.ts | 42 ++ .../graphql/tests/schema/issues/3428.test.ts | 35 ++ .../graphql/tests/schema/issues/3541.test.ts | 56 ++ .../graphql/tests/schema/issues/3698.test.ts | 31 ++ .../graphql/tests/schema/issues/3817.test.ts | 35 ++ .../graphql/tests/schema/issues/4511.test.ts | 8 + .../graphql/tests/schema/issues/4615.test.ts | 30 + .../graphql/tests/schema/issues/872.test.ts | 37 ++ .../tests/schema/lowercase-type-names.test.ts | 38 ++ packages/graphql/tests/schema/math.test.ts | 89 +++ .../schema/nested-aggregation-on-type.test.ts | 27 + .../schema/pluralize-consistency.test.ts | 28 + .../tests/schema/query-direction.test.ts | 56 ++ .../remove-deprecated/array-methods.test.ts | 34 ++ .../schema/remove-deprecated/comments.test.ts | 55 ++ .../tests/schema/string-comparators.test.ts | 30 + .../tests/schema/subscriptions.test.ts | 123 +++++ .../union-interface-relationship.test.ts | 35 ++ 57 files changed, 3944 insertions(+) create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts create mode 100644 packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts create mode 100644 packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts new file mode 100644 index 0000000000..d1b534d794 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { BigIntScalarFilters } from "../generic-operators/BigIntScalarFilters"; + +export const BigIntScalarAggregationFilters = new GraphQLInputObjectType({ + name: "BigIntScalarAggregationFilters", + description: "Filters for an aggregation of an BigInt field", + fields: { + average: { type: BigIntScalarFilters }, + max: { type: BigIntScalarFilters }, + min: { type: BigIntScalarFilters }, + sum: { type: BigIntScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts new file mode 100644 index 0000000000..4d9515a7f0 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { DateTimeScalarFilters } from "../generic-operators/DateTimeScalarFilters"; + +export const DateTimeScalarAggregationFilters = new GraphQLInputObjectType({ + name: "DateTimeScalarAggregationFilters", + description: "Filters for an aggregation of an DateTime input field", + fields: { + max: { type: DateTimeScalarFilters }, + min: { type: DateTimeScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts new file mode 100644 index 0000000000..df6e4148f8 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts @@ -0,0 +1,40 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { DurationScalarFilters } from "../generic-operators/DurationScalarFilters"; + +export const DurationScalarAggregationFilters = new GraphQLInputObjectType({ + name: "DurationScalarAggregationFilters", + description: "Filters for an aggregation of a Dutation input field", + fields: { + max: { type: DurationScalarFilters }, + min: { type: DurationScalarFilters }, + average: { type: DurationScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts new file mode 100644 index 0000000000..5e45c3ae95 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { FloatScalarFilters } from "../generic-operators/FloatScalarFilters"; + +export const FloatScalarAggregationFilters = new GraphQLInputObjectType({ + name: "FloatScalarAggregationFilters", + description: "Filters for an aggregation of a float field", + fields: { + average: { type: FloatScalarFilters }, + max: { type: FloatScalarFilters }, + min: { type: FloatScalarFilters }, + sum: { type: FloatScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts new file mode 100644 index 0000000000..cb9f43cd20 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { IDScalarFilters } from "../generic-operators/IDScalarFilters"; + +export const IDScalarAggregationFilters = new GraphQLInputObjectType({ + name: "IDScalarAggregationFilters", + description: "Filters for an aggregation of an ID input field", + fields: { + max: { type: IDScalarFilters }, + min: { type: IDScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts new file mode 100644 index 0000000000..5f51e3aeca --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { FloatScalarFilters } from "../generic-operators/FloatScalarFilters"; +import { IntScalarFilters } from "../generic-operators/IntScalarFilters"; + +export const IntScalarAggregationFilters = new GraphQLInputObjectType({ + name: "IntScalarAggregationFilters", + description: "Filters for an aggregation of an int field", + fields: { + average: { type: FloatScalarFilters }, + max: { type: IntScalarFilters }, + min: { type: IntScalarFilters }, + sum: { type: IntScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts new file mode 100644 index 0000000000..3e6892023f --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { LocalDateTimeScalarFilters } from "../generic-operators/LocalDateTimeScalarFilters"; + +export const LocalDateTimeScalarAggregationFilters = new GraphQLInputObjectType({ + name: "LocalDateTimeScalarAggregationFilters", + description: "Filters for an aggregation of an LocalDateTime input field", + fields: { + max: { type: LocalDateTimeScalarFilters }, + min: { type: LocalDateTimeScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts new file mode 100644 index 0000000000..c286a953cb --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { LocalTimeScalarFilters } from "../generic-operators/LocalTimeScalarFilters"; + +export const LocalTimeScalarAggregationFilters = new GraphQLInputObjectType({ + name: "LocalTimeScalarAggregationFilters", + description: "Filters for an aggregation of an LocalTime input field", + fields: { + max: { type: LocalTimeScalarFilters }, + min: { type: LocalTimeScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts new file mode 100644 index 0000000000..3f8ea225c9 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts @@ -0,0 +1,41 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { FloatScalarFilters } from "../generic-operators/FloatScalarFilters"; +import { IntScalarFilters } from "../generic-operators/IntScalarFilters"; + +export const StringScalarAggregationFilters = new GraphQLInputObjectType({ + name: "StringScalarAggregationFilters", + description: "Filters for an aggregation of a string field", + fields: { + averageLength: { type: FloatScalarFilters }, + shortestLength: { type: IntScalarFilters }, + longestLength: { type: IntScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts new file mode 100644 index 0000000000..d78bcfd6bd --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { GraphQLInputObjectType } from "graphql"; +import { TimeScalarFilters } from "../generic-operators/TimeScalarFilters"; + +export const TimeScalarAggregationFilters = new GraphQLInputObjectType({ + name: "TimeScalarAggregationFilters", + description: "Filters for an aggregation of an Time input field", + fields: { + max: { type: TimeScalarFilters }, + min: { type: TimeScalarFilters }, + }, +}); + +// export const IntListFilters = new GraphQLInputObjectType({ +// name: "IntListFilters", +// description: "Int list filters", +// fields: { +// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, +// includes: { type: GraphQLInt }, +// }, +// }); diff --git a/packages/graphql/src/schema/generation/aggregate-types.ts b/packages/graphql/src/schema/generation/aggregate-types.ts index bb3bce3973..a14891b954 100644 --- a/packages/graphql/src/schema/generation/aggregate-types.ts +++ b/packages/graphql/src/schema/generation/aggregate-types.ts @@ -35,6 +35,7 @@ import type { Neo4jFeaturesSettings } from "../../types"; import type { AggregationTypesMapper } from "../aggregations/aggregation-types-mapper"; import { numericalResolver } from "../resolvers/field/numerical"; import { graphqlDirectivesToCompose } from "../to-compose"; +import { getAggregationFilterFromAttributeType } from "./get-aggregation-filter-from-attribute-type"; export function withAggregateSelectionType({ entityAdapter, @@ -106,6 +107,7 @@ export function withAggregateInputType({ count_LTE: GraphQLInt, count_GT: GraphQLInt, count_GTE: GraphQLInt, + // count: IntScalarFilters, }, }); @@ -190,6 +192,8 @@ function makeAggregationFields( const fields: InputTypeComposerFieldConfigMapDefinition = {}; for (const attribute of attributes) { addAggregationFieldsByType(attribute, userDefinedDirectivesOnTargetFields?.get(attribute.name), fields); + + fields[attribute.name] = getAggregationFilterFromAttributeType(attribute); } return fields; } @@ -218,6 +222,7 @@ function addAggregationFieldsByType( directives: deprecatedDirectives, }; } + return fields; } if (attribute.typeHelper.isNumeric() || attribute.typeHelper.isDuration()) { @@ -247,6 +252,7 @@ function addAggregationFieldsByType( : GraphQLFloat; fields[`${attribute.name}_AVERAGE_${operator}`] = { type: averageType, directives: deprecatedDirectives }; } + return fields; } for (const operator of AGGREGATION_COMPARISON_OPERATORS) { diff --git a/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts b/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts new file mode 100644 index 0000000000..c2dac15271 --- /dev/null +++ b/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts @@ -0,0 +1,129 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { GraphQLInputObjectType } from "graphql"; +import { BigIntScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters"; +import { DateTimeScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters"; +import { DurationScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters"; +import { FloatScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters"; +import { IDScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters"; +import { IntScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters"; +import { LocalDateTimeScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters"; +import { LocalTimeScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters"; +import { StringScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters"; +import { TimeScalarAggregationFilters } from "../../graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters"; +import type { AttributeAdapter } from "../../schema-model/attribute/model-adapters/AttributeAdapter"; + +export function getAggregationFilterFromAttributeType(attribute: AttributeAdapter): GraphQLInputObjectType | string { + // // NOTE: static types returned here must be added to schema-validation > validateUserDefinition + // if (attribute.typeHelper.isBoolean()) { + // if (attribute.typeHelper.isList()) { + // return BooleanListFilters; + // } + // return BooleanScalarFilters; + // } + if (attribute.typeHelper.isID()) { + // if (attribute.typeHelper.isList()) { + // return IDListFilters; + // } + return IDScalarAggregationFilters; + } + if (attribute.typeHelper.isString()) { + // if (attribute.typeHelper.isList()) { + // return StringListFilters; + // } + return StringScalarAggregationFilters; + } + if (attribute.typeHelper.isInt()) { + // if (attribute.typeHelper.isList()) { + // return IntListFilters; + // } + return IntScalarAggregationFilters; + } + if (attribute.typeHelper.isFloat()) { + // if (attribute.typeHelper.isList()) { + // return FloatListFilters; + // } + return FloatScalarAggregationFilters; + } + if (attribute.typeHelper.isBigInt()) { + // if (attribute.typeHelper.isList()) { + // return BigIntListFilters; + // } + return BigIntScalarAggregationFilters; + } + if (attribute.typeHelper.isTime()) { + // if (attribute.typeHelper.isList()) { + // return TimeListFilters; + // } + return TimeScalarAggregationFilters; + } + // if (attribute.typeHelper.isPoint()) { + // if (attribute.typeHelper.isList()) { + // return PointListFilters; + // } + // return PointFilters; + // } + // if (attribute.typeHelper.isCartesianPoint()) { + // if (attribute.typeHelper.isList()) { + // return CartesianPointListFilters; + // } + // return CartesianPointFilters; + // } + if (attribute.typeHelper.isDateTime()) { + // if (attribute.typeHelper.isList()) { + // return DateTimeListFilters; + // } + return DateTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isLocalTime()) { + // if (attribute.typeHelper.isList()) { + // return LocalTimeListFilters; + // } + return LocalTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isLocalDateTime()) { + // if (attribute.typeHelper.isList()) { + // return LocalDateTimeListFilters; + // } + return LocalDateTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isDuration()) { + // if (attribute.typeHelper.isList()) { + // return DurationListFilters; + // } + return DurationScalarAggregationFilters; + } + // if (attribute.typeHelper.isDate()) { + // if (attribute.typeHelper.isList()) { + // return DateListFilters; + // } + // return DateScalarFilters; + // } + + // if (attribute.typeHelper.isEnum()) { + // return `${attribute.getTypeName()}EnumScalarFilters`; + // } + + // if (attribute.typeHelper.isUserScalar()) { + // return `${attribute.getTypeName()}ScalarFilters`; + // } + + throw new Error(`No scalar filter found for attribute ${attribute.type.name}`); +} diff --git a/packages/graphql/tests/schema/aggregations.test.ts b/packages/graphql/tests/schema/aggregations.test.ts index 30096e663d..b23e70a5d6 100644 --- a/packages/graphql/tests/schema/aggregations.test.ts +++ b/packages/graphql/tests/schema/aggregations.test.ts @@ -596,6 +596,14 @@ describe("Aggregations", () => { sum: BigInt } + \\"\\"\\"Filters for an aggregation of an BigInt field\\"\\"\\" + input BigIntScalarAggregationFilters { + average: BigIntScalarFilters + max: BigIntScalarFilters + min: BigIntScalarFilters + sum: BigIntScalarFilters + } + \\"\\"\\"BigInt filters\\"\\"\\" input BigIntScalarFilters { eq: BigInt @@ -639,6 +647,12 @@ describe("Aggregations", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -670,6 +684,13 @@ describe("Aggregations", () => { min: Duration } + \\"\\"\\"Filters for an aggregation of a Dutation input field\\"\\"\\" + input DurationScalarAggregationFilters { + average: DurationScalarFilters + max: DurationScalarFilters + min: DurationScalarFilters + } + \\"\\"\\"Duration filters\\"\\"\\" input DurationScalarFilters { eq: Duration @@ -692,6 +713,14 @@ describe("Aggregations", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -716,6 +745,12 @@ describe("Aggregations", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -742,6 +777,14 @@ describe("Aggregations", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -780,6 +823,7 @@ describe("Aggregations", () => { AND: [LikesAggregationWhereInput!] NOT: LikesAggregationWhereInput OR: [LikesAggregationWhereInput!] + someBigInt: BigIntScalarAggregationFilters someBigInt_AVERAGE_EQUAL: BigInt someBigInt_AVERAGE_GT: BigInt someBigInt_AVERAGE_GTE: BigInt @@ -800,6 +844,7 @@ describe("Aggregations", () => { someBigInt_SUM_GTE: BigInt someBigInt_SUM_LT: BigInt someBigInt_SUM_LTE: BigInt + someDateTime: DateTimeScalarAggregationFilters someDateTime_MAX_EQUAL: DateTime someDateTime_MAX_GT: DateTime someDateTime_MAX_GTE: DateTime @@ -810,6 +855,7 @@ describe("Aggregations", () => { someDateTime_MIN_GTE: DateTime someDateTime_MIN_LT: DateTime someDateTime_MIN_LTE: DateTime + someDuration: DurationScalarAggregationFilters someDuration_AVERAGE_EQUAL: Duration someDuration_AVERAGE_GT: Duration someDuration_AVERAGE_GTE: Duration @@ -825,6 +871,7 @@ describe("Aggregations", () => { someDuration_MIN_GTE: Duration someDuration_MIN_LT: Duration someDuration_MIN_LTE: Duration + someFloat: FloatScalarAggregationFilters someFloat_AVERAGE_EQUAL: Float someFloat_AVERAGE_GT: Float someFloat_AVERAGE_GTE: Float @@ -845,6 +892,7 @@ describe("Aggregations", () => { someFloat_SUM_GTE: Float someFloat_SUM_LT: Float someFloat_SUM_LTE: Float + someId: IDScalarAggregationFilters someId_MAX_EQUAL: ID someId_MAX_GT: ID someId_MAX_GTE: ID @@ -855,6 +903,7 @@ describe("Aggregations", () => { someId_MIN_GTE: ID someId_MIN_LT: ID someId_MIN_LTE: ID + someInt: IntScalarAggregationFilters someInt_AVERAGE_EQUAL: Float someInt_AVERAGE_GT: Float someInt_AVERAGE_GTE: Float @@ -875,6 +924,7 @@ describe("Aggregations", () => { someInt_SUM_GTE: Int someInt_SUM_LT: Int someInt_SUM_LTE: Int + someLocalDateTime: LocalDateTimeScalarAggregationFilters someLocalDateTime_MAX_EQUAL: LocalDateTime someLocalDateTime_MAX_GT: LocalDateTime someLocalDateTime_MAX_GTE: LocalDateTime @@ -885,6 +935,7 @@ describe("Aggregations", () => { someLocalDateTime_MIN_GTE: LocalDateTime someLocalDateTime_MIN_LT: LocalDateTime someLocalDateTime_MIN_LTE: LocalDateTime + someLocalTime: LocalTimeScalarAggregationFilters someLocalTime_MAX_EQUAL: LocalTime someLocalTime_MAX_GT: LocalTime someLocalTime_MAX_GTE: LocalTime @@ -895,6 +946,7 @@ describe("Aggregations", () => { someLocalTime_MIN_GTE: LocalTime someLocalTime_MIN_LT: LocalTime someLocalTime_MIN_LTE: LocalTime + someString: StringScalarAggregationFilters someString_AVERAGE_LENGTH_EQUAL: Float someString_AVERAGE_LENGTH_GT: Float someString_AVERAGE_LENGTH_GTE: Float @@ -910,6 +962,7 @@ describe("Aggregations", () => { someString_SHORTEST_LENGTH_GTE: Int someString_SHORTEST_LENGTH_LT: Int someString_SHORTEST_LENGTH_LTE: Int + someTime: TimeScalarAggregationFilters someTime_MAX_EQUAL: Time someTime_MAX_GT: Time someTime_MAX_GTE: Time @@ -1061,6 +1114,12 @@ describe("Aggregations", () => { min: LocalDateTime } + \\"\\"\\"Filters for an aggregation of an LocalDateTime input field\\"\\"\\" + input LocalDateTimeScalarAggregationFilters { + max: LocalDateTimeScalarFilters + min: LocalDateTimeScalarFilters + } + \\"\\"\\"LocalDateTime filters\\"\\"\\" input LocalDateTimeScalarFilters { eq: LocalDateTime @@ -1086,6 +1145,12 @@ describe("Aggregations", () => { min: LocalTime } + \\"\\"\\"Filters for an aggregation of an LocalTime input field\\"\\"\\" + input LocalTimeScalarAggregationFilters { + max: LocalTimeScalarFilters + min: LocalTimeScalarFilters + } + \\"\\"\\"LocalTime filters\\"\\"\\" input LocalTimeScalarFilters { eq: LocalTime @@ -1203,6 +1268,7 @@ describe("Aggregations", () => { AND: [PostLikesNodeAggregationWhereInput!] NOT: PostLikesNodeAggregationWhereInput OR: [PostLikesNodeAggregationWhereInput!] + someBigInt: BigIntScalarAggregationFilters someBigInt_AVERAGE_EQUAL: BigInt someBigInt_AVERAGE_GT: BigInt someBigInt_AVERAGE_GTE: BigInt @@ -1223,6 +1289,7 @@ describe("Aggregations", () => { someBigInt_SUM_GTE: BigInt someBigInt_SUM_LT: BigInt someBigInt_SUM_LTE: BigInt + someDateTime: DateTimeScalarAggregationFilters someDateTime_MAX_EQUAL: DateTime someDateTime_MAX_GT: DateTime someDateTime_MAX_GTE: DateTime @@ -1233,6 +1300,7 @@ describe("Aggregations", () => { someDateTime_MIN_GTE: DateTime someDateTime_MIN_LT: DateTime someDateTime_MIN_LTE: DateTime + someDuration: DurationScalarAggregationFilters someDuration_AVERAGE_EQUAL: Duration someDuration_AVERAGE_GT: Duration someDuration_AVERAGE_GTE: Duration @@ -1248,6 +1316,7 @@ describe("Aggregations", () => { someDuration_MIN_GTE: Duration someDuration_MIN_LT: Duration someDuration_MIN_LTE: Duration + someFloat: FloatScalarAggregationFilters someFloat_AVERAGE_EQUAL: Float someFloat_AVERAGE_GT: Float someFloat_AVERAGE_GTE: Float @@ -1268,6 +1337,7 @@ describe("Aggregations", () => { someFloat_SUM_GTE: Float someFloat_SUM_LT: Float someFloat_SUM_LTE: Float + someId: IDScalarAggregationFilters someId_MAX_EQUAL: ID someId_MAX_GT: ID someId_MAX_GTE: ID @@ -1278,6 +1348,7 @@ describe("Aggregations", () => { someId_MIN_GTE: ID someId_MIN_LT: ID someId_MIN_LTE: ID + someInt: IntScalarAggregationFilters someInt_AVERAGE_EQUAL: Float someInt_AVERAGE_GT: Float someInt_AVERAGE_GTE: Float @@ -1298,6 +1369,7 @@ describe("Aggregations", () => { someInt_SUM_GTE: Int someInt_SUM_LT: Int someInt_SUM_LTE: Int + someLocalDateTime: LocalDateTimeScalarAggregationFilters someLocalDateTime_MAX_EQUAL: LocalDateTime someLocalDateTime_MAX_GT: LocalDateTime someLocalDateTime_MAX_GTE: LocalDateTime @@ -1308,6 +1380,7 @@ describe("Aggregations", () => { someLocalDateTime_MIN_GTE: LocalDateTime someLocalDateTime_MIN_LT: LocalDateTime someLocalDateTime_MIN_LTE: LocalDateTime + someLocalTime: LocalTimeScalarAggregationFilters someLocalTime_MAX_EQUAL: LocalTime someLocalTime_MAX_GT: LocalTime someLocalTime_MAX_GTE: LocalTime @@ -1318,6 +1391,7 @@ describe("Aggregations", () => { someLocalTime_MIN_GTE: LocalTime someLocalTime_MIN_LT: LocalTime someLocalTime_MIN_LTE: LocalTime + someString: StringScalarAggregationFilters someString_AVERAGE_LENGTH_EQUAL: Float someString_AVERAGE_LENGTH_GT: Float someString_AVERAGE_LENGTH_GTE: Float @@ -1333,6 +1407,7 @@ describe("Aggregations", () => { someString_SHORTEST_LENGTH_GTE: Int someString_SHORTEST_LENGTH_LT: Int someString_SHORTEST_LENGTH_LTE: Int + someTime: TimeScalarAggregationFilters someTime_MAX_EQUAL: Time someTime_MAX_GT: Time someTime_MAX_GTE: Time @@ -1475,6 +1550,13 @@ describe("Aggregations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1502,6 +1584,12 @@ describe("Aggregations", () => { min: Time } + \\"\\"\\"Filters for an aggregation of an Time input field\\"\\"\\" + input TimeScalarAggregationFilters { + max: TimeScalarFilters + min: TimeScalarFilters + } + \\"\\"\\"Time filters\\"\\"\\" input TimeScalarFilters { eq: Time diff --git a/packages/graphql/tests/schema/array-methods.test.ts b/packages/graphql/tests/schema/array-methods.test.ts index 3c7fd1d9ce..b042e5aa54 100644 --- a/packages/graphql/tests/schema/array-methods.test.ts +++ b/packages/graphql/tests/schema/array-methods.test.ts @@ -151,6 +151,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -171,6 +172,7 @@ describe("Arrays Methods", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -339,6 +341,14 @@ describe("Arrays Methods", () => { includes: FloatScalarFilters } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -363,6 +373,12 @@ describe("Arrays Methods", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -382,6 +398,16 @@ describe("Arrays Methods", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Float\\"\\"\\" input ListFloatMutations { pop: Int @@ -468,6 +494,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -655,6 +682,13 @@ describe("Arrays Methods", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/authorization.test.ts b/packages/graphql/tests/schema/authorization.test.ts index a9bcc690e7..6dfeabf2e9 100644 --- a/packages/graphql/tests/schema/authorization.test.ts +++ b/packages/graphql/tests/schema/authorization.test.ts @@ -73,11 +73,27 @@ describe("Authorization", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -97,6 +113,16 @@ describe("Authorization", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! @@ -185,6 +211,7 @@ describe("Authorization", () => { AND: [PostAuthorNodeAggregationWhereInput!] NOT: PostAuthorNodeAggregationWhereInput OR: [PostAuthorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -195,6 +222,7 @@ describe("Authorization", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -342,6 +370,13 @@ describe("Authorization", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -479,6 +514,7 @@ describe("Authorization", () => { AND: [UserPostsNodeAggregationWhereInput!] NOT: UserPostsNodeAggregationWhereInput OR: [UserPostsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -489,6 +525,7 @@ describe("Authorization", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float diff --git a/packages/graphql/tests/schema/comments.test.ts b/packages/graphql/tests/schema/comments.test.ts index 2ea4b771db..6e69781627 100644 --- a/packages/graphql/tests/schema/comments.test.ts +++ b/packages/graphql/tests/schema/comments.test.ts @@ -458,6 +458,16 @@ describe("Comments", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -482,6 +492,16 @@ describe("Comments", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { \\"\\"\\"Actors in Movie\\"\\"\\" actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! @@ -553,6 +573,7 @@ describe("Comments", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -702,6 +723,13 @@ describe("Comments", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -790,6 +818,7 @@ describe("Comments", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -907,6 +936,7 @@ describe("Comments", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1064,6 +1094,16 @@ describe("Comments", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -1071,6 +1111,14 @@ describe("Comments", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1321,6 +1369,13 @@ describe("Comments", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/connections/enums.test.ts b/packages/graphql/tests/schema/connections/enums.test.ts index cfbc0dc38d..9dad0061c8 100644 --- a/packages/graphql/tests/schema/connections/enums.test.ts +++ b/packages/graphql/tests/schema/connections/enums.test.ts @@ -192,6 +192,7 @@ describe("Enums", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -311,6 +312,26 @@ describe("Enums", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -388,6 +409,7 @@ describe("Enums", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -567,6 +589,13 @@ describe("Enums", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/connections/interfaces.test.ts b/packages/graphql/tests/schema/connections/interfaces.test.ts index 921c432369..f2737a421e 100644 --- a/packages/graphql/tests/schema/connections/interfaces.test.ts +++ b/packages/graphql/tests/schema/connections/interfaces.test.ts @@ -177,6 +177,7 @@ describe("Connection with interfaces", () => { AND: [CreatureMoviesNodeAggregationWhereInput!] NOT: CreatureMoviesNodeAggregationWhereInput OR: [CreatureMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -285,6 +286,12 @@ describe("Connection with interfaces", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -401,6 +408,7 @@ describe("Connection with interfaces", () => { AND: [MovieDirectorNodeAggregationWhereInput!] NOT: MovieDirectorNodeAggregationWhereInput OR: [MovieDirectorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -588,6 +596,7 @@ describe("Connection with interfaces", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -752,6 +761,7 @@ describe("Connection with interfaces", () => { AND: [ProductionDirectorNodeAggregationWhereInput!] NOT: ProductionDirectorNodeAggregationWhereInput OR: [ProductionDirectorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -961,6 +971,7 @@ describe("Connection with interfaces", () => { AND: [SeriesDirectorNodeAggregationWhereInput!] NOT: SeriesDirectorNodeAggregationWhereInput OR: [SeriesDirectorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID diff --git a/packages/graphql/tests/schema/connections/sort.test.ts b/packages/graphql/tests/schema/connections/sort.test.ts index fd90695ccd..753fbeaeaa 100644 --- a/packages/graphql/tests/schema/connections/sort.test.ts +++ b/packages/graphql/tests/schema/connections/sort.test.ts @@ -69,6 +69,26 @@ describe("Sort", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createNode1s(input: [Node1CreateInput!]!): CreateNode1sMutationResponse! createNode2s(input: [Node2CreateInput!]!): CreateNode2sMutationResponse! @@ -343,6 +363,7 @@ describe("Sort", () => { AND: [Node2RelatedToNodeAggregationWhereInput!] NOT: Node2RelatedToNodeAggregationWhereInput OR: [Node2RelatedToNodeAggregationWhereInput!] + property: StringScalarAggregationFilters property_AVERAGE_LENGTH_EQUAL: Float property_AVERAGE_LENGTH_GT: Float property_AVERAGE_LENGTH_GTE: Float @@ -449,6 +470,13 @@ describe("Sort", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/connections/unions.test.ts b/packages/graphql/tests/schema/connections/unions.test.ts index b4f94edd69..98f5329ae2 100644 --- a/packages/graphql/tests/schema/connections/unions.test.ts +++ b/packages/graphql/tests/schema/connections/unions.test.ts @@ -381,6 +381,7 @@ describe("Unions", () => { AND: [BookAuthorNodeAggregationWhereInput!] NOT: BookAuthorNodeAggregationWhereInput OR: [BookAuthorNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -531,6 +532,16 @@ describe("Unions", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -538,6 +549,14 @@ describe("Unions", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -643,6 +662,7 @@ describe("Unions", () => { AND: [JournalAuthorNodeAggregationWhereInput!] NOT: JournalAuthorNodeAggregationWhereInput OR: [JournalAuthorNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -815,6 +835,13 @@ describe("Unions", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -873,6 +900,7 @@ describe("Unions", () => { AND: [WroteAggregationWhereInput!] NOT: WroteAggregationWhereInput OR: [WroteAggregationWhereInput!] + words: IntScalarAggregationFilters words_AVERAGE_EQUAL: Float words_AVERAGE_GT: Float words_AVERAGE_GTE: Float diff --git a/packages/graphql/tests/schema/directive-preserve.test.ts b/packages/graphql/tests/schema/directive-preserve.test.ts index 3537f6fc7e..ceb6d2c11e 100644 --- a/packages/graphql/tests/schema/directive-preserve.test.ts +++ b/packages/graphql/tests/schema/directive-preserve.test.ts @@ -240,6 +240,14 @@ describe("Directive-preserve", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -365,6 +373,7 @@ describe("Directive-preserve", () => { AND: [GenreMoviesNodeAggregationWhereInput!] NOT: GenreMoviesNodeAggregationWhereInput OR: [GenreMoviesNodeAggregationWhereInput!] + imdbRating: FloatScalarAggregationFilters imdbRating_AVERAGE_EQUAL: Float imdbRating_AVERAGE_GT: Float imdbRating_AVERAGE_GTE: Float @@ -385,6 +394,7 @@ describe("Directive-preserve", () => { imdbRating_SUM_GTE: Float imdbRating_SUM_LT: Float imdbRating_SUM_LTE: Float + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -400,6 +410,7 @@ describe("Directive-preserve", () => { title_SHORTEST_LENGTH_GTE: Int title_SHORTEST_LENGTH_LT: Int title_SHORTEST_LENGTH_LTE: Int + year: IntScalarAggregationFilters year_AVERAGE_EQUAL: Float year_AVERAGE_GT: Float year_AVERAGE_GTE: Float @@ -503,6 +514,14 @@ describe("Directive-preserve", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -630,6 +649,7 @@ describe("Directive-preserve", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -786,6 +806,13 @@ describe("Directive-preserve", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -889,6 +916,7 @@ describe("Directive-preserve", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + role: StringScalarAggregationFilters role_AVERAGE_LENGTH_EQUAL: Float role_AVERAGE_LENGTH_GT: Float role_AVERAGE_LENGTH_GTE: Float @@ -1000,6 +1028,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1169,6 +1198,16 @@ describe("Directive-preserve", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -1248,6 +1287,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1496,6 +1536,7 @@ describe("Directive-preserve", () => { AND: [ProductionActorsNodeAggregationWhereInput!] NOT: ProductionActorsNodeAggregationWhereInput OR: [ProductionActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1698,6 +1739,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1831,6 +1873,13 @@ describe("Directive-preserve", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1940,6 +1989,7 @@ describe("Directive-preserve", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + role: StringScalarAggregationFilters role_AVERAGE_LENGTH_EQUAL: Float role_AVERAGE_LENGTH_GT: Float role_AVERAGE_LENGTH_GTE: Float @@ -2048,6 +2098,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2217,6 +2268,16 @@ describe("Directive-preserve", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -2325,6 +2386,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2630,6 +2692,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2769,6 +2832,13 @@ describe("Directive-preserve", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2866,6 +2936,7 @@ describe("Directive-preserve", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + role: StringScalarAggregationFilters role_AVERAGE_LENGTH_EQUAL: Float role_AVERAGE_LENGTH_GT: Float role_AVERAGE_LENGTH_GTE: Float @@ -2974,6 +3045,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -3143,6 +3215,16 @@ describe("Directive-preserve", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -3251,6 +3333,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3556,6 +3639,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3695,6 +3779,13 @@ describe("Directive-preserve", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3872,6 +3963,7 @@ describe("Directive-preserve", () => { AND: [BlogPostsNodeAggregationWhereInput!] NOT: BlogPostsNodeAggregationWhereInput OR: [BlogPostsNodeAggregationWhereInput!] + content: StringScalarAggregationFilters content_AVERAGE_LENGTH_EQUAL: Float @deprecated(reason: \\"Do not use post.content\\") content_AVERAGE_LENGTH_GT: Float @deprecated(reason: \\"Do not use post.content\\") content_AVERAGE_LENGTH_GTE: Float @deprecated(reason: \\"Do not use post.content\\") @@ -4001,6 +4093,26 @@ describe("Directive-preserve", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createBlogs(input: [BlogCreateInput!]!): CreateBlogsMutationResponse! createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! @@ -4099,6 +4211,13 @@ describe("Directive-preserve", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/alias.test.ts b/packages/graphql/tests/schema/directives/alias.test.ts index 8056443175..f606fecd80 100644 --- a/packages/graphql/tests/schema/directives/alias.test.ts +++ b/packages/graphql/tests/schema/directives/alias.test.ts @@ -117,6 +117,7 @@ describe("Alias", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + rating: FloatScalarAggregationFilters rating_AVERAGE_EQUAL: Float rating_AVERAGE_GT: Float rating_AVERAGE_GTE: Float @@ -137,6 +138,7 @@ describe("Alias", () => { rating_SUM_GTE: Float rating_SUM_LT: Float rating_SUM_LTE: Float + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -167,6 +169,7 @@ describe("Alias", () => { AND: [ActorActedInPropsAggregationWhereInput!] NOT: ActorActedInPropsAggregationWhereInput OR: [ActorActedInPropsAggregationWhereInput!] + character: StringScalarAggregationFilters character_AVERAGE_LENGTH_EQUAL: Float character_AVERAGE_LENGTH_GT: Float character_AVERAGE_LENGTH_GTE: Float @@ -182,6 +185,7 @@ describe("Alias", () => { character_SHORTEST_LENGTH_GTE: Int character_SHORTEST_LENGTH_LT: Int character_SHORTEST_LENGTH_LTE: Int + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -397,6 +401,14 @@ describe("Alias", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -423,6 +435,14 @@ describe("Alias", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -548,6 +568,13 @@ describe("Alias", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/filterable.test.ts b/packages/graphql/tests/schema/directives/filterable.test.ts index 3012b90e6c..1e446a4082 100644 --- a/packages/graphql/tests/schema/directives/filterable.test.ts +++ b/packages/graphql/tests/schema/directives/filterable.test.ts @@ -1154,6 +1154,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -1228,6 +1248,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -1243,6 +1264,7 @@ describe("@filterable directive", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -1439,6 +1461,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1641,6 +1670,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1800,6 +1830,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -1874,6 +1924,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -1889,6 +1940,7 @@ describe("@filterable directive", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -2085,6 +2137,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2287,6 +2346,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2446,6 +2506,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -2520,6 +2600,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -2535,6 +2616,7 @@ describe("@filterable directive", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -2713,6 +2795,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2918,6 +3007,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -3077,6 +3167,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -3313,6 +3423,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3517,6 +3634,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -3676,6 +3794,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -3750,6 +3888,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -3765,6 +3904,7 @@ describe("@filterable directive", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -3961,6 +4101,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -4165,6 +4312,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -4324,6 +4472,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -4398,6 +4566,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -4413,6 +4582,7 @@ describe("@filterable directive", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -4585,6 +4755,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -4789,6 +4966,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -4948,6 +5126,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -5184,6 +5382,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -5381,6 +5586,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -5540,6 +5746,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -5832,6 +6058,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -6029,6 +6262,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -6188,6 +6422,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -6249,6 +6503,7 @@ describe("@filterable directive", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -6514,6 +6769,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -6711,6 +6973,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -6870,6 +7133,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -7162,6 +7445,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -7375,6 +7665,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -7624,6 +7915,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesNodeAggregationWhereInput!] NOT: AppearanceMoviesNodeAggregationWhereInput OR: [AppearanceMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -7788,6 +8080,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, where: PersonWhere): [Person!]! actorsConnection(after: String, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! @@ -8097,6 +8409,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -8318,6 +8637,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -8567,6 +8887,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesNodeAggregationWhereInput!] NOT: AppearanceMoviesNodeAggregationWhereInput OR: [AppearanceMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -8731,6 +9052,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, where: PersonWhere): [Person!]! actorsConnection(after: String, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! @@ -9040,6 +9381,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -9261,6 +9609,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -9510,6 +9859,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesNodeAggregationWhereInput!] NOT: AppearanceMoviesNodeAggregationWhereInput OR: [AppearanceMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -9674,6 +10024,26 @@ describe("@filterable directive", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, where: PersonWhere): [Person!]! actorsConnection(after: String, first: Int, where: MovieActorsConnectionWhere): MovieActorsConnection! @@ -9983,6 +10353,13 @@ describe("@filterable directive", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/populatedBy.test.ts b/packages/graphql/tests/schema/directives/populatedBy.test.ts index 55af53f758..d219ed5436 100644 --- a/packages/graphql/tests/schema/directives/populatedBy.test.ts +++ b/packages/graphql/tests/schema/directives/populatedBy.test.ts @@ -791,6 +791,16 @@ describe("@populatedBy tests", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type Genre { id: ID! } @@ -848,6 +858,12 @@ describe("@populatedBy tests", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -867,6 +883,16 @@ describe("@populatedBy tests", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { genres(limit: Int, offset: Int, sort: [GenreSort!], where: GenreWhere): [Genre!]! genresAggregate(where: GenreWhere): MovieGenreGenresAggregationSelection @@ -969,6 +995,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1098,6 +1125,7 @@ describe("@populatedBy tests", () => { AND: [RelPropertiesAggregationWhereInput!] NOT: RelPropertiesAggregationWhereInput OR: [RelPropertiesAggregationWhereInput!] + callback1: StringScalarAggregationFilters callback1_AVERAGE_LENGTH_EQUAL: Float callback1_AVERAGE_LENGTH_GT: Float callback1_AVERAGE_LENGTH_GTE: Float @@ -1113,6 +1141,7 @@ describe("@populatedBy tests", () => { callback1_SHORTEST_LENGTH_GTE: Int callback1_SHORTEST_LENGTH_LT: Int callback1_SHORTEST_LENGTH_LTE: Int + callback2: StringScalarAggregationFilters callback2_AVERAGE_LENGTH_EQUAL: Float callback2_AVERAGE_LENGTH_GT: Float callback2_AVERAGE_LENGTH_GTE: Float @@ -1128,6 +1157,7 @@ describe("@populatedBy tests", () => { callback2_SHORTEST_LENGTH_GTE: Int callback2_SHORTEST_LENGTH_LT: Int callback2_SHORTEST_LENGTH_LTE: Int + callback3: StringScalarAggregationFilters callback3_AVERAGE_LENGTH_EQUAL: Float callback3_AVERAGE_LENGTH_GT: Float callback3_AVERAGE_LENGTH_GTE: Float @@ -1143,6 +1173,7 @@ describe("@populatedBy tests", () => { callback3_SHORTEST_LENGTH_GTE: Int callback3_SHORTEST_LENGTH_LT: Int callback3_SHORTEST_LENGTH_LTE: Int + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1217,6 +1248,13 @@ describe("@populatedBy tests", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1328,6 +1366,16 @@ describe("@populatedBy tests", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type Genre { id: ID! } @@ -1385,6 +1433,12 @@ describe("@populatedBy tests", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -1411,6 +1465,14 @@ describe("@populatedBy tests", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1530,6 +1592,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1659,6 +1722,7 @@ describe("@populatedBy tests", () => { AND: [RelPropertiesAggregationWhereInput!] NOT: RelPropertiesAggregationWhereInput OR: [RelPropertiesAggregationWhereInput!] + callback1: IntScalarAggregationFilters callback1_AVERAGE_EQUAL: Float callback1_AVERAGE_GT: Float callback1_AVERAGE_GTE: Float @@ -1679,6 +1743,7 @@ describe("@populatedBy tests", () => { callback1_SUM_GTE: Int callback1_SUM_LT: Int callback1_SUM_LTE: Int + callback2: IntScalarAggregationFilters callback2_AVERAGE_EQUAL: Float callback2_AVERAGE_GT: Float callback2_AVERAGE_GTE: Float @@ -1699,6 +1764,7 @@ describe("@populatedBy tests", () => { callback2_SUM_GTE: Int callback2_SUM_LT: Int callback2_SUM_LTE: Int + callback3: IntScalarAggregationFilters callback3_AVERAGE_EQUAL: Float callback3_AVERAGE_GT: Float callback3_AVERAGE_GTE: Float @@ -1719,6 +1785,7 @@ describe("@populatedBy tests", () => { callback3_SUM_GTE: Int callback3_SUM_LT: Int callback3_SUM_LTE: Int + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID diff --git a/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts b/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts index 97154662b5..d17ba64462 100644 --- a/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts @@ -317,6 +317,26 @@ describe("@relationship directive, aggregate argument", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsConnection(after: String, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @@ -377,6 +397,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -392,6 +413,7 @@ describe("@relationship directive, aggregate argument", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -541,6 +563,13 @@ describe("@relationship directive, aggregate argument", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -694,6 +723,26 @@ describe("@relationship directive, aggregate argument", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -765,6 +814,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -780,6 +830,7 @@ describe("@relationship directive, aggregate argument", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -929,6 +980,13 @@ describe("@relationship directive, aggregate argument", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1084,6 +1142,26 @@ describe("@relationship directive, aggregate argument", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsConnection(after: String, first: Int, sort: [MovieActorsConnectionSort!], where: MovieActorsConnectionWhere): MovieActorsConnection! @@ -1144,6 +1222,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -1159,6 +1238,7 @@ describe("@relationship directive, aggregate argument", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -1379,6 +1459,13 @@ describe("@relationship directive, aggregate argument", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1532,6 +1619,26 @@ describe("@relationship directive, aggregate argument", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -1593,6 +1700,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + password: StringScalarAggregationFilters password_AVERAGE_LENGTH_EQUAL: Float password_AVERAGE_LENGTH_GT: Float password_AVERAGE_LENGTH_GTE: Float @@ -1608,6 +1716,7 @@ describe("@relationship directive, aggregate argument", () => { password_SHORTEST_LENGTH_GTE: Int password_SHORTEST_LENGTH_LT: Int password_SHORTEST_LENGTH_LTE: Int + username: StringScalarAggregationFilters username_AVERAGE_LENGTH_EQUAL: Float username_AVERAGE_LENGTH_GT: Float username_AVERAGE_LENGTH_GTE: Float @@ -1838,6 +1947,13 @@ describe("@relationship directive, aggregate argument", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts b/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts index 96e75ba9f6..c3f13a66cf 100644 --- a/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts @@ -76,6 +76,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -100,6 +110,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -140,6 +160,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -327,6 +348,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -414,6 +442,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -438,6 +476,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -486,6 +534,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -680,6 +729,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -767,6 +823,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -791,6 +857,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -839,6 +915,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1037,6 +1114,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1124,6 +1208,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -1148,6 +1242,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -1188,6 +1292,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1385,6 +1490,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1472,6 +1584,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -1496,6 +1618,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -1540,6 +1672,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1737,6 +1870,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1824,6 +1964,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -1848,6 +1998,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -1892,6 +2052,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2085,6 +2246,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2173,6 +2341,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -2197,6 +2375,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -2237,6 +2425,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2424,6 +2613,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2513,11 +2709,27 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -2537,6 +2749,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -2577,6 +2799,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -2587,6 +2810,7 @@ describe("Relationship nested operations", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2784,6 +3008,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2872,6 +3103,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -2896,6 +3137,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -2960,6 +3211,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3069,6 +3321,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersNodeAggregationWhereInput!] NOT: MovieProducersNodeAggregationWhereInput OR: [MovieProducersNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3269,6 +3522,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3357,6 +3617,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -3381,6 +3651,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -3432,6 +3712,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3529,6 +3810,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersNodeAggregationWhereInput!] NOT: MovieProducersNodeAggregationWhereInput OR: [MovieProducersNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3725,6 +4007,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -8124,6 +8413,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -8154,6 +8453,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -8201,6 +8510,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -8499,6 +8809,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -8605,6 +8922,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -8635,6 +8962,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -8690,6 +9027,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9000,6 +9338,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -9106,6 +9451,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -9136,6 +9491,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -9191,6 +9556,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9500,6 +9866,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -9606,6 +9979,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -9636,6 +10019,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -9683,6 +10076,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9996,6 +10390,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -10102,6 +10503,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -10132,6 +10543,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -10183,6 +10604,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -10491,6 +10913,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -10597,6 +11026,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -10627,6 +11066,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -10678,6 +11127,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -10982,6 +11432,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -11089,6 +11546,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -11119,6 +11586,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -11190,6 +11667,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -11299,6 +11777,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersNodeAggregationWhereInput!] NOT: MovieProducersNodeAggregationWhereInput OR: [MovieProducersNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -11620,6 +12099,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -11728,6 +12214,16 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -11758,6 +12254,16 @@ describe("Relationship nested operations", () => { includes: Int } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Int\\"\\"\\" input ListIntMutations { pop: Int @@ -11820,6 +12326,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -11922,6 +12429,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersNodeAggregationWhereInput!] NOT: MovieProducersNodeAggregationWhereInput OR: [MovieProducersNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -12234,6 +12742,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/relationship-properties.test.ts b/packages/graphql/tests/schema/directives/relationship-properties.test.ts index 153b3eb8d0..a652802fba 100644 --- a/packages/graphql/tests/schema/directives/relationship-properties.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-properties.test.ts @@ -65,6 +65,7 @@ describe("Relationship-properties", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -246,6 +247,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -393,6 +395,16 @@ describe("Relationship-properties", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -400,6 +412,14 @@ describe("Relationship-properties", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -500,6 +520,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -663,6 +684,13 @@ describe("Relationship-properties", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -746,6 +774,7 @@ describe("Relationship-properties", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -756,6 +785,7 @@ describe("Relationship-properties", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -776,6 +806,7 @@ describe("Relationship-properties", () => { screenTime_SUM_GTE: Int screenTime_SUM_LT: Int screenTime_SUM_LTE: Int + timestamp: DateTimeScalarAggregationFilters timestamp_MAX_EQUAL: DateTime timestamp_MAX_GT: DateTime timestamp_MAX_GTE: DateTime @@ -947,6 +978,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1066,6 +1098,12 @@ describe("Relationship-properties", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -1084,11 +1122,27 @@ describe("Relationship-properties", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -1110,6 +1164,14 @@ describe("Relationship-properties", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1212,6 +1274,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1375,6 +1438,13 @@ describe("Relationship-properties", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1456,6 +1526,7 @@ describe("Relationship-properties", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1466,6 +1537,7 @@ describe("Relationship-properties", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + timestamp: DateTimeScalarAggregationFilters timestamp_MAX_EQUAL: DateTime timestamp_MAX_GT: DateTime timestamp_MAX_GTE: DateTime @@ -1615,6 +1687,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1733,6 +1806,12 @@ describe("Relationship-properties", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -1751,11 +1830,27 @@ describe("Relationship-properties", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -1770,6 +1865,16 @@ describe("Relationship-properties", () => { startsWith: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -1852,6 +1957,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2014,6 +2120,13 @@ describe("Relationship-properties", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/relationship.test.ts b/packages/graphql/tests/schema/directives/relationship.test.ts index 93d9231ebf..fbd844eb47 100644 --- a/packages/graphql/tests/schema/directives/relationship.test.ts +++ b/packages/graphql/tests/schema/directives/relationship.test.ts @@ -148,6 +148,7 @@ describe("Relationship", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -260,11 +261,27 @@ describe("Relationship", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -284,6 +301,16 @@ describe("Relationship", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -357,6 +384,7 @@ describe("Relationship", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -518,6 +546,13 @@ describe("Relationship", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/selectable.test.ts b/packages/graphql/tests/schema/directives/selectable.test.ts index 9c47fa9e06..04efe3afd5 100644 --- a/packages/graphql/tests/schema/directives/selectable.test.ts +++ b/packages/graphql/tests/schema/directives/selectable.test.ts @@ -807,6 +807,7 @@ describe("@selectable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -822,6 +823,7 @@ describe("@selectable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -963,6 +965,26 @@ describe("@selectable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { description: String title: String! @@ -1066,6 +1088,13 @@ describe("@selectable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1189,6 +1218,7 @@ describe("@selectable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -1204,6 +1234,7 @@ describe("@selectable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1350,6 +1381,26 @@ describe("@selectable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { description: String title: String! @@ -1453,6 +1504,13 @@ describe("@selectable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2525,6 +2583,7 @@ describe("@selectable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -2540,6 +2599,7 @@ describe("@selectable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2686,6 +2746,26 @@ describe("@selectable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { description: String title: String! @@ -2924,6 +3004,13 @@ describe("@selectable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3062,6 +3149,7 @@ describe("@selectable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -3077,6 +3165,7 @@ describe("@selectable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -3228,6 +3317,26 @@ describe("@selectable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { description: String title: String! @@ -3466,6 +3575,13 @@ describe("@selectable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/directives/settable.test.ts b/packages/graphql/tests/schema/directives/settable.test.ts index fdd66e4455..0fc6c1615f 100644 --- a/packages/graphql/tests/schema/directives/settable.test.ts +++ b/packages/graphql/tests/schema/directives/settable.test.ts @@ -649,6 +649,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -664,6 +665,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -809,6 +811,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { description: String title: String! @@ -912,6 +934,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1032,6 +1061,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -1047,6 +1077,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1179,6 +1210,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { description: String title: String! @@ -1282,6 +1333,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1408,6 +1466,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -1423,6 +1482,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1567,6 +1627,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -1641,6 +1721,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1813,6 +1894,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1934,6 +2022,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -1949,6 +2038,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2106,6 +2196,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -2180,6 +2290,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2352,6 +2463,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3543,6 +3661,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -3617,6 +3755,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3867,6 +4006,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -4174,6 +4320,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -4248,6 +4414,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -4498,6 +4665,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -4634,6 +4808,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -4649,6 +4824,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -4799,6 +4975,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { description: String title: String! @@ -5037,6 +5233,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -5172,6 +5375,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -5187,6 +5391,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -5324,6 +5529,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { description: String title: String! @@ -5555,6 +5780,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -5698,6 +5930,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -5713,6 +5946,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -5862,6 +6096,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -5909,6 +6163,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -6100,6 +6355,7 @@ describe("@settable", () => { AND: [ProductionActorsNodeAggregationWhereInput!] NOT: ProductionActorsNodeAggregationWhereInput OR: [ProductionActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -6279,6 +6535,7 @@ describe("@settable", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -6408,6 +6665,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -6546,6 +6810,7 @@ describe("@settable", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + description: StringScalarAggregationFilters description_AVERAGE_LENGTH_EQUAL: Float description_AVERAGE_LENGTH_GT: Float description_AVERAGE_LENGTH_GTE: Float @@ -6561,6 +6826,7 @@ describe("@settable", () => { description_SHORTEST_LENGTH_GTE: Int description_SHORTEST_LENGTH_LT: Int description_SHORTEST_LENGTH_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -6723,6 +6989,26 @@ describe("@settable", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements Production { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -6770,6 +7056,7 @@ describe("@settable", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -6965,6 +7252,7 @@ describe("@settable", () => { AND: [ProductionActorsNodeAggregationWhereInput!] NOT: ProductionActorsNodeAggregationWhereInput OR: [ProductionActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -7165,6 +7453,7 @@ describe("@settable", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -7294,6 +7583,13 @@ describe("@settable", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/federation.test.ts b/packages/graphql/tests/schema/federation.test.ts index 67a7953974..bfdc4b56d3 100644 --- a/packages/graphql/tests/schema/federation.test.ts +++ b/packages/graphql/tests/schema/federation.test.ts @@ -95,6 +95,26 @@ describe("Apollo Federation", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! @shareable @@ -181,6 +201,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorNodeAggregationWhereInput!] NOT: PostAuthorNodeAggregationWhereInput OR: [PostAuthorNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -330,6 +351,13 @@ describe("Apollo Federation", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -473,6 +501,7 @@ describe("Apollo Federation", () => { AND: [UserPostsNodeAggregationWhereInput!] NOT: UserPostsNodeAggregationWhereInput OR: [UserPostsNodeAggregationWhereInput!] + content: StringScalarAggregationFilters content_AVERAGE_LENGTH_EQUAL: Float content_AVERAGE_LENGTH_GT: Float content_AVERAGE_LENGTH_GTE: Float @@ -658,6 +687,26 @@ describe("Apollo Federation", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! @@ -741,6 +790,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorNodeAggregationWhereInput!] NOT: PostAuthorNodeAggregationWhereInput OR: [PostAuthorNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -879,6 +929,13 @@ describe("Apollo Federation", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/inheritance.test.ts b/packages/graphql/tests/schema/inheritance.test.ts index cff94f2caa..8fefcf613b 100644 --- a/packages/graphql/tests/schema/inheritance.test.ts +++ b/packages/graphql/tests/schema/inheritance.test.ts @@ -127,6 +127,7 @@ describe("inheritance", () => { AND: [ActorFriendsNodeAggregationWhereInput!] NOT: ActorFriendsNodeAggregationWhereInput OR: [ActorFriendsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -249,6 +250,16 @@ describe("inheritance", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + \\"\\"\\" The edge properties for the following fields: * Actor.friends @@ -261,6 +272,7 @@ describe("inheritance", () => { AND: [FriendsWithAggregationWhereInput!] NOT: FriendsWithAggregationWhereInput OR: [FriendsWithAggregationWhereInput!] + since: IntScalarAggregationFilters since_AVERAGE_EQUAL: Float since_AVERAGE_GT: Float since_AVERAGE_GTE: Float @@ -318,6 +330,14 @@ describe("inheritance", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -488,6 +508,7 @@ describe("inheritance", () => { AND: [PersonFriendsNodeAggregationWhereInput!] NOT: PersonFriendsNodeAggregationWhereInput OR: [PersonFriendsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -604,6 +625,13 @@ describe("inheritance", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/interface-relationships.test.ts b/packages/graphql/tests/schema/interface-relationships.test.ts index 9301a788f6..0d59c9fa34 100644 --- a/packages/graphql/tests/schema/interface-relationships.test.ts +++ b/packages/graphql/tests/schema/interface-relationships.test.ts @@ -69,6 +69,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -185,6 +186,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -342,6 +344,16 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -349,6 +361,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -599,6 +619,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -702,6 +729,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -821,6 +849,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1090,6 +1119,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesNodeAggregationWhereInput!] NOT: EpisodeSeriesNodeAggregationWhereInput OR: [EpisodeSeriesNodeAggregationWhereInput!] + episodeCount: IntScalarAggregationFilters episodeCount_AVERAGE_EQUAL: Float episodeCount_AVERAGE_GT: Float episodeCount_AVERAGE_GTE: Float @@ -1110,6 +1140,7 @@ describe("Interface Relationships", () => { episodeCount_SUM_GTE: Int episodeCount_SUM_LT: Int episodeCount_SUM_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1214,6 +1245,16 @@ describe("Interface Relationships", () => { totalCount: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -1221,6 +1262,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1293,6 +1342,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1544,6 +1594,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsNodeAggregationWhereInput!] NOT: ProductionActorsNodeAggregationWhereInput OR: [ProductionActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1752,6 +1803,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1892,6 +1944,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesNodeAggregationWhereInput!] NOT: SeriesEpisodesNodeAggregationWhereInput OR: [SeriesEpisodesNodeAggregationWhereInput!] + runtime: IntScalarAggregationFilters runtime_AVERAGE_EQUAL: Float runtime_AVERAGE_GT: Float runtime_AVERAGE_GTE: Float @@ -2033,6 +2086,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -2144,6 +2204,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -2263,6 +2324,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2532,6 +2594,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesNodeAggregationWhereInput!] NOT: EpisodeSeriesNodeAggregationWhereInput OR: [EpisodeSeriesNodeAggregationWhereInput!] + episodeCount: IntScalarAggregationFilters episodeCount_AVERAGE_EQUAL: Float episodeCount_AVERAGE_GT: Float episodeCount_AVERAGE_GTE: Float @@ -2552,6 +2615,7 @@ describe("Interface Relationships", () => { episodeCount_SUM_GTE: Int episodeCount_SUM_LT: Int episodeCount_SUM_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2656,6 +2720,16 @@ describe("Interface Relationships", () => { totalCount: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -2663,6 +2737,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -2735,6 +2817,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3006,6 +3089,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsNodeAggregationWhereInput!] NOT: ProductionActorsNodeAggregationWhereInput OR: [ProductionActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3214,6 +3298,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3354,6 +3439,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesNodeAggregationWhereInput!] NOT: SeriesEpisodesNodeAggregationWhereInput OR: [SeriesEpisodesNodeAggregationWhereInput!] + runtime: IntScalarAggregationFilters runtime_AVERAGE_EQUAL: Float runtime_AVERAGE_GT: Float runtime_AVERAGE_GTE: Float @@ -3502,6 +3588,7 @@ describe("Interface Relationships", () => { AND: [StarredInAggregationWhereInput!] NOT: StarredInAggregationWhereInput OR: [StarredInAggregationWhereInput!] + seasons: IntScalarAggregationFilters seasons_AVERAGE_EQUAL: Float seasons_AVERAGE_GT: Float seasons_AVERAGE_GTE: Float @@ -3557,6 +3644,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3693,6 +3787,26 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + interface Interface1 { field1: String! interface2(limit: Int, offset: Int, sort: [Interface2Sort!], where: Interface2Where): [Interface2!]! @@ -3784,6 +3898,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2NodeAggregationWhereInput!] NOT: Interface1Interface2NodeAggregationWhereInput OR: [Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -4006,6 +4121,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -4185,6 +4307,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2NodeAggregationWhereInput!] NOT: Type1Interface1Interface2NodeAggregationWhereInput OR: [Type1Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -4219,6 +4342,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1NodeAggregationWhereInput!] NOT: Type1Interface1NodeAggregationWhereInput OR: [Type1Interface1NodeAggregationWhereInput!] + field1: StringScalarAggregationFilters field1_AVERAGE_LENGTH_EQUAL: Float field1_AVERAGE_LENGTH_GT: Float field1_AVERAGE_LENGTH_GTE: Float @@ -4494,6 +4618,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2NodeAggregationWhereInput!] NOT: Type2Interface1Interface2NodeAggregationWhereInput OR: [Type2Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -4767,6 +4892,16 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -4774,6 +4909,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -4932,6 +5075,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2NodeAggregationWhereInput!] NOT: Interface1Interface2NodeAggregationWhereInput OR: [Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -5134,6 +5278,7 @@ describe("Interface Relationships", () => { AND: [PropsAggregationWhereInput!] NOT: PropsAggregationWhereInput OR: [PropsAggregationWhereInput!] + propsField: IntScalarAggregationFilters propsField_AVERAGE_EQUAL: Float propsField_AVERAGE_GT: Float propsField_AVERAGE_GTE: Float @@ -5221,6 +5366,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -5408,6 +5560,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2NodeAggregationWhereInput!] NOT: Type1Interface1Interface2NodeAggregationWhereInput OR: [Type1Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -5443,6 +5596,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1NodeAggregationWhereInput!] NOT: Type1Interface1NodeAggregationWhereInput OR: [Type1Interface1NodeAggregationWhereInput!] + field1: StringScalarAggregationFilters field1_AVERAGE_LENGTH_EQUAL: Float field1_AVERAGE_LENGTH_GT: Float field1_AVERAGE_LENGTH_GTE: Float @@ -5726,6 +5880,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2NodeAggregationWhereInput!] NOT: Type2Interface1Interface2NodeAggregationWhereInput OR: [Type2Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -6006,6 +6161,16 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -6013,6 +6178,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -6191,6 +6364,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2NodeAggregationWhereInput!] NOT: Interface1Interface2NodeAggregationWhereInput OR: [Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -6417,6 +6591,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -6604,6 +6785,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2NodeAggregationWhereInput!] NOT: Type1Interface1Interface2NodeAggregationWhereInput OR: [Type1Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -6639,6 +6821,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1NodeAggregationWhereInput!] NOT: Type1Interface1NodeAggregationWhereInput OR: [Type1Interface1NodeAggregationWhereInput!] + field1: StringScalarAggregationFilters field1_AVERAGE_LENGTH_EQUAL: Float field1_AVERAGE_LENGTH_GT: Float field1_AVERAGE_LENGTH_GTE: Float @@ -6798,6 +6981,7 @@ describe("Interface Relationships", () => { AND: [Type1PropsAggregationWhereInput!] NOT: Type1PropsAggregationWhereInput OR: [Type1PropsAggregationWhereInput!] + type1Field: IntScalarAggregationFilters type1Field_AVERAGE_EQUAL: Float type1Field_AVERAGE_GT: Float type1Field_AVERAGE_GTE: Float @@ -6984,6 +7168,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2NodeAggregationWhereInput!] NOT: Type2Interface1Interface2NodeAggregationWhereInput OR: [Type2Interface1Interface2NodeAggregationWhereInput!] + field2: StringScalarAggregationFilters field2_AVERAGE_LENGTH_EQUAL: Float field2_AVERAGE_LENGTH_GT: Float field2_AVERAGE_LENGTH_GTE: Float @@ -7139,6 +7324,7 @@ describe("Interface Relationships", () => { AND: [Type2PropsAggregationWhereInput!] NOT: Type2PropsAggregationWhereInput OR: [Type2PropsAggregationWhereInput!] + type2Field: IntScalarAggregationFilters type2Field_AVERAGE_EQUAL: Float type2Field_AVERAGE_GT: Float type2Field_AVERAGE_GTE: Float @@ -7332,6 +7518,7 @@ describe("Interface Relationships", () => { AND: [CommentCreatorNodeAggregationWhereInput!] NOT: CommentCreatorNodeAggregationWhereInput OR: [CommentCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -7342,6 +7529,7 @@ describe("Interface Relationships", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -7444,6 +7632,7 @@ describe("Interface Relationships", () => { AND: [CommentPostNodeAggregationWhereInput!] NOT: CommentPostNodeAggregationWhereInput OR: [CommentPostNodeAggregationWhereInput!] + content: StringScalarAggregationFilters content_AVERAGE_LENGTH_EQUAL: Float content_AVERAGE_LENGTH_GT: Float content_AVERAGE_LENGTH_GTE: Float @@ -7459,6 +7648,7 @@ describe("Interface Relationships", () => { content_SHORTEST_LENGTH_GTE: Int content_SHORTEST_LENGTH_LT: Int content_SHORTEST_LENGTH_LTE: Int + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -7678,6 +7868,7 @@ describe("Interface Relationships", () => { AND: [ContentCreatorNodeAggregationWhereInput!] NOT: ContentCreatorNodeAggregationWhereInput OR: [ContentCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -7688,6 +7879,7 @@ describe("Interface Relationships", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -7838,11 +8030,27 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -7862,6 +8070,16 @@ describe("Interface Relationships", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createComments(input: [CommentCreateInput!]!): CreateCommentsMutationResponse! createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! @@ -7966,6 +8184,7 @@ describe("Interface Relationships", () => { AND: [PostCommentsNodeAggregationWhereInput!] NOT: PostCommentsNodeAggregationWhereInput OR: [PostCommentsNodeAggregationWhereInput!] + content: StringScalarAggregationFilters content_AVERAGE_LENGTH_EQUAL: Float content_AVERAGE_LENGTH_GT: Float content_AVERAGE_LENGTH_GTE: Float @@ -7981,6 +8200,7 @@ describe("Interface Relationships", () => { content_SHORTEST_LENGTH_GTE: Int content_SHORTEST_LENGTH_LT: Int content_SHORTEST_LENGTH_LTE: Int + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -8057,6 +8277,7 @@ describe("Interface Relationships", () => { AND: [PostCreatorNodeAggregationWhereInput!] NOT: PostCreatorNodeAggregationWhereInput OR: [PostCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -8067,6 +8288,7 @@ describe("Interface Relationships", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -8241,6 +8463,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -8374,6 +8603,7 @@ describe("Interface Relationships", () => { AND: [UserContentNodeAggregationWhereInput!] NOT: UserContentNodeAggregationWhereInput OR: [UserContentNodeAggregationWhereInput!] + content: StringScalarAggregationFilters content_AVERAGE_LENGTH_EQUAL: Float content_AVERAGE_LENGTH_GT: Float content_AVERAGE_LENGTH_GTE: Float @@ -8389,6 +8619,7 @@ describe("Interface Relationships", () => { content_SHORTEST_LENGTH_GTE: Int content_SHORTEST_LENGTH_LT: Int content_SHORTEST_LENGTH_LTE: Int + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -8565,6 +8796,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -8684,6 +8916,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -8853,6 +9086,16 @@ describe("Interface Relationships", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -8860,6 +9103,14 @@ describe("Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -8932,6 +9183,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9191,6 +9443,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9439,6 +9692,7 @@ describe("Interface Relationships", () => { AND: [ShowActorsNodeAggregationWhereInput!] NOT: ShowActorsNodeAggregationWhereInput OR: [ShowActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -9591,6 +9845,7 @@ describe("Interface Relationships", () => { AND: [StarredInAggregationWhereInput!] NOT: StarredInAggregationWhereInput OR: [StarredInAggregationWhereInput!] + episodeNr: IntScalarAggregationFilters episodeNr_AVERAGE_EQUAL: Float episodeNr_AVERAGE_GT: Float episodeNr_AVERAGE_GTE: Float @@ -9646,6 +9901,13 @@ describe("Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/interfaces.test.ts b/packages/graphql/tests/schema/interfaces.test.ts index e0a98da336..43b4577fab 100644 --- a/packages/graphql/tests/schema/interfaces.test.ts +++ b/packages/graphql/tests/schema/interfaces.test.ts @@ -80,6 +80,12 @@ describe("Interfaces", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -178,6 +184,7 @@ describe("Interfaces", () => { AND: [MovieMoviesNodeAggregationWhereInput!] NOT: MovieMoviesNodeAggregationWhereInput OR: [MovieMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -267,6 +274,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesNodeAggregationWhereInput!] NOT: MovieNodeMoviesNodeAggregationWhereInput OR: [MovieNodeMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -503,6 +511,12 @@ describe("Interfaces", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -601,6 +615,7 @@ describe("Interfaces", () => { AND: [MovieMoviesNodeAggregationWhereInput!] NOT: MovieMoviesNodeAggregationWhereInput OR: [MovieMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -690,6 +705,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesNodeAggregationWhereInput!] NOT: MovieNodeMoviesNodeAggregationWhereInput OR: [MovieNodeMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID diff --git a/packages/graphql/tests/schema/issues/1182.test.ts b/packages/graphql/tests/schema/issues/1182.test.ts index bcb8fc7085..ab0b3418c2 100644 --- a/packages/graphql/tests/schema/issues/1182.test.ts +++ b/packages/graphql/tests/schema/issues/1182.test.ts @@ -160,6 +160,12 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -183,11 +189,27 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -202,6 +224,16 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { startsWith: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -275,6 +307,7 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + dob: DateTimeScalarAggregationFilters dob_MAX_EQUAL: DateTime dob_MAX_GT: DateTime dob_MAX_GTE: DateTime @@ -285,6 +318,7 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { dob_MIN_GTE: DateTime dob_MIN_LT: DateTime dob_MIN_LTE: DateTime + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -295,6 +329,7 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -499,6 +534,13 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/1614.test.ts b/packages/graphql/tests/schema/issues/1614.test.ts index ee3c32134d..8bd7d64b57 100644 --- a/packages/graphql/tests/schema/issues/1614.test.ts +++ b/packages/graphql/tests/schema/issues/1614.test.ts @@ -161,6 +161,7 @@ describe("https://github.com/neo4j/graphql/issues/1614", () => { AND: [CrewMemberMoviesNodeAggregationWhereInput!] NOT: CrewMemberMoviesNodeAggregationWhereInput OR: [CrewMemberMoviesNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -294,6 +295,26 @@ describe("https://github.com/neo4j/graphql/issues/1614", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { name: String! } @@ -385,6 +406,13 @@ describe("https://github.com/neo4j/graphql/issues/1614", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/162.test.ts b/packages/graphql/tests/schema/issues/162.test.ts index ff7c13ed65..4c00378f7d 100644 --- a/packages/graphql/tests/schema/issues/162.test.ts +++ b/packages/graphql/tests/schema/issues/162.test.ts @@ -79,11 +79,27 @@ describe("162", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -110,6 +126,14 @@ describe("162", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -310,6 +334,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1NodeAggregationWhereInput!] NOT: TigerJawLevel2Part1NodeAggregationWhereInput OR: [TigerJawLevel2Part1NodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -388,6 +413,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1TigerNodeAggregationWhereInput!] NOT: TigerJawLevel2Part1TigerNodeAggregationWhereInput OR: [TigerJawLevel2Part1TigerNodeAggregationWhereInput!] + x: IntScalarAggregationFilters x_AVERAGE_EQUAL: Float x_AVERAGE_GT: Float x_AVERAGE_GTE: Float diff --git a/packages/graphql/tests/schema/issues/2187.test.ts b/packages/graphql/tests/schema/issues/2187.test.ts index bb7b84cb25..b5e82e8459 100644 --- a/packages/graphql/tests/schema/issues/2187.test.ts +++ b/packages/graphql/tests/schema/issues/2187.test.ts @@ -81,6 +81,14 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -206,6 +214,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { AND: [GenreMoviesNodeAggregationWhereInput!] NOT: GenreMoviesNodeAggregationWhereInput OR: [GenreMoviesNodeAggregationWhereInput!] + imdbRating: FloatScalarAggregationFilters imdbRating_AVERAGE_EQUAL: Float imdbRating_AVERAGE_GT: Float imdbRating_AVERAGE_GTE: Float @@ -226,6 +235,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { imdbRating_SUM_GTE: Float imdbRating_SUM_LT: Float imdbRating_SUM_LTE: Float + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float @deprecated(reason: \\"Do not use title\\") title_AVERAGE_LENGTH_GT: Float @deprecated(reason: \\"Do not use title\\") title_AVERAGE_LENGTH_GTE: Float @deprecated(reason: \\"Do not use title\\") @@ -241,6 +251,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { title_SHORTEST_LENGTH_GTE: Int @deprecated(reason: \\"Do not use title\\") title_SHORTEST_LENGTH_LT: Int @deprecated(reason: \\"Do not use title\\") title_SHORTEST_LENGTH_LTE: Int @deprecated(reason: \\"Do not use title\\") + year: IntScalarAggregationFilters year_AVERAGE_EQUAL: Float year_AVERAGE_GT: Float year_AVERAGE_GTE: Float @@ -344,6 +355,14 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -471,6 +490,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -627,6 +647,13 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/2377.test.ts b/packages/graphql/tests/schema/issues/2377.test.ts index 488f38cfa8..be3b758554 100644 --- a/packages/graphql/tests/schema/issues/2377.test.ts +++ b/packages/graphql/tests/schema/issues/2377.test.ts @@ -105,6 +105,12 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -128,6 +134,16 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -139,6 +155,12 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { includes: IDScalarFilters } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -158,6 +180,16 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for ID\\"\\"\\" input ListIDMutations { pop: Int @@ -298,6 +330,7 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { AND: [ResourceContainedByNodeAggregationWhereInput!] NOT: ResourceContainedByNodeAggregationWhereInput OR: [ResourceContainedByNodeAggregationWhereInput!] + createdAt: DateTimeScalarAggregationFilters createdAt_MAX_EQUAL: DateTime createdAt_MAX_GT: DateTime createdAt_MAX_GTE: DateTime @@ -308,6 +341,7 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { createdAt_MIN_GTE: DateTime createdAt_MIN_LT: DateTime createdAt_MIN_LTE: DateTime + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -318,6 +352,7 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -333,6 +368,7 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { name_SHORTEST_LENGTH_GTE: Int name_SHORTEST_LENGTH_LT: Int name_SHORTEST_LENGTH_LTE: Int + updatedAt: DateTimeScalarAggregationFilters updatedAt_MAX_EQUAL: DateTime updatedAt_MAX_GT: DateTime updatedAt_MAX_GTE: DateTime @@ -603,6 +639,13 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/2993.test.ts b/packages/graphql/tests/schema/issues/2993.test.ts index 72a9d681c6..cd6adc1ddb 100644 --- a/packages/graphql/tests/schema/issues/2993.test.ts +++ b/packages/graphql/tests/schema/issues/2993.test.ts @@ -71,6 +71,12 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -106,6 +112,7 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { AND: [FOLLOWSAggregationWhereInput!] NOT: FOLLOWSAggregationWhereInput OR: [FOLLOWSAggregationWhereInput!] + since: DateTimeScalarAggregationFilters since_MAX_EQUAL: DateTime since_MAX_GT: DateTime since_MAX_GTE: DateTime @@ -140,11 +147,27 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { since_LTE: DateTime } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -164,6 +187,16 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! deleteUsers(delete: UserDeleteInput, where: UserWhere): DeleteInfo! @@ -268,6 +301,13 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -387,6 +427,7 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { AND: [UserFollowingNodeAggregationWhereInput!] NOT: UserFollowingNodeAggregationWhereInput OR: [UserFollowingNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -397,6 +438,7 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + userName: StringScalarAggregationFilters userName_AVERAGE_LENGTH_EQUAL: Float userName_AVERAGE_LENGTH_GT: Float userName_AVERAGE_LENGTH_GTE: Float diff --git a/packages/graphql/tests/schema/issues/3428.test.ts b/packages/graphql/tests/schema/issues/3428.test.ts index 39b19db7b1..b566a3e33d 100644 --- a/packages/graphql/tests/schema/issues/3428.test.ts +++ b/packages/graphql/tests/schema/issues/3428.test.ts @@ -70,11 +70,27 @@ describe("Relationship nested operations", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -94,6 +110,16 @@ describe("Relationship nested operations", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [PersonSort!], where: PersonWhere): [Person!]! actorsAggregate(where: PersonWhere): MoviePersonActorsAggregationSelection @@ -134,6 +160,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -144,6 +171,7 @@ describe("Relationship nested operations", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -341,6 +369,13 @@ describe("Relationship nested operations", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/3541.test.ts b/packages/graphql/tests/schema/issues/3541.test.ts index a005be8222..4ec10d15bf 100644 --- a/packages/graphql/tests/schema/issues/3541.test.ts +++ b/packages/graphql/tests/schema/issues/3541.test.ts @@ -104,6 +104,26 @@ describe("Extending the schema in when using getSubgraphSchema", () => { totalCount: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie @key(fields: \\"title\\") @shareable { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -153,6 +173,7 @@ describe("Extending the schema in when using getSubgraphSchema", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -267,6 +288,13 @@ describe("Extending the schema in when using getSubgraphSchema", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -428,6 +456,16 @@ describe("Extending the schema in when using getSubgraphSchema", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -447,6 +485,16 @@ describe("Extending the schema in when using getSubgraphSchema", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie @key(fields: \\"title\\") @key(fields: \\"id\\") @shareable { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -518,6 +566,7 @@ describe("Extending the schema in when using getSubgraphSchema", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -652,6 +701,13 @@ describe("Extending the schema in when using getSubgraphSchema", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/3698.test.ts b/packages/graphql/tests/schema/issues/3698.test.ts index e9234d602d..3a83f83240 100644 --- a/packages/graphql/tests/schema/issues/3698.test.ts +++ b/packages/graphql/tests/schema/issues/3698.test.ts @@ -105,6 +105,16 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { UPDATE } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type Genre { name: String! product(limit: Int, offset: Int, sort: [IProductSort!], where: IProductWhere): [IProduct!]! @@ -224,6 +234,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { AND: [GenreProductNodeAggregationWhereInput!] NOT: GenreProductNodeAggregationWhereInput OR: [GenreProductNodeAggregationWhereInput!] + id: StringScalarAggregationFilters id_AVERAGE_LENGTH_EQUAL: Float id_AVERAGE_LENGTH_GT: Float id_AVERAGE_LENGTH_GTE: Float @@ -239,6 +250,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { id_SHORTEST_LENGTH_GTE: Int id_SHORTEST_LENGTH_LT: Int id_SHORTEST_LENGTH_LTE: Int + info: StringScalarAggregationFilters info_AVERAGE_LENGTH_EQUAL: Float info_AVERAGE_LENGTH_GT: Float info_AVERAGE_LENGTH_GTE: Float @@ -254,6 +266,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { info_SHORTEST_LENGTH_GTE: Int info_SHORTEST_LENGTH_LT: Int info_SHORTEST_LENGTH_LTE: Int + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -444,6 +457,16 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { totalCount: Int! } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements IProduct { genre(limit: Int, offset: Int, sort: [GenreSort!], where: GenreWhere): [Genre!]! genreAggregate(where: GenreWhere): MovieGenreGenreAggregationSelection @@ -557,6 +580,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { AND: [MovieGenreNodeAggregationWhereInput!] NOT: MovieGenreNodeAggregationWhereInput OR: [MovieGenreNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -724,6 +748,13 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/3817.test.ts b/packages/graphql/tests/schema/issues/3817.test.ts index d1f1787959..6cfd05acd1 100644 --- a/packages/graphql/tests/schema/issues/3817.test.ts +++ b/packages/graphql/tests/schema/issues/3817.test.ts @@ -82,6 +82,16 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + \\"\\"\\" The edge properties for the following fields: * Person.friends @@ -94,6 +104,7 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { AND: [FriendOfAggregationWhereInput!] NOT: FriendOfAggregationWhereInput OR: [FriendOfAggregationWhereInput!] + id: StringScalarAggregationFilters id_AVERAGE_LENGTH_EQUAL: Float id_AVERAGE_LENGTH_GT: Float id_AVERAGE_LENGTH_GTE: Float @@ -137,6 +148,12 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -151,6 +168,16 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { startsWith: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createPeople(input: [PersonCreateInput!]!): CreatePeopleMutationResponse! deletePeople(delete: PersonDeleteInput, where: PersonWhere): DeleteInfo! @@ -268,6 +295,7 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { AND: [PersonFriendsNodeAggregationWhereInput!] NOT: PersonFriendsNodeAggregationWhereInput OR: [PersonFriendsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -381,6 +409,13 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/4511.test.ts b/packages/graphql/tests/schema/issues/4511.test.ts index 64a1c96bf4..0f1e3dde57 100644 --- a/packages/graphql/tests/schema/issues/4511.test.ts +++ b/packages/graphql/tests/schema/issues/4511.test.ts @@ -177,6 +177,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [CreatureMoviesNodeAggregationWhereInput!] NOT: CreatureMoviesNodeAggregationWhereInput OR: [CreatureMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -278,6 +279,12 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -566,6 +573,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID diff --git a/packages/graphql/tests/schema/issues/4615.test.ts b/packages/graphql/tests/schema/issues/4615.test.ts index 50bda02eda..385f13c4a0 100644 --- a/packages/graphql/tests/schema/issues/4615.test.ts +++ b/packages/graphql/tests/schema/issues/4615.test.ts @@ -77,6 +77,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -196,6 +197,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -388,6 +390,16 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -395,6 +407,14 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -468,6 +488,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -690,6 +711,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [SeriesActorsNodeAggregationWhereInput!] NOT: SeriesActorsNodeAggregationWhereInput OR: [SeriesActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -918,6 +940,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [ShowActorsNodeAggregationWhereInput!] NOT: ShowActorsNodeAggregationWhereInput OR: [ShowActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1063,6 +1086,13 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/issues/872.test.ts b/packages/graphql/tests/schema/issues/872.test.ts index 0549bcf2e5..d8e37df2e3 100644 --- a/packages/graphql/tests/schema/issues/872.test.ts +++ b/packages/graphql/tests/schema/issues/872.test.ts @@ -146,6 +146,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { AND: [Actor2MoviesNodeAggregationWhereInput!] NOT: Actor2MoviesNodeAggregationWhereInput OR: [Actor2MoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -156,6 +157,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -330,6 +332,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -340,6 +343,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -462,11 +466,27 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -481,6 +501,16 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { startsWith: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { id: ID! title: String! @@ -587,6 +617,13 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/lowercase-type-names.test.ts b/packages/graphql/tests/schema/lowercase-type-names.test.ts index b10091385c..0e13e2f788 100644 --- a/packages/graphql/tests/schema/lowercase-type-names.test.ts +++ b/packages/graphql/tests/schema/lowercase-type-names.test.ts @@ -82,6 +82,12 @@ describe("lower case type names", () => { min: DateTime } + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + \\"\\"\\"DateTime filters\\"\\"\\" input DateTimeScalarFilters { eq: DateTime @@ -105,6 +111,16 @@ describe("lower case type names", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -112,6 +128,14 @@ describe("lower case type names", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -174,6 +198,13 @@ describe("lower case type names", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -314,6 +345,7 @@ describe("lower case type names", () => { AND: [actorMoviesNodeAggregationWhereInput!] NOT: actorMoviesNodeAggregationWhereInput OR: [actorMoviesNodeAggregationWhereInput!] + createdAt: DateTimeScalarAggregationFilters createdAt_MAX_EQUAL: DateTime createdAt_MAX_GT: DateTime createdAt_MAX_GTE: DateTime @@ -324,6 +356,7 @@ describe("lower case type names", () => { createdAt_MIN_GTE: DateTime createdAt_MIN_LT: DateTime createdAt_MIN_LTE: DateTime + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -339,6 +372,7 @@ describe("lower case type names", () => { name_SHORTEST_LENGTH_GTE: Int name_SHORTEST_LENGTH_LT: Int name_SHORTEST_LENGTH_LTE: Int + testId: StringScalarAggregationFilters testId_AVERAGE_LENGTH_EQUAL: Float testId_AVERAGE_LENGTH_GT: Float testId_AVERAGE_LENGTH_GTE: Float @@ -354,6 +388,7 @@ describe("lower case type names", () => { testId_SHORTEST_LENGTH_GTE: Int testId_SHORTEST_LENGTH_LT: Int testId_SHORTEST_LENGTH_LTE: Int + year: IntScalarAggregationFilters year_AVERAGE_EQUAL: Float year_AVERAGE_GT: Float year_AVERAGE_GTE: Float @@ -545,6 +580,7 @@ describe("lower case type names", () => { AND: [movieActorsNodeAggregationWhereInput!] NOT: movieActorsNodeAggregationWhereInput OR: [movieActorsNodeAggregationWhereInput!] + createdAt: DateTimeScalarAggregationFilters createdAt_MAX_EQUAL: DateTime createdAt_MAX_GT: DateTime createdAt_MAX_GTE: DateTime @@ -555,6 +591,7 @@ describe("lower case type names", () => { createdAt_MIN_GTE: DateTime createdAt_MIN_LT: DateTime createdAt_MIN_LTE: DateTime + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -570,6 +607,7 @@ describe("lower case type names", () => { name_SHORTEST_LENGTH_GTE: Int name_SHORTEST_LENGTH_LT: Int name_SHORTEST_LENGTH_LTE: Int + year: IntScalarAggregationFilters year_AVERAGE_EQUAL: Float year_AVERAGE_GT: Float year_AVERAGE_GTE: Float diff --git a/packages/graphql/tests/schema/math.test.ts b/packages/graphql/tests/schema/math.test.ts index 8a6a1038e7..5066764693 100644 --- a/packages/graphql/tests/schema/math.test.ts +++ b/packages/graphql/tests/schema/math.test.ts @@ -742,6 +742,7 @@ describe("Algebraic", () => { AND: [DirectorDirectsNodeAggregationWhereInput!] NOT: DirectorDirectsNodeAggregationWhereInput OR: [DirectorDirectsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -752,6 +753,7 @@ describe("Algebraic", () => { id_MIN_GTE: ID id_MIN_LT: ID id_MIN_LTE: ID + viewers: IntScalarAggregationFilters viewers_AVERAGE_EQUAL: Float viewers_AVERAGE_GT: Float viewers_AVERAGE_GTE: Float @@ -867,11 +869,27 @@ describe("Algebraic", () => { totalCount: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -898,6 +916,14 @@ describe("Algebraic", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1004,6 +1030,7 @@ describe("Algebraic", () => { AND: [MovieDirectedByNodeAggregationWhereInput!] NOT: MovieDirectedByNodeAggregationWhereInput OR: [MovieDirectedByNodeAggregationWhereInput!] + lastName: StringScalarAggregationFilters lastName_AVERAGE_LENGTH_EQUAL: Float lastName_AVERAGE_LENGTH_GT: Float lastName_AVERAGE_LENGTH_GTE: Float @@ -1164,6 +1191,13 @@ describe("Algebraic", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1256,6 +1290,16 @@ describe("Algebraic", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -1287,6 +1331,14 @@ describe("Algebraic", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1461,6 +1513,7 @@ describe("Algebraic", () => { AND: [MovieWorkersNodeAggregationWhereInput!] NOT: MovieWorkersNodeAggregationWhereInput OR: [MovieWorkersNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1676,6 +1729,7 @@ describe("Algebraic", () => { AND: [PersonWorksInProductionNodeAggregationWhereInput!] NOT: PersonWorksInProductionNodeAggregationWhereInput OR: [PersonWorksInProductionNodeAggregationWhereInput!] + viewers: IntScalarAggregationFilters viewers_AVERAGE_EQUAL: Float viewers_AVERAGE_GT: Float viewers_AVERAGE_GTE: Float @@ -1801,6 +1855,13 @@ describe("Algebraic", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -1882,6 +1943,7 @@ describe("Algebraic", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + pay: FloatScalarAggregationFilters pay_AVERAGE_EQUAL: Float pay_AVERAGE_GT: Float pay_AVERAGE_GTE: Float @@ -1976,6 +2038,14 @@ describe("Algebraic", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -1995,6 +2065,16 @@ describe("Algebraic", () => { subtract: Float } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for String\\"\\"\\" input ListStringMutations { pop: Int @@ -2071,6 +2151,7 @@ describe("Algebraic", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -2301,6 +2382,7 @@ describe("Algebraic", () => { AND: [PersonActedInMoviesNodeAggregationWhereInput!] NOT: PersonActedInMoviesNodeAggregationWhereInput OR: [PersonActedInMoviesNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -2461,6 +2543,13 @@ describe("Algebraic", () => { includes: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts b/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts index 1f36695389..bcc564503e 100644 --- a/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts +++ b/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts @@ -42,6 +42,7 @@ describe("nested aggregation on interface", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -158,6 +159,7 @@ describe("nested aggregation on interface", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + cost: FloatScalarAggregationFilters cost_AVERAGE_EQUAL: Float cost_AVERAGE_GT: Float cost_AVERAGE_GTE: Float @@ -178,6 +180,7 @@ describe("nested aggregation on interface", () => { cost_SUM_GTE: Float cost_SUM_LT: Float cost_SUM_LTE: Float + runtime: IntScalarAggregationFilters runtime_AVERAGE_EQUAL: Float runtime_AVERAGE_GT: Float runtime_AVERAGE_GTE: Float @@ -198,6 +201,7 @@ describe("nested aggregation on interface", () => { runtime_SUM_GTE: Int runtime_SUM_LT: Int runtime_SUM_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -359,6 +363,14 @@ describe("nested aggregation on interface", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -385,6 +397,14 @@ describe("nested aggregation on interface", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -525,6 +545,13 @@ describe("nested aggregation on interface", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/pluralize-consistency.test.ts b/packages/graphql/tests/schema/pluralize-consistency.test.ts index e61725084f..3e7e74d8d6 100644 --- a/packages/graphql/tests/schema/pluralize-consistency.test.ts +++ b/packages/graphql/tests/schema/pluralize-consistency.test.ts @@ -69,6 +69,26 @@ describe("Pluralize consistency", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createSuperFriends(input: [super_friendCreateInput!]!): CreateSuperFriendsMutationResponse! createSuperUsers(input: [super_userCreateInput!]!): CreateSuperUsersMutationResponse! @@ -108,6 +128,13 @@ describe("Pluralize consistency", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -285,6 +312,7 @@ describe("Pluralize consistency", () => { AND: [super_userMy_friendNodeAggregationWhereInput!] NOT: super_userMy_friendNodeAggregationWhereInput OR: [super_userMy_friendNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float diff --git a/packages/graphql/tests/schema/query-direction.test.ts b/packages/graphql/tests/schema/query-direction.test.ts index 86f9b14976..b4f81bbdfd 100644 --- a/packages/graphql/tests/schema/query-direction.test.ts +++ b/packages/graphql/tests/schema/query-direction.test.ts @@ -60,6 +60,26 @@ describe("Query Direction", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! deleteUsers(delete: UserDeleteInput, where: UserWhere): DeleteInfo! @@ -93,6 +113,13 @@ describe("Query Direction", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -222,6 +249,7 @@ describe("Query Direction", () => { AND: [UserFriendsNodeAggregationWhereInput!] NOT: UserFriendsNodeAggregationWhereInput OR: [UserFriendsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -361,6 +389,26 @@ describe("Query Direction", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Mutation { createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! deleteUsers(delete: UserDeleteInput, where: UserWhere): DeleteInfo! @@ -394,6 +442,13 @@ describe("Query Direction", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -523,6 +578,7 @@ describe("Query Direction", () => { AND: [UserFriendsNodeAggregationWhereInput!] NOT: UserFriendsNodeAggregationWhereInput OR: [UserFriendsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float diff --git a/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts b/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts index 0532f1462e..cf4c45bf86 100644 --- a/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts +++ b/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts @@ -153,6 +153,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -173,6 +174,7 @@ describe("Arrays Methods", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -341,6 +343,14 @@ describe("Arrays Methods", () => { includes: FloatScalarFilters } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -365,6 +375,12 @@ describe("Arrays Methods", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -384,6 +400,16 @@ describe("Arrays Methods", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + \\"\\"\\"Mutations for a list for Float\\"\\"\\" input ListFloatMutations { pop: Int @@ -470,6 +496,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -657,6 +684,13 @@ describe("Arrays Methods", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/remove-deprecated/comments.test.ts b/packages/graphql/tests/schema/remove-deprecated/comments.test.ts index 32269d8e72..fc47ee2b0a 100644 --- a/packages/graphql/tests/schema/remove-deprecated/comments.test.ts +++ b/packages/graphql/tests/schema/remove-deprecated/comments.test.ts @@ -462,6 +462,16 @@ describe("Comments", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IDAggregateSelection { longest: ID shortest: ID @@ -486,6 +496,16 @@ describe("Comments", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { \\"\\"\\"Actors in Movie\\"\\"\\" actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! @@ -557,6 +577,7 @@ describe("Comments", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -706,6 +727,13 @@ describe("Comments", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -796,6 +824,7 @@ describe("Comments", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -913,6 +942,7 @@ describe("Comments", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1070,6 +1100,16 @@ describe("Comments", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type IntAggregateSelection { average: Float max: Int @@ -1077,6 +1117,14 @@ describe("Comments", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1327,6 +1375,13 @@ describe("Comments", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/string-comparators.test.ts b/packages/graphql/tests/schema/string-comparators.test.ts index 164184c005..393bb1f8d1 100644 --- a/packages/graphql/tests/schema/string-comparators.test.ts +++ b/packages/graphql/tests/schema/string-comparators.test.ts @@ -564,6 +564,7 @@ describe("String Comparators", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: StringScalarAggregationFilters screenTime_AVERAGE_LENGTH_EQUAL: Float screenTime_AVERAGE_LENGTH_GT: Float screenTime_AVERAGE_LENGTH_GTE: Float @@ -679,6 +680,7 @@ describe("String Comparators", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -847,6 +849,26 @@ describe("String Comparators", () => { relationshipsDeleted: Int! } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie { actors(limit: Int, offset: Int, sort: [ActorSort!], where: ActorWhere): [Actor!]! actorsAggregate(where: ActorWhere): MovieActorActorsAggregationSelection @@ -930,6 +952,7 @@ describe("String Comparators", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -1097,6 +1120,13 @@ describe("String Comparators", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String diff --git a/packages/graphql/tests/schema/subscriptions.test.ts b/packages/graphql/tests/schema/subscriptions.test.ts index 54d49279f1..15844e9ebf 100644 --- a/packages/graphql/tests/schema/subscriptions.test.ts +++ b/packages/graphql/tests/schema/subscriptions.test.ts @@ -331,6 +331,7 @@ describe("Subscriptions", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -570,6 +571,13 @@ describe("Subscriptions", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -764,6 +772,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -784,6 +793,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -804,6 +814,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -931,6 +942,14 @@ describe("Subscriptions", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -955,6 +974,12 @@ describe("Subscriptions", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -981,6 +1006,14 @@ describe("Subscriptions", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1419,6 +1452,14 @@ describe("Subscriptions", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -1443,6 +1484,12 @@ describe("Subscriptions", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -1469,6 +1516,14 @@ describe("Subscriptions", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -1939,6 +1994,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -1959,6 +2015,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -1979,6 +2036,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -2183,6 +2241,7 @@ describe("Subscriptions", () => { AND: [StarMoviesNodeAggregationWhereInput!] NOT: StarMoviesNodeAggregationWhereInput OR: [StarMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -2203,6 +2262,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -2223,6 +2283,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -2385,6 +2446,7 @@ describe("Subscriptions", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -2548,6 +2610,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -2568,6 +2631,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -2588,6 +2652,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -2715,6 +2780,14 @@ describe("Subscriptions", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -2739,6 +2812,12 @@ describe("Subscriptions", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -2765,6 +2844,14 @@ describe("Subscriptions", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -3426,6 +3513,7 @@ describe("Subscriptions", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -3611,6 +3699,13 @@ describe("Subscriptions", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String @@ -3757,6 +3852,14 @@ describe("Subscriptions", () => { sum: Float } + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + \\"\\"\\"Float filters\\"\\"\\" input FloatScalarFilters { eq: Float @@ -3781,6 +3884,12 @@ describe("Subscriptions", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID @@ -3807,6 +3916,14 @@ describe("Subscriptions", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -4277,6 +4394,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -4297,6 +4415,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -4317,6 +4436,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -4511,6 +4631,7 @@ describe("Subscriptions", () => { AND: [StarMoviesNodeAggregationWhereInput!] NOT: StarMoviesNodeAggregationWhereInput OR: [StarMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -4531,6 +4652,7 @@ describe("Subscriptions", () => { actorCount_SUM_GTE: Int actorCount_SUM_LT: Int actorCount_SUM_LTE: Int + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -4551,6 +4673,7 @@ describe("Subscriptions", () => { averageRating_SUM_GTE: Float averageRating_SUM_LT: Float averageRating_SUM_LTE: Float + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID diff --git a/packages/graphql/tests/schema/union-interface-relationship.test.ts b/packages/graphql/tests/schema/union-interface-relationship.test.ts index 6415bc692c..68d37d4366 100644 --- a/packages/graphql/tests/schema/union-interface-relationship.test.ts +++ b/packages/graphql/tests/schema/union-interface-relationship.test.ts @@ -93,6 +93,7 @@ describe("Union Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -261,6 +262,7 @@ describe("Union Interface Relationships", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + imdbId: IntScalarAggregationFilters imdbId_AVERAGE_EQUAL: Float imdbId_AVERAGE_GT: Float imdbId_AVERAGE_GTE: Float @@ -281,6 +283,7 @@ describe("Union Interface Relationships", () => { imdbId_SUM_GTE: Int imdbId_SUM_LT: Int imdbId_SUM_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -465,6 +468,16 @@ describe("Union Interface Relationships", () => { Person: PersonWhere } + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + type Influencer implements Reviewer { reputation: Int! reviewerId: Int @@ -550,6 +563,14 @@ describe("Union Interface Relationships", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { eq: Int @@ -657,6 +678,7 @@ describe("Union Interface Relationships", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + id: IntScalarAggregationFilters id_AVERAGE_EQUAL: Float id_AVERAGE_GT: Float id_AVERAGE_GTE: Float @@ -677,6 +699,7 @@ describe("Union Interface Relationships", () => { id_SUM_GTE: Int id_SUM_LT: Int id_SUM_LTE: Int + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -971,6 +994,7 @@ describe("Union Interface Relationships", () => { AND: [MovieReviewersNodeAggregationWhereInput!] NOT: MovieReviewersNodeAggregationWhereInput OR: [MovieReviewersNodeAggregationWhereInput!] + reputation: IntScalarAggregationFilters reputation_AVERAGE_EQUAL: Float reputation_AVERAGE_GT: Float reputation_AVERAGE_GTE: Float @@ -991,6 +1015,7 @@ describe("Union Interface Relationships", () => { reputation_SUM_GTE: Int reputation_SUM_LT: Int reputation_SUM_LTE: Int + reviewerId: IntScalarAggregationFilters reviewerId_AVERAGE_EQUAL: Float reviewerId_AVERAGE_GT: Float reviewerId_AVERAGE_GTE: Float @@ -1305,6 +1330,7 @@ describe("Union Interface Relationships", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + imdbId: IntScalarAggregationFilters imdbId_AVERAGE_EQUAL: Float imdbId_AVERAGE_GT: Float imdbId_AVERAGE_GTE: Float @@ -1325,6 +1351,7 @@ describe("Union Interface Relationships", () => { imdbId_SUM_GTE: Int imdbId_SUM_LT: Int imdbId_SUM_LTE: Int + title: StringScalarAggregationFilters title_AVERAGE_LENGTH_EQUAL: Float title_AVERAGE_LENGTH_GT: Float title_AVERAGE_LENGTH_GTE: Float @@ -1480,6 +1507,7 @@ describe("Union Interface Relationships", () => { AND: [ReviewAggregationWhereInput!] NOT: ReviewAggregationWhereInput OR: [ReviewAggregationWhereInput!] + score: IntScalarAggregationFilters score_AVERAGE_EQUAL: Float score_AVERAGE_GT: Float score_AVERAGE_GTE: Float @@ -1619,6 +1647,13 @@ describe("Union Interface Relationships", () => { shortest: String } + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + \\"\\"\\"String filters\\"\\"\\" input StringScalarFilters { contains: String From 5c7ba22afc8fc0df86a148f31ce61691586f8cf3 Mon Sep 17 00:00:00 2001 From: angrykoala Date: Wed, 11 Dec 2024 16:40:41 +0000 Subject: [PATCH 2/5] Add generic filters for aggregations --- .changeset/silly-toys-sing.md | 13 + .../src/schema/generation/aggregate-types.ts | 3 +- .../queryAST/factory/FilterFactory.ts | 94 +- .../where/AND-OR-operations.int.test.ts | 42 +- .../aggregations/where/count.int.test.ts | 20 +- .../aggregations/where/edge/int.int.test.ts | 12 +- .../where/edge/string.int.test.ts | 194 ++- .../where/node/int-connections.int.test.ts | 24 +- .../aggregations/where/node/int.int.test.ts | 24 +- .../where/node/string-connections.int.test.ts | 30 +- .../where/node/string.int.test.ts | 30 +- .../where/AND-OR-operations.int.test.ts | 456 +++++++ .../aggregations/where/count.int.test.ts | 497 ++++++++ .../aggregations/where/edge/int.int.test.ts | 294 +++++ .../where/edge/string.int.test.ts | 940 ++++++++++++++ .../where/node/int-connections.int.test.ts | 634 ++++++++++ .../aggregations/where/node/int.int.test.ts | 594 +++++++++ .../where/node/string-connections.int.test.ts | 1122 +++++++++++++++++ .../where/node/string.int.test.ts | 1044 +++++++++++++++ .../graphql/tests/schema/aggregations.test.ts | 1 + .../tests/schema/array-methods.test.ts | 2 + .../tests/schema/authorization.test.ts | 2 + .../graphql/tests/schema/comments.test.ts | 2 + .../tests/schema/connections/enums.test.ts | 2 + .../schema/connections/interfaces.test.ts | 5 + .../tests/schema/connections/sort.test.ts | 2 + .../tests/schema/connections/unions.test.ts | 2 + .../tests/schema/directive-preserve.test.ts | 13 + .../tests/schema/directives/alias.test.ts | 1 + .../schema/directives/filterable.test.ts | 22 + .../schema/directives/populatedBy.test.ts | 2 + .../directives/relationship-aggregate.test.ts | 4 + .../relationship-nested-operations.test.ts | 22 + .../relationship-properties.test.ts | 6 + .../schema/directives/relationship.test.ts | 2 + .../schema/directives/selectable.test.ts | 4 + .../tests/schema/directives/settable.test.ts | 18 + .../graphql/tests/schema/federation.test.ts | 3 + .../graphql/tests/schema/inheritance.test.ts | 2 + .../schema/interface-relationships.test.ts | 35 + .../graphql/tests/schema/interfaces.test.ts | 24 + .../graphql/tests/schema/issues/1182.test.ts | 1 + .../graphql/tests/schema/issues/1614.test.ts | 1 + .../graphql/tests/schema/issues/162.test.ts | 2 + .../graphql/tests/schema/issues/2187.test.ts | 2 + .../graphql/tests/schema/issues/2377.test.ts | 1 + .../graphql/tests/schema/issues/2993.test.ts | 1 + .../graphql/tests/schema/issues/3428.test.ts | 1 + .../graphql/tests/schema/issues/3541.test.ts | 2 + .../graphql/tests/schema/issues/3698.test.ts | 2 + .../graphql/tests/schema/issues/3817.test.ts | 1 + .../graphql/tests/schema/issues/4511.test.ts | 5 + .../graphql/tests/schema/issues/4615.test.ts | 4 + .../graphql/tests/schema/issues/872.test.ts | 2 + .../tests/schema/lowercase-type-names.test.ts | 2 + packages/graphql/tests/schema/math.test.ts | 6 + .../schema/nested-aggregation-on-type.test.ts | 1 + .../schema/pluralize-consistency.test.ts | 1 + .../tests/schema/query-direction.test.ts | 2 + .../remove-deprecated/array-methods.test.ts | 2 + .../schema/remove-deprecated/comments.test.ts | 2 + .../tests/schema/string-comparators.test.ts | 2 + .../tests/schema/subscriptions.test.ts | 10 + .../union-interface-relationship.test.ts | 4 + 64 files changed, 6104 insertions(+), 196 deletions(-) create mode 100644 .changeset/silly-toys-sing.md create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/AND-OR-operations.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/count.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/edge/int.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/edge/string.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/node/int-connections.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/node/int.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/node/string-connections.int.test.ts create mode 100644 packages/graphql/tests/integration/deprecations/aggregations/where/node/string.int.test.ts diff --git a/.changeset/silly-toys-sing.md b/.changeset/silly-toys-sing.md new file mode 100644 index 0000000000..8babb36fc9 --- /dev/null +++ b/.changeset/silly-toys-sing.md @@ -0,0 +1,13 @@ +--- +"@neo4j/graphql": patch +--- + +Add generic filters for aggregations: + +```graphql +{ + posts(where: { likesAggregate: { node: { rating: { average: { eq: 3.2 } } } } }) { + title + } +} +``` diff --git a/packages/graphql/src/schema/generation/aggregate-types.ts b/packages/graphql/src/schema/generation/aggregate-types.ts index a14891b954..1c77f09c2b 100644 --- a/packages/graphql/src/schema/generation/aggregate-types.ts +++ b/packages/graphql/src/schema/generation/aggregate-types.ts @@ -26,6 +26,7 @@ import type { SchemaComposer, } from "graphql-compose"; import { AGGREGATION_COMPARISON_OPERATORS, DEPRECATED } from "../../constants"; +import { IntScalarFilters } from "../../graphql/input-objects/generic-operators/IntScalarFilters"; import type { AttributeAdapter } from "../../schema-model/attribute/model-adapters/AttributeAdapter"; import { ConcreteEntityAdapter } from "../../schema-model/entity/model-adapters/ConcreteEntityAdapter"; import { InterfaceEntityAdapter } from "../../schema-model/entity/model-adapters/InterfaceEntityAdapter"; @@ -107,7 +108,7 @@ export function withAggregateInputType({ count_LTE: GraphQLInt, count_GT: GraphQLInt, count_GTE: GraphQLInt, - // count: IntScalarFilters, + count: IntScalarFilters, }, }); diff --git a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts index 19e2532b11..fc49248de2 100644 --- a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts +++ b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts @@ -51,6 +51,7 @@ import { isInterfaceEntity } from "../utils/is-interface-entity"; import { isRelationshipEntity } from "../utils/is-relationship-entity"; import { isUnionEntity } from "../utils/is-union-entity"; import type { QueryASTFactory } from "./QueryASTFactory"; +import type { AggregationLogicalOperator, AggregationOperator } from "./parsers/parse-where-field"; import { parseAggregationWhereFields, parseConnectionWhereFields, parseWhereField } from "./parsers/parse-where-field"; type AggregateWhereInput = { @@ -622,6 +623,29 @@ export class FilterFactory { throw new Error(`Invalid operator ${key}`); } } + private parseGenericOperatorForAggregation(key: string): AggregationLogicalOperator { + // we convert them to the previous format to keep the same translation logic + switch (key) { + case "equals": + case "eq": + return "EQUAL"; + case "lessThan": // TODO: remove long syntax once tests have been updated + case "lt": + return "LT"; + case "lessThanEquals": + case "lte": + return "LTE"; + case "greaterThan": + case "gt": + return "GT"; + case "greaterThanEquals": + case "gte": + return "GTE"; + + default: + throw new Error(`Invalid operator ${key}`); + } + } private createRelatedNodeFilters({ relationship, @@ -759,10 +783,21 @@ export class FilterFactory { } const { fieldName, operator, isNot } = parseWhereField(key); - const filterOperator = operator ?? "EQ"; if (fieldName === "count") { + if (!operator) { + return Object.entries(value).map(([key, value]) => { + const operator = this.parseGenericOperator(key); + + return new CountFilter({ + operator: operator, + isNot, + comparisonValue: value, + }); + }); + } + const countFilter = new CountFilter({ - operator: filterOperator, + operator: operator ?? "EQ", isNot, comparisonValue: value, }); @@ -801,7 +836,7 @@ export class FilterFactory { entity: ConcreteEntityAdapter | RelationshipAdapter | InterfaceEntityAdapter, relationship?: RelationshipAdapter ): Array { - const filters = Object.entries(where).map(([key, value]) => { + const filters = Object.entries(where).flatMap(([key, value]) => { if (isLogicalOperator(key)) { const filters = asArray(value).flatMap((nestedWhere) => { return this.createAggregationNodeFilters(nestedWhere, entity, relationship); @@ -819,6 +854,36 @@ export class FilterFactory { const attachedTo = entity instanceof RelationshipAdapter ? "relationship" : "node"; + if (!aggregationOperator) { + const filters = Object.entries(value).flatMap(([aggregationOperator, value]) => { + const parsedAggregationOperation = this.parsedGenericAggregationOperator(aggregationOperator); + + // NOTE: this part is duplicate of the code used for non-generic operators + return Object.entries(value as Record).map(([operator, value]) => { + const parsedOperator = this.parseGenericOperatorForAggregation(operator); + if (attr.typeHelper.isDuration()) { + return new AggregationDurationFilter({ + attribute: attr, + comparisonValue: value, + logicalOperator: parsedOperator || "EQUAL", + aggregationOperator: parsedAggregationOperation, + attachedTo, + }); + } + + return new AggregationPropertyFilter({ + attribute: attr, + relationship, + comparisonValue: value, + logicalOperator: parsedOperator || "EQUAL", + aggregationOperator: parsedAggregationOperation, + attachedTo, + }); + }); + }); + return this.wrapMultipleFiltersInLogical(filters); + } + if (attr.typeHelper.isDuration()) { return new AggregationDurationFilter({ attribute: attr, @@ -906,4 +971,27 @@ export class FilterFactory { } return targetPoint; } + + private parsedGenericAggregationOperator(key: string): AggregationOperator { + // we convert them to the previous format to keep the same translation logic + switch (key) { + case "averageLength": + case "average": + return "AVERAGE"; + case "shortestLength": + case "shortest": + return "SHORTEST"; + case "longestLength": + case "longest": + return "LONGEST"; + case "min": + return "MIN"; + case "max": + return "MAX"; + case "sum": + return "SUM"; + default: + throw new Error(`Invalid aggregation operator ${key}`); + } + } } diff --git a/packages/graphql/tests/integration/aggregations/where/AND-OR-operations.int.test.ts b/packages/graphql/tests/integration/aggregations/where/AND-OR-operations.int.test.ts index d74146234d..4925f4df03 100644 --- a/packages/graphql/tests/integration/aggregations/where/AND-OR-operations.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/AND-OR-operations.int.test.ts @@ -79,9 +79,9 @@ describe("Nested within AND/OR", () => { query { ${postType.plural}(where: { likesAggregate: { - count_EQ: 3 + count: { eq: 3 } node: { - testString_SHORTEST_LENGTH_EQUAL: 3 + testString: { shortestLength: { eq: 3 } } } } }) { @@ -108,10 +108,10 @@ describe("Nested within AND/OR", () => { ${postType.plural}(where: { likesAggregate: { OR: [ - { count_EQ: 3 } + { count: {eq: 3 } } { node: { - testString_SHORTEST_LENGTH_EQUAL: 3 + testString: { shortestLength: { eq: 3 } } } } ] @@ -149,10 +149,10 @@ describe("Nested within AND/OR", () => { ${postType.plural}(where: { likesAggregate: { AND: [ - { count_EQ: 3 } + { count: { eq: 3 } } { node: { - testString_SHORTEST_LENGTH_EQUAL: 3 + testString: {shortestLength: {eq: 3} } } } ] @@ -181,17 +181,17 @@ describe("Nested within AND/OR", () => { ${postType.plural}(where: { likesAggregate: { AND: [ - { count_LTE: 2 } + { count: { lte: 2 } } { AND: [ { node: { - testString_SHORTEST_LENGTH_LT: 4 + testString: {shortestLength: {lt: 4} } } } { node: { - testString_SHORTEST_LENGTH_GT: 2 + testString: {shortestLength: { gt: 2 } } } } ] @@ -230,12 +230,12 @@ describe("Nested within AND/OR", () => { AND: [ { node: { - NOT: { testString_SHORTEST_LENGTH_GT: 4 } + NOT: { testString: {shortestLength: { gt: 4 } } } } } { node: { - testString_SHORTEST_LENGTH_GT: 2 + testString: {shortestLength: { gt: 2 } } } } ] @@ -269,17 +269,17 @@ describe("Nested within AND/OR", () => { ${postType.plural}(where: { likesAggregate: { OR: [ - { count_LTE: 2 } + { count: { lte: 2 } } { OR: [ { node: { - testString_SHORTEST_LENGTH_LT: 4 + testString: {shortestLength: {lt: 4} } } } { node: { - testString_SHORTEST_LENGTH_GT: 20 + testString: {shortestLength: { gt: 20 } } } } ] @@ -319,17 +319,17 @@ describe("Nested within AND/OR", () => { ${postType.plural}(where: { likesAggregate: { AND: [ - { count_LTE: 2 } + { count: { lte: 2 } } { OR: [ { node: { - testString_SHORTEST_LENGTH_LT: 4 + testString: {shortestLength: {lt: 4} } } } { node: { - testString_SHORTEST_LENGTH_GT: 20 + testString: {shortestLength: { gt: 20 } } } } ] @@ -368,12 +368,12 @@ describe("Nested within AND/OR", () => { OR: [ { node: { - NOT: { testString_SHORTEST_LENGTH_GT: 4 } + NOT: { testString: {shortestLength: { gt: 4 } } } } } { node: { - testString_SHORTEST_LENGTH_GT: 20 + testString: {shortestLength: { gt: 20 } } } } ] @@ -412,12 +412,12 @@ describe("Nested within AND/OR", () => { AND: [ { node: { - testString_SHORTEST_LENGTH_LT: 4 + testString: {shortestLength: {lt: 4} } } } { node: { - testString_SHORTEST_LENGTH_GT: 2 + testString: {shortestLength: { gt: 2 } } } } ] diff --git a/packages/graphql/tests/integration/aggregations/where/count.int.test.ts b/packages/graphql/tests/integration/aggregations/where/count.int.test.ts index 9e38469720..31ea26d993 100644 --- a/packages/graphql/tests/integration/aggregations/where/count.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/count.int.test.ts @@ -62,7 +62,7 @@ describe("aggregations-where-count", () => { const query = /* GraphQL */ ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_EQ: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: {eq: 1 } } }) { testString likes { testString @@ -102,7 +102,7 @@ describe("aggregations-where-count", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LT: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { lt: 1 } } }) { testString likes { testString @@ -142,7 +142,7 @@ describe("aggregations-where-count", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LTE: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { lte: 1 } } }) { testString likes { testString @@ -187,7 +187,7 @@ describe("aggregations-where-count", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GT: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { gt: 1 } } }) { testString likes { testString @@ -227,7 +227,7 @@ describe("aggregations-where-count", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GTE: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { gte: 1 } } }) { testString likes { testString @@ -305,7 +305,7 @@ describe("aggregations-where-count interface relationships of concrete types", const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_EQ: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: {eq: 1 } } }) { testString likes { testString @@ -345,7 +345,7 @@ describe("aggregations-where-count interface relationships of concrete types", const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LT: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { lt: 1 } } }) { testString likes { testString @@ -385,7 +385,7 @@ describe("aggregations-where-count interface relationships of concrete types", const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LTE: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { lte: 1 } } }) { testString likes { testString @@ -430,7 +430,7 @@ describe("aggregations-where-count interface relationships of concrete types", const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GT: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { gt: 1 } } }) { testString likes { testString @@ -470,7 +470,7 @@ describe("aggregations-where-count interface relationships of concrete types", const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GTE: 1 } }) { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count: { gte: 1 } } }) { testString likes { testString diff --git a/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts index 95d3b907a3..c6cec2d414 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/int.int.test.ts @@ -76,7 +76,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: { average: { eq: ${avg} } } } } }) { testString likes { testString @@ -115,7 +115,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: {average: {gt: ${avgGT} } } } } }) { testString likes { testString @@ -153,7 +153,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: {average: {gte: ${avg} } } } } }) { testString likes { testString @@ -191,7 +191,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: {average: {lt: ${avgLT} } } } } }) { testString likes { testString @@ -229,7 +229,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: {average: {lte: ${avg} } } } } }) { testString likes { testString @@ -273,7 +273,7 @@ describe("aggregations-where-edge-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_SUM_EQUAL: ${sum} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { someInt: {sum: {eq: ${sum} } } } } }) { testString likes { testString diff --git a/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts b/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts index 044c4c1b30..ff67c25a6f 100644 --- a/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/edge/string.int.test.ts @@ -86,7 +86,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { shortestLength: { eq: ${shortestTestString.length} } } } } }) { testString likes { testString @@ -145,7 +145,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { longestLength: {eq: ${longestTestString.length} } } } }}) { testString likes { testString @@ -209,7 +209,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: {eq: ${avg} } } } } }) { testString likes { testString @@ -270,7 +270,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { gt: ${avgGT} } } } } }) { testString likes { testString @@ -330,7 +330,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: {averageLength: { gte: ${avg} } } } } }) { testString likes { testString @@ -391,7 +391,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -451,7 +451,7 @@ describe("aggregations-where-edge-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { lte: ${avg} } } } } }) { testString likes { testString @@ -550,7 +550,7 @@ describe("aggregations-where-edge-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { testString likes { testString @@ -575,44 +575,41 @@ describe("aggregations-where-edge-string interface relationships of concrete typ ]); }); - - test( - "should return posts where the LONGEST edge like String is EQUAL to", - async () => { - const testString = generate({ - charset: "alphabetic", - readable: true, - }); - - const shortestTestString = generate({ - charset: "alphabetic", - readable: true, - length: 10, - }); - - const testString2 = generate({ - charset: "alphabetic", - readable: true, - length: 11, - }); - - const longestTestString = generate({ - charset: "alphabetic", - readable: true, - length: 12, - }); - - await testHelper.executeCypher( - ` + test("should return posts where the LONGEST edge like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${shortestTestString}" }]-(:${User} {testString: "${shortestTestString}"}) CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString2}"}) CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${longestTestString}" }]-(:${User} {testString: "${longestTestString}"}) ` - ); + ); - const query = ` + const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { testString likes { testString @@ -621,66 +618,62 @@ describe("aggregations-where-edge-string interface relationships of concrete typ } `; - const gqlResult = await testHelper.executeGraphQL(query); - - if (gqlResult.errors) { - console.log(JSON.stringify(gqlResult.errors, null, 2)); - } + const gqlResult = await testHelper.executeGraphQL(query); - expect(gqlResult.errors).toBeUndefined(); + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } - expect((gqlResult.data as any)[Post.plural]).toEqual([ - { - testString, - likes: [{ testString: longestTestString }], - }, - ]); - } - ); + expect(gqlResult.errors).toBeUndefined(); + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString: longestTestString }], + }, + ]); + }); describe("AVERAGE", () => { - test( - "should return posts where the %s of edge like Strings is EQUAL to", - async () => { - const testString = generate({ - charset: "alphabetic", - readable: true, - }); - - const testString1 = generate({ - charset: "alphabetic", - readable: true, - length: 10, - }); - - const testString2 = generate({ - charset: "alphabetic", - readable: true, - length: 11, - }); - - const testString3 = generate({ - charset: "alphabetic", - readable: true, - length: 12, - }); - - const avg = (10 + 11 + 12) / 3; - - await testHelper.executeCypher( - ` + test("should return posts where the %s of edge like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` CREATE (p:${Post} {testString: "${testString}"}) CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) CREATE (:${Post} {testString: "${testString}"}) ` - ); + ); - const query = ` + const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { eq: ${avg} } } } } }) { testString likes { testString @@ -689,19 +682,18 @@ describe("aggregations-where-edge-string interface relationships of concrete typ } `; - const gqlResult = await testHelper.executeGraphQL(query); + const gqlResult = await testHelper.executeGraphQL(query); - if (gqlResult.errors) { - console.log(JSON.stringify(gqlResult.errors, null, 2)); - } + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } - expect(gqlResult.errors).toBeUndefined(); + expect(gqlResult.errors).toBeUndefined(); - const [post] = (gqlResult.data as any)[Post.plural] as any[]; - expect(post.testString).toEqual(testString); - expect(post.likes).toHaveLength(3); - } - ); + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); test("should return posts where the average of edge like Strings is GT than", async () => { const testString = generate({ @@ -742,7 +734,7 @@ describe("aggregations-where-edge-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { gt: ${avgGT} } } } } }) { testString likes { testString @@ -802,7 +794,7 @@ describe("aggregations-where-edge-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { gte: ${avg} } } } } }) { testString likes { testString @@ -863,7 +855,7 @@ describe("aggregations-where-edge-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -923,7 +915,7 @@ describe("aggregations-where-edge-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { edge: { testString: { averageLength: { lte: ${avg} } } } } }) { testString likes { testString diff --git a/packages/graphql/tests/integration/aggregations/where/node/int-connections.int.test.ts b/packages/graphql/tests/integration/aggregations/where/node/int-connections.int.test.ts index 3ba3b497d9..c95e49df22 100644 --- a/packages/graphql/tests/integration/aggregations/where/node/int-connections.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/node/int-connections.int.test.ts @@ -73,7 +73,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { eq: ${avg} } } } } }) { edges { node { testString @@ -117,7 +117,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { gt: ${avgGT} } } } } }) { edges { node { testString @@ -160,7 +160,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { gte: ${avg} } } } } }) { edges { node { testString @@ -204,7 +204,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { lt: ${avgLT} } } } } }) { edges { node { testString @@ -247,7 +247,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { lte: ${avg} } } } } }) { edges { node { testString @@ -296,7 +296,7 @@ describe("aggregations-where-node-int - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { sum: {eq: ${sum} } } } } }) { edges { node { testString @@ -385,7 +385,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { eq: ${avg} } } } } }) { edges { node { testString @@ -429,7 +429,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { gt: ${avgGT} } } } } }) { edges { node { testString @@ -472,7 +472,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { gte: ${avg} } } } } }) { edges { node { testString @@ -516,7 +516,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { lt: ${avgLT} } } } } }) { edges { node { testString @@ -559,7 +559,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { lte: ${avg} } } } } }) { edges { node { testString @@ -608,7 +608,7 @@ describe("aggregations-where-node-int - connections - interface relationships of const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + ${Post.operations.connection}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { sum: {eq: ${sum} } } } } }) { edges { node { testString diff --git a/packages/graphql/tests/integration/aggregations/where/node/int.int.test.ts b/packages/graphql/tests/integration/aggregations/where/node/int.int.test.ts index fb7b3d20e4..22c815d56a 100644 --- a/packages/graphql/tests/integration/aggregations/where/node/int.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/node/int.int.test.ts @@ -85,7 +85,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}" }, likesAggregate: { node: { someInt: { average: {eq: ${avg} } } } } }) { testString likes { testString @@ -124,7 +124,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { someInt: {average: { gt: ${avgGT} } } } } }) { testString likes { testString @@ -163,7 +163,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: {gte: ${avg} } } } } }) { testString likes { testString @@ -203,7 +203,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: {average: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -242,7 +242,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: {average: { lte: ${avg} } } } } }) { testString likes { testString @@ -286,7 +286,7 @@ describe("aggregations-where-node-int", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + ${Post.plural}(where: { testString: {eq:"${testString}"}, likesAggregate: { node: { someInt: {sum: {eq: ${sum} } } } } }) { testString likes { testString @@ -370,7 +370,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: {eq: ${avg} } } } } }) { testString likes { testString @@ -410,7 +410,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}" }, likesAggregate: { node: { someInt: {average: {gt: ${avgGT} } } } } }) { testString likes { testString @@ -449,7 +449,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}" }, likesAggregate: { node: { someInt: {average: {gte: ${avg} } } } } }) { testString likes { testString @@ -489,7 +489,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: { average: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -528,7 +528,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: {average: {lte: ${avg} } } } } }) { testString likes { testString @@ -573,7 +573,7 @@ describe("aggregations-where-node-int interface relationships of concrete types" const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + ${Post.plural}(where: { testString: {eq: "${testString}"}, likesAggregate: { node: { someInt: {sum: { eq: ${sum} } } } } }) { testString likes { testString diff --git a/packages/graphql/tests/integration/aggregations/where/node/string-connections.int.test.ts b/packages/graphql/tests/integration/aggregations/where/node/string-connections.int.test.ts index 11962c0a34..ff6757dbf8 100644 --- a/packages/graphql/tests/integration/aggregations/where/node/string-connections.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/node/string-connections.int.test.ts @@ -82,7 +82,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { shortestLength: { eq: ${shortestTestString.length} } } } } }) { edges { node { testString @@ -149,7 +149,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { longestLength: { eq: ${longestTestString.length} } } } } }) { edges { node { testString @@ -222,7 +222,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { eq: ${avg} } } } } }) { edges { node { testString @@ -288,7 +288,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { gt: ${avgGT} } } } } }) { edges { node { testString @@ -353,7 +353,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { gte: ${avg} } } } } }) { edges { node { testString @@ -419,7 +419,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { lt: ${avgLT} } } } } }) { edges { node { testString @@ -484,7 +484,7 @@ describe("aggregations-where-node-string - connections", () => { const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { lte: ${avg} } } } } }) { edges { node { testString @@ -583,7 +583,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { shortestLength: { eq: ${shortestTestString.length} } } } } }) { edges { node { testString @@ -650,7 +650,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { longestLength: { eq: ${longestTestString.length} } } } } }) { edges { node { testString @@ -723,7 +723,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { eq: ${avg} } } } } }) { edges { node { testString @@ -789,7 +789,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { gt: ${avgGT} } } } } }) { edges { node { testString @@ -854,7 +854,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { gte: ${avg} } } } } }) { edges { node { testString @@ -920,7 +920,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { lt: ${avgLT} } } } } }) { edges { node { testString @@ -985,7 +985,7 @@ describe("aggregations-where-node-string - connections - interface relationships const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { averageLength: { lte: ${avg} } } } } }) { edges { node { testString @@ -1089,7 +1089,7 @@ describe("aggregations-where-node-string - connections - relationships of interf const query = ` { - ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.operations.connection}(where: { testString: { eq: "${testString}" }, likesAggregate: { node: { testString: { shortestLength: { eq: ${shortestTestString.length} } } } } }) { edges { node { testString diff --git a/packages/graphql/tests/integration/aggregations/where/node/string.int.test.ts b/packages/graphql/tests/integration/aggregations/where/node/string.int.test.ts index 8ba9d1a565..188f53904a 100644 --- a/packages/graphql/tests/integration/aggregations/where/node/string.int.test.ts +++ b/packages/graphql/tests/integration/aggregations/where/node/string.int.test.ts @@ -82,7 +82,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: {shortestLength: { eq: ${shortestTestString.length} } } } } }) { testString likes { testString @@ -141,7 +141,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { longestLength: { eq: ${longestTestString.length} } } } } }) { testString likes { testString @@ -205,7 +205,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { eq: ${avg} } } } } }) { testString likes { testString @@ -266,7 +266,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { gt: ${avgGT} } } } } }) { testString likes { testString @@ -327,7 +327,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { gte: ${avg} } } } } }) { testString likes { testString @@ -389,7 +389,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -450,7 +450,7 @@ describe("aggregations-where-node-string", () => { const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { lte: ${avg} } } } } }) { testString likes { testString @@ -545,7 +545,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: {shortestLength: { eq: ${shortestTestString.length} } } } } }) { testString likes { testString @@ -606,7 +606,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { longestLength: { eq: ${longestTestString.length} } } } } }) { testString likes { testString @@ -672,7 +672,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { eq: ${avg} } } } } }) { testString likes { testString @@ -734,7 +734,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { gt: ${avgGT} } } } } }) { testString likes { testString @@ -795,7 +795,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { gte: ${avg} } } } } }) { testString likes { testString @@ -857,7 +857,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { lt: ${avgLT} } } } } }) { testString likes { testString @@ -918,7 +918,7 @@ describe("aggregations-where-node-string interface relationships of concrete typ const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: { averageLength: { lte: ${avg} } } } } }) { testString likes { testString @@ -1018,7 +1018,7 @@ describe("aggregations-where-node-string relationships of interface types", () = const query = ` { - ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + ${Post.plural}(where: { testString: { eq: "${testString}"}, likesAggregate: { node: { testString: {shortestLength: { eq: ${shortestTestString.length} } } } } }) { testString likes { testString diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/AND-OR-operations.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/AND-OR-operations.int.test.ts new file mode 100644 index 0000000000..ea8f6aeaf5 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/AND-OR-operations.int.test.ts @@ -0,0 +1,456 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import type { UniqueType } from "../../../../utils/graphql-types"; +import { TestHelper } from "../../../../utils/tests-helper"; + +describe("Nested within AND/OR", () => { + const testHelper = new TestHelper(); + + let userType: UniqueType; + let postType: UniqueType; + + const testString1 = "This is a test string"; + const testString2 = "anotherTestString"; + const testString3 = "SomeUserString!"; + const testString4 = "Foo"; + const testString5 = "Baa"; + const content1 = "SomeContent!"; + const content2 = "testContent"; + const content3 = "testContent3"; + const content4 = "Baz"; + const content5 = "Some more content"; + + beforeEach(async () => { + userType = testHelper.createUniqueType("User"); + postType = testHelper.createUniqueType("Post"); + + const typeDefs = ` + type ${userType.name} @node { + testString: String! + } + + type ${postType.name} @node { + content: String! + likes: [${userType.name}!]! @relationship(type: "LIKES", direction: IN) + } + `; + + await testHelper.executeCypher(` + CREATE (post1:${postType.name} { content: "${content1}" })<-[:LIKES]-(user1:${userType.name} { testString: "${testString1}" }) + CREATE (post2:${postType.name} { content: "${content2}" })<-[:LIKES]-(user2:${userType.name} { testString: "${testString2}" }) + CREATE (post3:${postType.name} { content: "${content3}" })<-[:LIKES]-(user3:${userType.name} { testString: "${testString3}" }) + CREATE (post4:${postType.name} { content: "${content4}" })<-[:LIKES]-(user4:${userType.name} { testString: "${testString4}" }) + CREATE (post5:${postType.name} { content: "${content5}" })<-[:LIKES]-(user5:${userType.name} { testString: "${testString5}" }) + MERGE (post1)<-[:LIKES]-(user2) + MERGE (post1)<-[:LIKES]-(user3) + MERGE (post2)<-[:LIKES]-(user4) + MERGE (post2)<-[:LIKES]-(user5) + MERGE (post3)<-[:LIKES]-(user1) + `); + + await testHelper.initNeo4jGraphQL({ + typeDefs, + }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("Implicit AND", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + count_EQ: 3 + node: { + testString_SHORTEST_LENGTH_EQUAL: 3 + } + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: [ + { + content: content2, + }, + ], + }); + }); + + test("Top-level OR", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + OR: [ + { count_EQ: 3 } + { + node: { + testString_SHORTEST_LENGTH_EQUAL: 3 + } + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content1, + }, + { + content: content2, + }, + { + content: content4, + }, + { + content: content5, + }, + ]), + }); + }); + + test("Top-level AND", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + AND: [ + { count_EQ: 3 } + { + node: { + testString_SHORTEST_LENGTH_EQUAL: 3 + } + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: [ + { + content: content2, + }, + ], + }); + }); + + test("AND within an AND", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + AND: [ + { count_LTE: 2 } + { + AND: [ + { + node: { + testString_SHORTEST_LENGTH_LT: 4 + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 2 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content5, + }, + { + content: content4, + }, + ]), + }); + }); + + test("AND within an AND with NOT", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + AND: [ + { NOT: { count_GT: 2 } } + { + AND: [ + { + node: { + NOT: { testString_SHORTEST_LENGTH_GT: 4 } + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 2 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content5, + }, + { + content: content4, + }, + ]), + }); + }); + + test("OR within an OR", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + OR: [ + { count_LTE: 2 } + { + OR: [ + { + node: { + testString_SHORTEST_LENGTH_LT: 4 + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 20 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content2, + }, + { + content: content3, + }, + { + content: content4, + }, + { + content: content5, + }, + ]), + }); + }); + + test("OR within an AND", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + AND: [ + { count_LTE: 2 } + { + OR: [ + { + node: { + testString_SHORTEST_LENGTH_LT: 4 + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 20 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content4, + }, + { + content: content5, + }, + ]), + }); + }); + + test("OR within an AND with NOT", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + AND: [ + { NOT: { count_GT: 2 } } + { + OR: [ + { + node: { + NOT: { testString_SHORTEST_LENGTH_GT: 4 } + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 20 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content4, + }, + { + content: content5, + }, + ]), + }); + }); + + test("AND within an OR", async () => { + const query = ` + query { + ${postType.plural}(where: { + likesAggregate: { + OR: [ + { count_GTE: 2 } + { + AND: [ + { + node: { + testString_SHORTEST_LENGTH_LT: 4 + } + } + { + node: { + testString_SHORTEST_LENGTH_GT: 2 + } + } + ] + } + ] + } + }) { + content + } + } + `; + + const result = await testHelper.executeGraphQL(query); + + expect(result.errors).toBeFalsy(); + expect(result.data).toEqual({ + [postType.plural]: expect.toIncludeSameMembers([ + { + content: content1, + }, + { + content: content2, + }, + { + content: content3, + }, + { + content: content4, + }, + { + content: content5, + }, + ]), + }); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/count.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/count.int.test.ts new file mode 100644 index 0000000000..2999e420d1 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/count.int.test.ts @@ -0,0 +1,497 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../utils/graphql-types"; +import { TestHelper } from "../../../../utils/tests-helper"; + +describe("aggregations-where-count", () => { + const testHelper = new TestHelper(); + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + + const typeDefs = /* GraphQL */ ` + type ${User} @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the count of likes equal one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = /* GraphQL */ ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_EQ: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString }], + }, + ]); + }); + + test("should return posts where the count of likes LT one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LT: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [], + }, + ]); + }); + + test("should return posts where the count of likes LTE one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LTE: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString }], + }, + { + testString, + likes: [], + }, + ]); + }); + + test("should return posts where the count of likes GT one, regardless of number of likes over 1", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GT: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: expect.toIncludeSameMembers([{ testString }, { testString }]), + }, + ]); + }); + + test("should return posts where the count of likes GT one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GTE: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString }], + }, + ]); + }); +}); + +describe("aggregations-where-count interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + + const typeDefs = /* GraphQL */ ` + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! + } + + type ${Person} implements Human @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the count of likes equal one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_EQ: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString }], + }, + ]); + }); + + test("should return posts where the count of likes LT one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LT: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [], + }, + ]); + }); + + test("should return posts where the count of likes LTE one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_LTE: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString }], + }, + { + testString, + likes: [], + }, + ]); + }); + + test("should return posts where the count of likes GT one, regardless of number of likes over 1", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GT: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: expect.toIncludeSameMembers([{ testString }, { testString }]), + }, + ]); + }); + + test("should return posts where the count of likes GT one", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { count_GTE: 1 } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString }], + }, + ]); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/edge/int.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/edge/int.int.test.ts new file mode 100644 index 0000000000..3f44ad5716 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/edge/int.int.test.ts @@ -0,0 +1,294 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-edge-int", () => { + const testHelper = new TestHelper(); + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + + const typeDefs = ` + type ${User} @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") + } + + type Likes @relationshipProperties { + someInt: Int + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("AVERAGE", () => { + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + test("should return posts where the average of a edge like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of a edge like Int's is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_GT: ${avgGT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of a edge like Int's is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_GTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of a edge like Int's is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_LT: ${avgLT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of a edge like Int's is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_AVERAGE_LTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); + + describe("sum", () => { + test("should return posts where the sum of a edge like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + const sum = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt1} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt2} }]-(:${User} {testString: "${testString}"}) + CREATE (p)<-[:LIKES { someInt: ${someInt3} }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { someInt_SUM_EQUAL: ${sum} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/edge/string.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/edge/string.int.test.ts new file mode 100644 index 0000000000..acfcab9430 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/edge/string.int.test.ts @@ -0,0 +1,940 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-edge-string", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + + const typeDefs = /* GraphQL */ ` + type ${User} @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") + } + + type Likes @relationshipProperties { + testString: String + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the SHORTEST edge like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${shortestTestString}" }]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${longestTestString}" }]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString: shortestTestString }], + }, + ]); + }); + + test("should return posts where the LONGEST edge like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${shortestTestString}" }]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${longestTestString}" }]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString: longestTestString }], + }, + ]); + }); + + describe("AVERAGE", () => { + test("should return posts where the AVERAGE of edge like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-edge-string interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + const typeDefs = /* GraphQL */ ` + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! + } + + type ${Person} implements Human @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") + someStringAlias: String @alias(property: "_someStringAlias") + } + + type Likes @relationshipProperties { + testString: String + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the SHORTEST edge like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${shortestTestString}" }]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${longestTestString}" }]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString: shortestTestString }], + }, + ]); + }); + + test("should return posts where the LONGEST edge like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${shortestTestString}" }]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES { testString: "${longestTestString}" }]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toEqual([ + { + testString, + likes: [{ testString: longestTestString }], + }, + ]); + }); + + describe("AVERAGE", () => { + test("should return posts where the %s of edge like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of edge like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString1}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString2}" }]-(:${User} {testString: "${testString}"}) + CREATE(p)<-[:LIKES { testString: "${testString3}" }]-(:${User} {testString: "${testString}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { edge: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/node/int-connections.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/node/int-connections.int.test.ts new file mode 100644 index 0000000000..d321e1cdc3 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/node/int-connections.int.test.ts @@ -0,0 +1,634 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-node-int - connections", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + const typeDefs = ` + type ${User} @node { + testString: String! + someInt: Int! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("AVERAGE", () => { + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + test("should return posts where the average of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); + + describe("sum", () => { + test("should return posts where the sum of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + const sum = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-node-int - connections - interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + + const typeDefs = ` + interface Human { + testString: String! + someInt: Int! + } + + type ${Person} implements Human @node { + testString: String! + someInt: Int! + } + type ${User} implements Human @node { + testString: String! + someInt: Int! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("AVERAGE", () => { + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + test("should return posts where the average of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); + + describe("sum", () => { + test("should return posts where the sum of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + const sum = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + edges { + node { + testString + likes { + testString + someInt + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/node/int.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/node/int.int.test.ts new file mode 100644 index 0000000000..f94e3869b8 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/node/int.int.test.ts @@ -0,0 +1,594 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-node-int", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + + const typeDefs = ` + interface Human { + testString: String! + someInt: Int! + } + + type ${Person} implements Human @node { + testString: String! + someInt: Int! + } + type ${User} implements Human @node { + testString: String! + someInt: Int! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("AVERAGE", () => { + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + test("should return posts where the average of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); + + describe("sum", () => { + test("should return posts where the sum of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + const sum = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-node-int interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + const typeDefs = ` + interface Human { + testString: String! + someInt: Int! + } + + type ${Person} implements Human @node { + testString: String! + someInt: Int! + } + type ${User} implements Human @node { + testString: String! + someInt: Int! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("AVERAGE", () => { + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + test("should return posts where the average of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_EQUAL: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GT: ${avgGT} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_GTE: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LT: ${avgLT} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Int's is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const avg = (someInt1 + someInt2 + someInt3) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_AVERAGE_LTE: ${avg} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); + + describe("sum", () => { + test("should return posts where the sum of like Int's is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const someInt1 = 1; + const someInt2 = 2; + const someInt3 = 3; + + const sum = someInt1 + someInt2 + someInt3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt1}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt2}}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString}", someInt: ${someInt3}}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { someInt_SUM_EQUAL: ${sum} } } }) { + testString + likes { + testString + someInt + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/node/string-connections.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/node/string-connections.int.test.ts new file mode 100644 index 0000000000..5e734b9823 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/node/string-connections.int.test.ts @@ -0,0 +1,1122 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-node-string - connections", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + + const typeDefs = /* GraphQL */ ` + type ${User} @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the %s like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.operations.connection]).toEqual({ + edges: [ + { + node: { + testString, + likes: [{ testString: shortestTestString }], + }, + }, + ], + }); + }); + + test("should return posts where the LONGEST like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.operations.connection]).toEqual({ + edges: [ + { + node: { + testString, + likes: [{ testString: longestTestString }], + }, + }, + ], + }); + }); + + describe("AVERAGE", () => { + test("should return posts where the %s of like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-node-string - connections - interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + + const typeDefs = /* GraphQL */ ` + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! + } + + type ${Person} implements Human @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the %s like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.operations.connection]).toEqual({ + edges: [ + { + node: { + testString, + likes: [{ testString: shortestTestString }], + }, + }, + ], + }); + }); + + test("should return posts where the LONGEST like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.operations.connection]).toEqual({ + edges: [ + { + node: { + testString, + likes: [{ testString: longestTestString }], + }, + }, + ], + }); + }); + + describe("AVERAGE", () => { + test("should return posts where the AVERAGE of like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = ((gqlResult.data as any)[Post.operations.connection] as any[])["edges"]; + expect(post.node.testString).toEqual(testString); + expect(post.node.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-node-string - connections - relationships of interface types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(() => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the SHORTEST like String is EQUAL to", async () => { + const typeDefs = /* GraphQL */ ` + interface Thing { + testString: String! + likes: [Human!]! @declareRelationship + } + + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! @alias(property: "user_testString") + } + + type ${Person} implements Human @node { + testString: String! @alias(property: "person_testString") + } + + type ${Post} implements Thing @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.operations.connection}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + edges { + node { + testString + likes { + testString + } + } + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.operations.connection].edges).toIncludeSameMembers([ + { + node: { + testString, + likes: [{ testString: shortestTestString }], + }, + }, + ]); + }); +}); diff --git a/packages/graphql/tests/integration/deprecations/aggregations/where/node/string.int.test.ts b/packages/graphql/tests/integration/deprecations/aggregations/where/node/string.int.test.ts new file mode 100644 index 0000000000..76da67c4b4 --- /dev/null +++ b/packages/graphql/tests/integration/deprecations/aggregations/where/node/string.int.test.ts @@ -0,0 +1,1044 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { generate } from "randomstring"; +import type { UniqueType } from "../../../../../utils/graphql-types"; +import { TestHelper } from "../../../../../utils/tests-helper"; + +describe("aggregations-where-node-string", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + + const typeDefs = /* GraphQL */ ` + type ${User} @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [${User}!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the SHORTEST like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString: shortestTestString }], + }, + ]); + }); + + test("should return posts where the LONGEST like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString: longestTestString }], + }, + ]); + }); + + test("should return posts where the AVERAGE of like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); +}); + +describe("aggregations-where-node-string interface relationships of concrete types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(async () => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + + const typeDefs = /* GraphQL */ ` + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! + } + + type ${Person} implements Human @node { + testString: String! + } + + type ${Post} @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + await testHelper.initNeo4jGraphQL({ typeDefs }); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + describe("SHORTEST", () => { + test("should return posts where the %s like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString: shortestTestString }], + }, + ]); + }); + }); + + describe("LONGEST", () => { + test("should return posts where the %s like String is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_LONGEST_LENGTH_EQUAL: ${longestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString: longestTestString }], + }, + ]); + }); + }); + + describe("AVERAGE", () => { + test("should return posts where the AVERAGE of like Strings is EQUAL to", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_EQUAL: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgGT = avg - 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GT: ${avgGT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is GTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_GTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LT than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + const avgLT = avg + 1; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LT: ${avgLT} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + + test("should return posts where the average of like Strings is LTE than", async () => { + const testString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString1 = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const testString3 = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + const avg = (10 + 11 + 12) / 3; + + await testHelper.executeCypher( + ` + CREATE (p:${Post} {testString: "${testString}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString1}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString2}"}) + CREATE (p)<-[:LIKES]-(:${User} {testString: "${testString3}"}) + CREATE (:${Post} {testString: "${testString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_AVERAGE_LENGTH_LTE: ${avg} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + const [post] = (gqlResult.data as any)[Post.plural] as any[]; + expect(post.testString).toEqual(testString); + expect(post.likes).toHaveLength(3); + }); + }); +}); + +describe("aggregations-where-node-string relationships of interface types", () => { + let testHelper: TestHelper; + let User: UniqueType; + let Post: UniqueType; + let Person: UniqueType; + + beforeEach(() => { + testHelper = new TestHelper(); + User = testHelper.createUniqueType("User"); + Post = testHelper.createUniqueType("Post"); + Person = testHelper.createUniqueType("Person"); + }); + + afterEach(async () => { + await testHelper.close(); + }); + + test("should return posts where the SHORTEST like String is EQUAL to", async () => { + const typeDefs = /* GraphQL */ ` + interface Thing { + testString: String! + likes: [Human!]! @declareRelationship + } + + interface Human { + testString: String! + } + + type ${User} implements Human @node { + testString: String! @alias(property: "user_testString") + } + + type ${Person} implements Human @node { + testString: String! @alias(property: "person_testString") + } + + type ${Post} implements Thing @node { + testString: String! + likes: [Human!]! @relationship(type: "LIKES", direction: IN) + } + `; + + await testHelper.initNeo4jGraphQL({ typeDefs }); + + const testString = generate({ + charset: "alphabetic", + readable: true, + }); + + const shortestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 10, + }); + + const testString2 = generate({ + charset: "alphabetic", + readable: true, + length: 11, + }); + + const longestTestString = generate({ + charset: "alphabetic", + readable: true, + length: 12, + }); + + await testHelper.executeCypher( + ` + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${shortestTestString}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${testString2}"}) + CREATE (:${Post} {testString: "${testString}"})<-[:LIKES]-(:${User} {user_testString: "${longestTestString}"}) + ` + ); + + const query = ` + { + ${Post.plural}(where: { testString_EQ: "${testString}", likesAggregate: { node: { testString_SHORTEST_LENGTH_EQUAL: ${shortestTestString.length} } } }) { + testString + likes { + testString + } + } + } + `; + + const gqlResult = await testHelper.executeGraphQL(query); + if (gqlResult.errors) { + console.log(JSON.stringify(gqlResult.errors, null, 2)); + } + + expect(gqlResult.errors).toBeUndefined(); + + expect((gqlResult.data as any)[Post.plural]).toIncludeSameMembers([ + { + testString, + likes: [{ testString: shortestTestString }], + }, + ]); + }); +}); diff --git a/packages/graphql/tests/schema/aggregations.test.ts b/packages/graphql/tests/schema/aggregations.test.ts index b23e70a5d6..78fd6b88ea 100644 --- a/packages/graphql/tests/schema/aggregations.test.ts +++ b/packages/graphql/tests/schema/aggregations.test.ts @@ -1213,6 +1213,7 @@ describe("Aggregations", () => { AND: [PostLikesAggregateInput!] NOT: PostLikesAggregateInput OR: [PostLikesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/array-methods.test.ts b/packages/graphql/tests/schema/array-methods.test.ts index b042e5aa54..ca3a64c750 100644 --- a/packages/graphql/tests/schema/array-methods.test.ts +++ b/packages/graphql/tests/schema/array-methods.test.ts @@ -94,6 +94,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -437,6 +438,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/authorization.test.ts b/packages/graphql/tests/schema/authorization.test.ts index 6dfeabf2e9..22a6216779 100644 --- a/packages/graphql/tests/schema/authorization.test.ts +++ b/packages/graphql/tests/schema/authorization.test.ts @@ -158,6 +158,7 @@ describe("Authorization", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -461,6 +462,7 @@ describe("Authorization", () => { AND: [UserPostsAggregateInput!] NOT: UserPostsAggregateInput OR: [UserPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/comments.test.ts b/packages/graphql/tests/schema/comments.test.ts index 6e69781627..e26d2bf6f4 100644 --- a/packages/graphql/tests/schema/comments.test.ts +++ b/packages/graphql/tests/schema/comments.test.ts @@ -523,6 +523,7 @@ describe("Comments", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -881,6 +882,7 @@ describe("Comments", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/connections/enums.test.ts b/packages/graphql/tests/schema/connections/enums.test.ts index 9dad0061c8..a0b15f7f02 100644 --- a/packages/graphql/tests/schema/connections/enums.test.ts +++ b/packages/graphql/tests/schema/connections/enums.test.ts @@ -135,6 +135,7 @@ describe("Enums", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -352,6 +353,7 @@ describe("Enums", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/connections/interfaces.test.ts b/packages/graphql/tests/schema/connections/interfaces.test.ts index f2737a421e..5a62bdef87 100644 --- a/packages/graphql/tests/schema/connections/interfaces.test.ts +++ b/packages/graphql/tests/schema/connections/interfaces.test.ts @@ -129,6 +129,7 @@ describe("Connection with interfaces", () => { AND: [CreatureMoviesAggregateInput!] NOT: CreatureMoviesAggregateInput OR: [CreatureMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -372,6 +373,7 @@ describe("Connection with interfaces", () => { AND: [MovieDirectorAggregateInput!] NOT: MovieDirectorAggregateInput OR: [MovieDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -560,6 +562,7 @@ describe("Connection with interfaces", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -713,6 +716,7 @@ describe("Connection with interfaces", () => { AND: [ProductionDirectorAggregateInput!] NOT: ProductionDirectorAggregateInput OR: [ProductionDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -935,6 +939,7 @@ describe("Connection with interfaces", () => { AND: [SeriesDirectorAggregateInput!] NOT: SeriesDirectorAggregateInput OR: [SeriesDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/connections/sort.test.ts b/packages/graphql/tests/schema/connections/sort.test.ts index 753fbeaeaa..c6807e7f1c 100644 --- a/packages/graphql/tests/schema/connections/sort.test.ts +++ b/packages/graphql/tests/schema/connections/sort.test.ts @@ -144,6 +144,7 @@ describe("Sort", () => { AND: [Node1RelatedToAggregateInput!] NOT: Node1RelatedToAggregateInput OR: [Node1RelatedToAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -310,6 +311,7 @@ describe("Sort", () => { AND: [Node2RelatedToAggregateInput!] NOT: Node2RelatedToAggregateInput OR: [Node2RelatedToAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/connections/unions.test.ts b/packages/graphql/tests/schema/connections/unions.test.ts index 98f5329ae2..6a32e81d6b 100644 --- a/packages/graphql/tests/schema/connections/unions.test.ts +++ b/packages/graphql/tests/schema/connections/unions.test.ts @@ -309,6 +309,7 @@ describe("Unions", () => { AND: [BookAuthorAggregateInput!] NOT: BookAuthorAggregateInput OR: [BookAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -590,6 +591,7 @@ describe("Unions", () => { AND: [JournalAuthorAggregateInput!] NOT: JournalAuthorAggregateInput OR: [JournalAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directive-preserve.test.ts b/packages/graphql/tests/schema/directive-preserve.test.ts index ceb6d2c11e..b0299dff6c 100644 --- a/packages/graphql/tests/schema/directive-preserve.test.ts +++ b/packages/graphql/tests/schema/directive-preserve.test.ts @@ -320,6 +320,7 @@ describe("Directive-preserve", () => { AND: [GenreMoviesAggregateInput!] NOT: GenreMoviesAggregateInput OR: [GenreMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -596,6 +597,7 @@ describe("Directive-preserve", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -970,6 +972,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1258,6 +1261,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1438,6 +1442,7 @@ describe("Directive-preserve", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1710,6 +1715,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2043,6 +2049,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2328,6 +2335,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2634,6 +2642,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2990,6 +2999,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3275,6 +3285,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3581,6 +3592,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3913,6 +3925,7 @@ describe("Directive-preserve", () => { AND: [BlogPostsAggregateInput!] NOT: BlogPostsAggregateInput OR: [BlogPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/alias.test.ts b/packages/graphql/tests/schema/directives/alias.test.ts index f606fecd80..6134e05607 100644 --- a/packages/graphql/tests/schema/directives/alias.test.ts +++ b/packages/graphql/tests/schema/directives/alias.test.ts @@ -62,6 +62,7 @@ describe("Alias", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/filterable.test.ts b/packages/graphql/tests/schema/directives/filterable.test.ts index 1e446a4082..2f25bc076d 100644 --- a/packages/graphql/tests/schema/directives/filterable.test.ts +++ b/packages/graphql/tests/schema/directives/filterable.test.ts @@ -964,6 +964,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1195,6 +1196,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1617,6 +1619,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1871,6 +1874,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2293,6 +2297,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2547,6 +2552,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2954,6 +2960,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3581,6 +3588,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3835,6 +3843,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4259,6 +4268,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4513,6 +4523,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4913,6 +4924,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5533,6 +5545,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6209,6 +6222,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6453,6 +6467,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6920,6 +6935,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7612,6 +7628,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7862,6 +7879,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8584,6 +8602,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8834,6 +8853,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9556,6 +9576,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9806,6 +9827,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/populatedBy.test.ts b/packages/graphql/tests/schema/directives/populatedBy.test.ts index d219ed5436..0620f8b83e 100644 --- a/packages/graphql/tests/schema/directives/populatedBy.test.ts +++ b/packages/graphql/tests/schema/directives/populatedBy.test.ts @@ -940,6 +940,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1537,6 +1538,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts b/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts index d17ba64462..448fba8e06 100644 --- a/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-aggregate.test.ts @@ -347,6 +347,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -764,6 +765,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1172,6 +1174,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1650,6 +1653,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts b/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts index c3f13a66cf..dd818ed13b 100644 --- a/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-nested-operations.test.ts @@ -131,6 +131,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -497,6 +498,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -878,6 +880,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1263,6 +1266,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1639,6 +1643,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2019,6 +2024,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2396,6 +2402,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2770,6 +2777,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3161,6 +3169,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3288,6 +3297,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3675,6 +3685,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3777,6 +3788,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8481,6 +8493,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8990,6 +9003,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9519,6 +9533,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10047,6 +10062,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10571,6 +10587,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -11094,6 +11111,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -11617,6 +11635,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -11744,6 +11763,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12285,6 +12305,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12396,6 +12417,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/relationship-properties.test.ts b/packages/graphql/tests/schema/directives/relationship-properties.test.ts index a652802fba..8dc4b981d3 100644 --- a/packages/graphql/tests/schema/directives/relationship-properties.test.ts +++ b/packages/graphql/tests/schema/directives/relationship-properties.test.ts @@ -189,6 +189,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -462,6 +463,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -920,6 +922,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1216,6 +1219,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1631,6 +1635,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1901,6 +1906,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/relationship.test.ts b/packages/graphql/tests/schema/directives/relationship.test.ts index fbd844eb47..3e45d4d6e9 100644 --- a/packages/graphql/tests/schema/directives/relationship.test.ts +++ b/packages/graphql/tests/schema/directives/relationship.test.ts @@ -95,6 +95,7 @@ describe("Relationship", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -331,6 +332,7 @@ describe("Relationship", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/selectable.test.ts b/packages/graphql/tests/schema/directives/selectable.test.ts index 04efe3afd5..66faa42af9 100644 --- a/packages/graphql/tests/schema/directives/selectable.test.ts +++ b/packages/graphql/tests/schema/directives/selectable.test.ts @@ -767,6 +767,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1168,6 +1169,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2543,6 +2545,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3099,6 +3102,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/directives/settable.test.ts b/packages/graphql/tests/schema/directives/settable.test.ts index 0fc6c1615f..a9b0f10a9a 100644 --- a/packages/graphql/tests/schema/directives/settable.test.ts +++ b/packages/graphql/tests/schema/directives/settable.test.ts @@ -604,6 +604,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1015,6 +1016,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1413,6 +1415,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1668,6 +1671,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1974,6 +1978,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2237,6 +2242,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3702,6 +3708,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4361,6 +4368,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4763,6 +4771,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5329,6 +5338,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5877,6 +5887,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6137,6 +6148,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6311,6 +6323,7 @@ describe("@settable", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6509,6 +6522,7 @@ describe("@settable", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6762,6 +6776,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7030,6 +7045,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7204,6 +7220,7 @@ describe("@settable", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7427,6 +7444,7 @@ describe("@settable", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/federation.test.ts b/packages/graphql/tests/schema/federation.test.ts index bfdc4b56d3..6e643b0b64 100644 --- a/packages/graphql/tests/schema/federation.test.ts +++ b/packages/graphql/tests/schema/federation.test.ts @@ -148,6 +148,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -448,6 +449,7 @@ describe("Apollo Federation", () => { AND: [UserPostsAggregateInput!] NOT: UserPostsAggregateInput OR: [UserPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -740,6 +742,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/inheritance.test.ts b/packages/graphql/tests/schema/inheritance.test.ts index 8fefcf613b..e19f5df289 100644 --- a/packages/graphql/tests/schema/inheritance.test.ts +++ b/packages/graphql/tests/schema/inheritance.test.ts @@ -88,6 +88,7 @@ describe("inheritance", () => { AND: [ActorFriendsAggregateInput!] NOT: ActorFriendsAggregateInput OR: [ActorFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -415,6 +416,7 @@ describe("inheritance", () => { AND: [PersonFriendsAggregateInput!] NOT: PersonFriendsAggregateInput OR: [PersonFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/interface-relationships.test.ts b/packages/graphql/tests/schema/interface-relationships.test.ts index 0d59c9fa34..0e5e317d54 100644 --- a/packages/graphql/tests/schema/interface-relationships.test.ts +++ b/packages/graphql/tests/schema/interface-relationships.test.ts @@ -131,6 +131,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -791,6 +792,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1066,6 +1068,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesAggregateInput!] NOT: EpisodeSeriesAggregateInput OR: [EpisodeSeriesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1313,6 +1316,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1496,6 +1500,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1774,6 +1779,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1891,6 +1897,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesAggregateInput!] NOT: SeriesEpisodesAggregateInput OR: [SeriesEpisodesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2266,6 +2273,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2541,6 +2549,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesAggregateInput!] NOT: EpisodeSeriesAggregateInput OR: [EpisodeSeriesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2788,6 +2797,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2971,6 +2981,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3269,6 +3280,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3386,6 +3398,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesAggregateInput!] NOT: SeriesEpisodesAggregateInput OR: [SeriesEpisodesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3853,6 +3866,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4184,6 +4198,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4265,6 +4280,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4576,6 +4592,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4980,6 +4997,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5429,6 +5447,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5510,6 +5529,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5830,6 +5850,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6249,6 +6270,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6654,6 +6676,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6735,6 +6758,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7118,6 +7142,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7492,6 +7517,7 @@ describe("Interface Relationships", () => { AND: [CommentCreatorAggregateInput!] NOT: CommentCreatorAggregateInput OR: [CommentCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7579,6 +7605,7 @@ describe("Interface Relationships", () => { AND: [CommentPostAggregateInput!] NOT: CommentPostAggregateInput OR: [CommentPostAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7820,6 +7847,7 @@ describe("Interface Relationships", () => { AND: [ContentCreatorAggregateInput!] NOT: ContentCreatorAggregateInput OR: [ContentCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8131,6 +8159,7 @@ describe("Interface Relationships", () => { AND: [PostCommentsAggregateInput!] NOT: PostCommentsAggregateInput OR: [PostCommentsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8251,6 +8280,7 @@ describe("Interface Relationships", () => { AND: [PostCreatorAggregateInput!] NOT: PostCreatorAggregateInput OR: [PostCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8540,6 +8570,7 @@ describe("Interface Relationships", () => { AND: [UserContentAggregateInput!] NOT: UserContentAggregateInput OR: [UserContentAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8858,6 +8889,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9154,6 +9186,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9414,6 +9447,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9574,6 +9608,7 @@ describe("Interface Relationships", () => { AND: [ShowActorsAggregateInput!] NOT: ShowActorsAggregateInput OR: [ShowActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/interfaces.test.ts b/packages/graphql/tests/schema/interfaces.test.ts index 43b4577fab..579fba503f 100644 --- a/packages/graphql/tests/schema/interfaces.test.ts +++ b/packages/graphql/tests/schema/interfaces.test.ts @@ -105,6 +105,16 @@ describe("Interfaces", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements MovieNode { customQuery: [Movie] id: ID @@ -158,6 +168,7 @@ describe("Interfaces", () => { AND: [MovieMoviesAggregateInput!] NOT: MovieMoviesAggregateInput OR: [MovieMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -235,6 +246,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesAggregateInput!] NOT: MovieNodeMoviesAggregateInput OR: [MovieNodeMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -536,6 +548,16 @@ describe("Interfaces", () => { set: ID } + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + type Movie implements MovieNode { customQuery: [Movie] id: ID @@ -589,6 +611,7 @@ describe("Interfaces", () => { AND: [MovieMoviesAggregateInput!] NOT: MovieMoviesAggregateInput OR: [MovieMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -666,6 +689,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesAggregateInput!] NOT: MovieNodeMoviesAggregateInput OR: [MovieNodeMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/1182.test.ts b/packages/graphql/tests/schema/issues/1182.test.ts index ab0b3418c2..e987a0fb67 100644 --- a/packages/graphql/tests/schema/issues/1182.test.ts +++ b/packages/graphql/tests/schema/issues/1182.test.ts @@ -257,6 +257,7 @@ describe("https://github.com/neo4j/graphql/issues/1182", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/1614.test.ts b/packages/graphql/tests/schema/issues/1614.test.ts index 8bd7d64b57..923a9e3718 100644 --- a/packages/graphql/tests/schema/issues/1614.test.ts +++ b/packages/graphql/tests/schema/issues/1614.test.ts @@ -107,6 +107,7 @@ describe("https://github.com/neo4j/graphql/issues/1614", () => { AND: [CrewMemberMoviesAggregateInput!] NOT: CrewMemberMoviesAggregateInput OR: [CrewMemberMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/162.test.ts b/packages/graphql/tests/schema/issues/162.test.ts index 4c00378f7d..c3c7e51c29 100644 --- a/packages/graphql/tests/schema/issues/162.test.ts +++ b/packages/graphql/tests/schema/issues/162.test.ts @@ -250,6 +250,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1AggregateInput!] NOT: TigerJawLevel2Part1AggregateInput OR: [TigerJawLevel2Part1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -363,6 +364,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1TigerAggregateInput!] NOT: TigerJawLevel2Part1TigerAggregateInput OR: [TigerJawLevel2Part1TigerAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/2187.test.ts b/packages/graphql/tests/schema/issues/2187.test.ts index b5e82e8459..70a78ab4ce 100644 --- a/packages/graphql/tests/schema/issues/2187.test.ts +++ b/packages/graphql/tests/schema/issues/2187.test.ts @@ -161,6 +161,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { AND: [GenreMoviesAggregateInput!] NOT: GenreMoviesAggregateInput OR: [GenreMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -437,6 +438,7 @@ describe("https://github.com/neo4j/graphql/issues/2187", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/2377.test.ts b/packages/graphql/tests/schema/issues/2377.test.ts index be3b758554..39e7de69a0 100644 --- a/packages/graphql/tests/schema/issues/2377.test.ts +++ b/packages/graphql/tests/schema/issues/2377.test.ts @@ -277,6 +277,7 @@ describe("https://github.com/neo4j/graphql/issues/2377", () => { AND: [ResourceContainedByAggregateInput!] NOT: ResourceContainedByAggregateInput OR: [ResourceContainedByAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/2993.test.ts b/packages/graphql/tests/schema/issues/2993.test.ts index cd6adc1ddb..72533c5f5c 100644 --- a/packages/graphql/tests/schema/issues/2993.test.ts +++ b/packages/graphql/tests/schema/issues/2993.test.ts @@ -374,6 +374,7 @@ describe("https://github.com/neo4j/graphql/issues/2993", () => { AND: [UserFollowingAggregateInput!] NOT: UserFollowingAggregateInput OR: [UserFollowingAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/3428.test.ts b/packages/graphql/tests/schema/issues/3428.test.ts index b566a3e33d..7b061a2e1c 100644 --- a/packages/graphql/tests/schema/issues/3428.test.ts +++ b/packages/graphql/tests/schema/issues/3428.test.ts @@ -131,6 +131,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/3541.test.ts b/packages/graphql/tests/schema/issues/3541.test.ts index 4ec10d15bf..af5e3da0c4 100644 --- a/packages/graphql/tests/schema/issues/3541.test.ts +++ b/packages/graphql/tests/schema/issues/3541.test.ts @@ -144,6 +144,7 @@ describe("Extending the schema in when using getSubgraphSchema", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -516,6 +517,7 @@ describe("Extending the schema in when using getSubgraphSchema", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/3698.test.ts b/packages/graphql/tests/schema/issues/3698.test.ts index 3a83f83240..6ab21dba72 100644 --- a/packages/graphql/tests/schema/issues/3698.test.ts +++ b/packages/graphql/tests/schema/issues/3698.test.ts @@ -184,6 +184,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { AND: [GenreProductAggregateInput!] NOT: GenreProductAggregateInput OR: [GenreProductAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -518,6 +519,7 @@ describe("https://github.com/neo4j/graphql/issues/3698", () => { AND: [MovieGenreAggregateInput!] NOT: MovieGenreAggregateInput OR: [MovieGenreAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/3817.test.ts b/packages/graphql/tests/schema/issues/3817.test.ts index 6cfd05acd1..1f0c186fc7 100644 --- a/packages/graphql/tests/schema/issues/3817.test.ts +++ b/packages/graphql/tests/schema/issues/3817.test.ts @@ -239,6 +239,7 @@ describe("ttps://github.com/neo4j/graphql/issues/3817", () => { AND: [PersonFriendsAggregateInput!] NOT: PersonFriendsAggregateInput OR: [PersonFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/4511.test.ts b/packages/graphql/tests/schema/issues/4511.test.ts index 0f1e3dde57..2bcd2034b9 100644 --- a/packages/graphql/tests/schema/issues/4511.test.ts +++ b/packages/graphql/tests/schema/issues/4511.test.ts @@ -129,6 +129,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [CreatureMoviesAggregateInput!] NOT: CreatureMoviesAggregateInput OR: [CreatureMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -360,6 +361,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [MovieDirectorAggregateInput!] NOT: MovieDirectorAggregateInput OR: [MovieDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -537,6 +539,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -680,6 +683,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [ProductionDirectorAggregateInput!] NOT: ProductionDirectorAggregateInput OR: [ProductionDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -887,6 +891,7 @@ describe("https://github.com/neo4j/graphql/issues/4511", () => { AND: [SeriesDirectorAggregateInput!] NOT: SeriesDirectorAggregateInput OR: [SeriesDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/4615.test.ts b/packages/graphql/tests/schema/issues/4615.test.ts index 385f13c4a0..c5d47309ba 100644 --- a/packages/graphql/tests/schema/issues/4615.test.ts +++ b/packages/graphql/tests/schema/issues/4615.test.ts @@ -139,6 +139,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -459,6 +460,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -682,6 +684,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -842,6 +845,7 @@ describe("https://github.com/neo4j/graphql/issues/4615", () => { AND: [ShowActorsAggregateInput!] NOT: ShowActorsAggregateInput OR: [ShowActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/issues/872.test.ts b/packages/graphql/tests/schema/issues/872.test.ts index d8e37df2e3..921bfbb7e1 100644 --- a/packages/graphql/tests/schema/issues/872.test.ts +++ b/packages/graphql/tests/schema/issues/872.test.ts @@ -96,6 +96,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { AND: [Actor2MoviesAggregateInput!] NOT: Actor2MoviesAggregateInput OR: [Actor2MoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -282,6 +283,7 @@ describe("https://github.com/neo4j/graphql/issues/872", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/lowercase-type-names.test.ts b/packages/graphql/tests/schema/lowercase-type-names.test.ts index 0e13e2f788..d098b40d2c 100644 --- a/packages/graphql/tests/schema/lowercase-type-names.test.ts +++ b/packages/graphql/tests/schema/lowercase-type-names.test.ts @@ -292,6 +292,7 @@ describe("lower case type names", () => { AND: [actorMoviesAggregateInput!] NOT: actorMoviesAggregateInput OR: [actorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -527,6 +528,7 @@ describe("lower case type names", () => { AND: [movieActorsAggregateInput!] NOT: movieActorsAggregateInput OR: [movieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/math.test.ts b/packages/graphql/tests/schema/math.test.ts index 5066764693..1cd644a6a8 100644 --- a/packages/graphql/tests/schema/math.test.ts +++ b/packages/graphql/tests/schema/math.test.ts @@ -689,6 +689,7 @@ describe("Algebraic", () => { AND: [DirectorDirectsAggregateInput!] NOT: DirectorDirectsAggregateInput OR: [DirectorDirectsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -977,6 +978,7 @@ describe("Algebraic", () => { AND: [MovieDirectedByAggregateInput!] NOT: MovieDirectedByAggregateInput OR: [MovieDirectedByAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1460,6 +1462,7 @@ describe("Algebraic", () => { AND: [MovieWorkersAggregateInput!] NOT: MovieWorkersAggregateInput OR: [MovieWorkersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1679,6 +1682,7 @@ describe("Algebraic", () => { AND: [PersonWorksInProductionAggregateInput!] NOT: PersonWorksInProductionAggregateInput OR: [PersonWorksInProductionAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2093,6 +2097,7 @@ describe("Algebraic", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2324,6 +2329,7 @@ describe("Algebraic", () => { AND: [PersonActedInMoviesAggregateInput!] NOT: PersonActedInMoviesAggregateInput OR: [PersonActedInMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts b/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts index bcc564503e..15d328bce6 100644 --- a/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts +++ b/packages/graphql/tests/schema/nested-aggregation-on-type.test.ts @@ -104,6 +104,7 @@ describe("nested aggregation on interface", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/pluralize-consistency.test.ts b/packages/graphql/tests/schema/pluralize-consistency.test.ts index 3e7e74d8d6..de124d9a97 100644 --- a/packages/graphql/tests/schema/pluralize-consistency.test.ts +++ b/packages/graphql/tests/schema/pluralize-consistency.test.ts @@ -262,6 +262,7 @@ describe("Pluralize consistency", () => { AND: [super_userMy_friendAggregateInput!] NOT: super_userMy_friendAggregateInput OR: [super_userMy_friendAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/query-direction.test.ts b/packages/graphql/tests/schema/query-direction.test.ts index b4f81bbdfd..a1e2da7753 100644 --- a/packages/graphql/tests/schema/query-direction.test.ts +++ b/packages/graphql/tests/schema/query-direction.test.ts @@ -196,6 +196,7 @@ describe("Query Direction", () => { AND: [UserFriendsAggregateInput!] NOT: UserFriendsAggregateInput OR: [UserFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -525,6 +526,7 @@ describe("Query Direction", () => { AND: [UserFriendsAggregateInput!] NOT: UserFriendsAggregateInput OR: [UserFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts b/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts index cf4c45bf86..976ac327a9 100644 --- a/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts +++ b/packages/graphql/tests/schema/remove-deprecated/array-methods.test.ts @@ -96,6 +96,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -439,6 +440,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/remove-deprecated/comments.test.ts b/packages/graphql/tests/schema/remove-deprecated/comments.test.ts index fc47ee2b0a..56f759f062 100644 --- a/packages/graphql/tests/schema/remove-deprecated/comments.test.ts +++ b/packages/graphql/tests/schema/remove-deprecated/comments.test.ts @@ -527,6 +527,7 @@ describe("Comments", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -887,6 +888,7 @@ describe("Comments", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/string-comparators.test.ts b/packages/graphql/tests/schema/string-comparators.test.ts index 393bb1f8d1..73b97727ef 100644 --- a/packages/graphql/tests/schema/string-comparators.test.ts +++ b/packages/graphql/tests/schema/string-comparators.test.ts @@ -622,6 +622,7 @@ describe("String Comparators", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -894,6 +895,7 @@ describe("String Comparators", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/subscriptions.test.ts b/packages/graphql/tests/schema/subscriptions.test.ts index 15844e9ebf..ed2ebda17f 100644 --- a/packages/graphql/tests/schema/subscriptions.test.ts +++ b/packages/graphql/tests/schema/subscriptions.test.ts @@ -281,6 +281,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -719,6 +720,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1049,6 +1051,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1941,6 +1944,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2188,6 +2192,7 @@ describe("Subscriptions", () => { AND: [StarMoviesAggregateInput!] NOT: StarMoviesAggregateInput OR: [StarMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2557,6 +2562,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2892,6 +2898,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3463,6 +3470,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4341,6 +4349,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4578,6 +4587,7 @@ describe("Subscriptions", () => { AND: [StarMoviesAggregateInput!] NOT: StarMoviesAggregateInput OR: [StarMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int diff --git a/packages/graphql/tests/schema/union-interface-relationship.test.ts b/packages/graphql/tests/schema/union-interface-relationship.test.ts index 68d37d4366..87491e8e4b 100644 --- a/packages/graphql/tests/schema/union-interface-relationship.test.ts +++ b/packages/graphql/tests/schema/union-interface-relationship.test.ts @@ -204,6 +204,7 @@ describe("Union Interface Relationships", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -620,6 +621,7 @@ describe("Union Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -939,6 +941,7 @@ describe("Union Interface Relationships", () => { AND: [MovieReviewersAggregateInput!] NOT: MovieReviewersAggregateInput OR: [MovieReviewersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1272,6 +1275,7 @@ describe("Union Interface Relationships", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int From c11f69dc93770b310b8f504e839800b2a47909bb Mon Sep 17 00:00:00 2001 From: angrykoala Date: Thu, 12 Dec 2024 11:36:36 +0000 Subject: [PATCH 3/5] Remove lists from aggregation filter generation --- .../src/schema/generation/aggregate-types.ts | 5 +- ...-aggregation-filter-from-attribute-type.ts | 68 +- .../graphql/tests/schema/aggregations.test.ts | 1195 +++++++++++++++++ 3 files changed, 1203 insertions(+), 65 deletions(-) diff --git a/packages/graphql/src/schema/generation/aggregate-types.ts b/packages/graphql/src/schema/generation/aggregate-types.ts index 1c77f09c2b..3dec6b4782 100644 --- a/packages/graphql/src/schema/generation/aggregate-types.ts +++ b/packages/graphql/src/schema/generation/aggregate-types.ts @@ -193,8 +193,9 @@ function makeAggregationFields( const fields: InputTypeComposerFieldConfigMapDefinition = {}; for (const attribute of attributes) { addAggregationFieldsByType(attribute, userDefinedDirectivesOnTargetFields?.get(attribute.name), fields); - - fields[attribute.name] = getAggregationFilterFromAttributeType(attribute); + if (attribute.isAggregationWhereField()) { + fields[attribute.name] = getAggregationFilterFromAttributeType(attribute); + } } return fields; } diff --git a/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts b/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts index c2dac15271..fb2cef7bb1 100644 --- a/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts +++ b/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts @@ -31,99 +31,41 @@ import { TimeScalarAggregationFilters } from "../../graphql/input-objects/generi import type { AttributeAdapter } from "../../schema-model/attribute/model-adapters/AttributeAdapter"; export function getAggregationFilterFromAttributeType(attribute: AttributeAdapter): GraphQLInputObjectType | string { - // // NOTE: static types returned here must be added to schema-validation > validateUserDefinition - // if (attribute.typeHelper.isBoolean()) { - // if (attribute.typeHelper.isList()) { - // return BooleanListFilters; - // } - // return BooleanScalarFilters; - // } + if (attribute.typeHelper.isList()) { + throw new Error("List types not available for aggregations"); + } + if (attribute.typeHelper.isID()) { - // if (attribute.typeHelper.isList()) { - // return IDListFilters; - // } return IDScalarAggregationFilters; } if (attribute.typeHelper.isString()) { - // if (attribute.typeHelper.isList()) { - // return StringListFilters; - // } return StringScalarAggregationFilters; } if (attribute.typeHelper.isInt()) { - // if (attribute.typeHelper.isList()) { - // return IntListFilters; - // } return IntScalarAggregationFilters; } if (attribute.typeHelper.isFloat()) { - // if (attribute.typeHelper.isList()) { - // return FloatListFilters; - // } return FloatScalarAggregationFilters; } if (attribute.typeHelper.isBigInt()) { - // if (attribute.typeHelper.isList()) { - // return BigIntListFilters; - // } return BigIntScalarAggregationFilters; } if (attribute.typeHelper.isTime()) { - // if (attribute.typeHelper.isList()) { - // return TimeListFilters; - // } return TimeScalarAggregationFilters; } - // if (attribute.typeHelper.isPoint()) { - // if (attribute.typeHelper.isList()) { - // return PointListFilters; - // } - // return PointFilters; - // } - // if (attribute.typeHelper.isCartesianPoint()) { - // if (attribute.typeHelper.isList()) { - // return CartesianPointListFilters; - // } - // return CartesianPointFilters; - // } + if (attribute.typeHelper.isDateTime()) { - // if (attribute.typeHelper.isList()) { - // return DateTimeListFilters; - // } return DateTimeScalarAggregationFilters; } if (attribute.typeHelper.isLocalTime()) { - // if (attribute.typeHelper.isList()) { - // return LocalTimeListFilters; - // } return LocalTimeScalarAggregationFilters; } if (attribute.typeHelper.isLocalDateTime()) { - // if (attribute.typeHelper.isList()) { - // return LocalDateTimeListFilters; - // } return LocalDateTimeScalarAggregationFilters; } if (attribute.typeHelper.isDuration()) { - // if (attribute.typeHelper.isList()) { - // return DurationListFilters; - // } return DurationScalarAggregationFilters; } - // if (attribute.typeHelper.isDate()) { - // if (attribute.typeHelper.isList()) { - // return DateListFilters; - // } - // return DateScalarFilters; - // } - - // if (attribute.typeHelper.isEnum()) { - // return `${attribute.getTypeName()}EnumScalarFilters`; - // } - - // if (attribute.typeHelper.isUserScalar()) { - // return `${attribute.getTypeName()}ScalarFilters`; - // } throw new Error(`No scalar filter found for attribute ${attribute.type.name}`); } diff --git a/packages/graphql/tests/schema/aggregations.test.ts b/packages/graphql/tests/schema/aggregations.test.ts index 78fd6b88ea..be6df5bd6d 100644 --- a/packages/graphql/tests/schema/aggregations.test.ts +++ b/packages/graphql/tests/schema/aggregations.test.ts @@ -1803,4 +1803,1199 @@ describe("Aggregations", () => { }" `); }); + + test("Where Level Aggregations with arrays", async () => { + const typeDefs = gql` + type User @node { + someId: ID + someString: String + someFloat: Float + someInt: Int + someBigInt: BigInt + someDateTime: DateTime + someLocalDateTime: LocalDateTime + someLocalTime: LocalTime + someTime: Time + someDuration: Duration + } + + type Post @node { + title: String + likes: [User!]! @relationship(type: "LIKES", direction: IN, properties: "Likes") + } + + type Likes @relationshipProperties { + someId: [ID!]! + someString: [String!]! + someFloat: [Float!]! + someInt: [Int!]! + someBigInt: [BigInt!]! + someDateTime: [DateTime!]! + someLocalDateTime: [LocalDateTime!]! + someLocalTime: [LocalTime!]! + someTime: [Time!]! + someDuration: [Duration!]! + } + `; + const neoSchema = new Neo4jGraphQL({ typeDefs }); + const printedSchema = printSchemaWithDirectives(lexicographicSortSchema(await neoSchema.getSchema())); + + expect(printedSchema).toMatchInlineSnapshot(` + "schema { + query: Query + mutation: Mutation + } + + \\"\\"\\" + A BigInt value up to 64 bits in size, which can be a number or a string if used inline, or a string only if used as a variable. Always returned as a string. + \\"\\"\\" + scalar BigInt + + type BigIntAggregateSelection { + average: BigInt + max: BigInt + min: BigInt + sum: BigInt + } + + \\"\\"\\"BigInt list filters\\"\\"\\" + input BigIntListFilters { + eq: [BigIntScalarFilters!] + includes: BigIntScalarFilters + } + + \\"\\"\\"Filters for an aggregation of an BigInt field\\"\\"\\" + input BigIntScalarAggregationFilters { + average: BigIntScalarFilters + max: BigIntScalarFilters + min: BigIntScalarFilters + sum: BigIntScalarFilters + } + + \\"\\"\\"BigInt filters\\"\\"\\" + input BigIntScalarFilters { + eq: BigInt + gt: BigInt + gte: BigInt + in: [BigInt!] + lt: BigInt + lte: BigInt + } + + \\"\\"\\"BigInt mutations\\"\\"\\" + input BigIntScalarMutations { + add: BigInt + set: BigInt + subtract: BigInt + } + + \\"\\"\\" + Information about the number of nodes and relationships created during a create mutation + \\"\\"\\" + type CreateInfo { + nodesCreated: Int! + relationshipsCreated: Int! + } + + type CreatePostsMutationResponse { + info: CreateInfo! + posts: [Post!]! + } + + type CreateUsersMutationResponse { + info: CreateInfo! + users: [User!]! + } + + \\"\\"\\"A date and time, represented as an ISO-8601 string\\"\\"\\" + scalar DateTime + + type DateTimeAggregateSelection { + max: DateTime + min: DateTime + } + + \\"\\"\\"DateTime list filters\\"\\"\\" + input DateTimeListFilters { + eq: [DateTimeScalarFilters!] + includes: DateTimeScalarFilters + } + + \\"\\"\\"Filters for an aggregation of an DateTime input field\\"\\"\\" + input DateTimeScalarAggregationFilters { + max: DateTimeScalarFilters + min: DateTimeScalarFilters + } + + \\"\\"\\"DateTime filters\\"\\"\\" + input DateTimeScalarFilters { + eq: DateTime + gt: DateTime + gte: DateTime + in: [DateTime!] + lt: DateTime + lte: DateTime + } + + \\"\\"\\"DateTime mutations\\"\\"\\" + input DateTimeScalarMutations { + set: DateTime + } + + \\"\\"\\" + Information about the number of nodes and relationships deleted during a delete mutation + \\"\\"\\" + type DeleteInfo { + nodesDeleted: Int! + relationshipsDeleted: Int! + } + + \\"\\"\\"A duration, represented as an ISO 8601 duration string\\"\\"\\" + scalar Duration + + type DurationAggregateSelection { + max: Duration + min: Duration + } + + \\"\\"\\"Duration list filters\\"\\"\\" + input DurationListFilters { + eq: [DurationScalarFilters!] + includes: DurationScalarFilters + } + + \\"\\"\\"Filters for an aggregation of a Dutation input field\\"\\"\\" + input DurationScalarAggregationFilters { + average: DurationScalarFilters + max: DurationScalarFilters + min: DurationScalarFilters + } + + \\"\\"\\"Duration filters\\"\\"\\" + input DurationScalarFilters { + eq: Duration + gt: Duration + gte: Duration + in: [Duration!] + lt: Duration + lte: Duration + } + + \\"\\"\\"Duration mutations\\"\\"\\" + input DurationScalarMutations { + set: Duration + } + + type FloatAggregateSelection { + average: Float + max: Float + min: Float + sum: Float + } + + \\"\\"\\"Float list filters\\"\\"\\" + input FloatListFilters { + eq: [FloatScalarFilters!] + includes: FloatScalarFilters + } + + \\"\\"\\"Filters for an aggregation of a float field\\"\\"\\" + input FloatScalarAggregationFilters { + average: FloatScalarFilters + max: FloatScalarFilters + min: FloatScalarFilters + sum: FloatScalarFilters + } + + \\"\\"\\"Float filters\\"\\"\\" + input FloatScalarFilters { + eq: Float + gt: Float + gte: Float + in: [Float!] + lt: Float + lte: Float + } + + \\"\\"\\"Float mutations\\"\\"\\" + input FloatScalarMutations { + add: Float + divide: Float + multiply: Float + set: Float + subtract: Float + } + + type IDAggregateSelection { + longest: ID + shortest: ID + } + + \\"\\"\\"ID list filters\\"\\"\\" + input IDListFilters { + eq: [IDScalarFilters!] + includes: IDScalarFilters + } + + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + + \\"\\"\\"ID filters\\"\\"\\" + input IDScalarFilters { + contains: ID + endsWith: ID + eq: ID + gt: ID + gte: ID + in: [ID!] + lt: ID + lte: ID + matches: ID + startsWith: ID + } + + \\"\\"\\"ID mutations\\"\\"\\" + input IDScalarMutations { + set: ID + } + + type IntAggregateSelection { + average: Float + max: Int + min: Int + sum: Int + } + + \\"\\"\\"Int list filters\\"\\"\\" + input IntListFilters { + eq: [Int!] + includes: Int + } + + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + + \\"\\"\\"Int filters\\"\\"\\" + input IntScalarFilters { + eq: Int + gt: Int + gte: Int + in: [Int!] + lt: Int + lte: Int + } + + \\"\\"\\"Int mutations\\"\\"\\" + input IntScalarMutations { + add: Int + set: Int + subtract: Int + } + + \\"\\"\\" + The edge properties for the following fields: + * Post.likes + \\"\\"\\" + type Likes { + someBigInt: [BigInt!]! + someDateTime: [DateTime!]! + someDuration: [Duration!]! + someFloat: [Float!]! + someId: [ID!]! + someInt: [Int!]! + someLocalDateTime: [LocalDateTime!]! + someLocalTime: [LocalTime!]! + someString: [String!]! + someTime: [Time!]! + } + + input LikesCreateInput { + someBigInt: [BigInt!]! + someDateTime: [DateTime!]! + someDuration: [Duration!]! + someFloat: [Float!]! + someId: [ID!]! + someInt: [Int!]! + someLocalDateTime: [LocalDateTime!]! + someLocalTime: [LocalTime!]! + someString: [String!]! + someTime: [Time!]! + } + + input LikesSort { + someBigInt: SortDirection + someDateTime: SortDirection + someDuration: SortDirection + someFloat: SortDirection + someId: SortDirection + someInt: SortDirection + someLocalDateTime: SortDirection + someLocalTime: SortDirection + someString: SortDirection + someTime: SortDirection + } + + input LikesUpdateInput { + someBigInt: ListBigIntMutations + someBigInt_POP: Int + someBigInt_PUSH: [BigInt!] + someBigInt_SET: [BigInt!] + someDateTime: ListDateTimeMutations + someDateTime_POP: Int + someDateTime_PUSH: [DateTime!] + someDateTime_SET: [DateTime!] + someDuration: ListDurationMutations + someDuration_POP: Int + someDuration_PUSH: [Duration!] + someDuration_SET: [Duration!] + someFloat: ListFloatMutations + someFloat_POP: Int + someFloat_PUSH: [Float!] + someFloat_SET: [Float!] + someId: ListIDMutations + someId_POP: Int + someId_PUSH: [ID!] + someId_SET: [ID!] + someInt: ListIntMutations + someInt_POP: Int + someInt_PUSH: [Int!] + someInt_SET: [Int!] + someLocalDateTime: ListLocalDateTimeMutations + someLocalDateTime_POP: Int + someLocalDateTime_PUSH: [LocalDateTime!] + someLocalDateTime_SET: [LocalDateTime!] + someLocalTime: ListLocalTimeMutations + someLocalTime_POP: Int + someLocalTime_PUSH: [LocalTime!] + someLocalTime_SET: [LocalTime!] + someString: ListStringMutations + someString_POP: Int + someString_PUSH: [String!] + someString_SET: [String!] + someTime: ListTimeMutations + someTime_POP: Int + someTime_PUSH: [Time!] + someTime_SET: [Time!] + } + + input LikesWhere { + AND: [LikesWhere!] + NOT: LikesWhere + OR: [LikesWhere!] + someBigInt: BigIntListFilters + someBigInt_EQ: [BigInt!] + someBigInt_INCLUDES: BigInt + someDateTime: DateTimeListFilters + someDateTime_EQ: [DateTime!] + someDateTime_INCLUDES: DateTime + someDuration: DurationListFilters + someDuration_EQ: [Duration!] + someDuration_INCLUDES: Duration + someFloat: FloatListFilters + someFloat_EQ: [Float!] + someFloat_INCLUDES: Float + someId: IDListFilters + someId_EQ: [ID!] + someId_INCLUDES: ID + someInt: IntListFilters + someInt_EQ: [Int!] + someInt_INCLUDES: Int + someLocalDateTime: LocalDateTimeListFilters + someLocalDateTime_EQ: [LocalDateTime!] + someLocalDateTime_INCLUDES: LocalDateTime + someLocalTime: LocalTimeListFilters + someLocalTime_EQ: [LocalTime!] + someLocalTime_INCLUDES: LocalTime + someString: StringListFilters + someString_EQ: [String!] + someString_INCLUDES: String + someTime: TimeListFilters + someTime_EQ: [Time!] + someTime_INCLUDES: Time + } + + \\"\\"\\"Mutations for a list for BigInt\\"\\"\\" + input ListBigIntMutations { + pop: Int + push: [BigInt!] + set: [BigInt!] + } + + \\"\\"\\"Mutations for a list for DateTime\\"\\"\\" + input ListDateTimeMutations { + pop: Int + push: [DateTime!] + set: [DateTime!] + } + + \\"\\"\\"Mutations for a list for Duration\\"\\"\\" + input ListDurationMutations { + pop: Int + push: [Duration!] + set: [Duration!] + } + + \\"\\"\\"Mutations for a list for Float\\"\\"\\" + input ListFloatMutations { + pop: Int + push: [Float!] + set: [Float!] + } + + \\"\\"\\"Mutations for a list for ID\\"\\"\\" + input ListIDMutations { + pop: Int + push: [ID!] + set: [ID!] + } + + \\"\\"\\"Mutations for a list for Int\\"\\"\\" + input ListIntMutations { + pop: Int + push: [Int!] + set: [Int!] + } + + \\"\\"\\"Mutations for a list for LocalDateTime\\"\\"\\" + input ListLocalDateTimeMutations { + pop: Int + push: [LocalDateTime!] + set: [LocalDateTime!] + } + + \\"\\"\\"Mutations for a list for LocalTime\\"\\"\\" + input ListLocalTimeMutations { + pop: Int + push: [LocalTime!] + set: [LocalTime!] + } + + \\"\\"\\"Mutations for a list for String\\"\\"\\" + input ListStringMutations { + pop: Int + push: [String!] + set: [String!] + } + + \\"\\"\\"Mutations for a list for Time\\"\\"\\" + input ListTimeMutations { + pop: Int + push: [Time!] + set: [Time!] + } + + \\"\\"\\"A local datetime, represented as 'YYYY-MM-DDTHH:MM:SS'\\"\\"\\" + scalar LocalDateTime + + type LocalDateTimeAggregateSelection { + max: LocalDateTime + min: LocalDateTime + } + + \\"\\"\\"LocalDateTime list filters\\"\\"\\" + input LocalDateTimeListFilters { + eq: [LocalDateTimeScalarFilters!] + includes: LocalDateTimeScalarFilters + } + + \\"\\"\\"Filters for an aggregation of an LocalDateTime input field\\"\\"\\" + input LocalDateTimeScalarAggregationFilters { + max: LocalDateTimeScalarFilters + min: LocalDateTimeScalarFilters + } + + \\"\\"\\"LocalDateTime filters\\"\\"\\" + input LocalDateTimeScalarFilters { + eq: LocalDateTime + gt: LocalDateTime + gte: LocalDateTime + in: [LocalDateTime!] + lt: LocalDateTime + lte: LocalDateTime + } + + \\"\\"\\"LocalDateTime mutations\\"\\"\\" + input LocalDateTimeScalarMutations { + set: LocalDateTime + } + + \\"\\"\\" + A local time, represented as a time string without timezone information + \\"\\"\\" + scalar LocalTime + + type LocalTimeAggregateSelection { + max: LocalTime + min: LocalTime + } + + \\"\\"\\"LocalTime list filters\\"\\"\\" + input LocalTimeListFilters { + eq: [LocalTimeScalarFilters!] + includes: LocalTimeScalarFilters + } + + \\"\\"\\"Filters for an aggregation of an LocalTime input field\\"\\"\\" + input LocalTimeScalarAggregationFilters { + max: LocalTimeScalarFilters + min: LocalTimeScalarFilters + } + + \\"\\"\\"LocalTime filters\\"\\"\\" + input LocalTimeScalarFilters { + eq: LocalTime + gt: LocalTime + gte: LocalTime + in: [LocalTime!] + lt: LocalTime + lte: LocalTime + } + + \\"\\"\\"LocalTime mutations\\"\\"\\" + input LocalTimeScalarMutations { + set: LocalTime + } + + type Mutation { + createPosts(input: [PostCreateInput!]!): CreatePostsMutationResponse! + createUsers(input: [UserCreateInput!]!): CreateUsersMutationResponse! + deletePosts(delete: PostDeleteInput, where: PostWhere): DeleteInfo! + deleteUsers(where: UserWhere): DeleteInfo! + updatePosts(update: PostUpdateInput, where: PostWhere): UpdatePostsMutationResponse! + updateUsers(update: UserUpdateInput, where: UserWhere): UpdateUsersMutationResponse! + } + + \\"\\"\\"Pagination information (Relay)\\"\\"\\" + type PageInfo { + endCursor: String + hasNextPage: Boolean! + hasPreviousPage: Boolean! + startCursor: String + } + + type Post { + likes(limit: Int, offset: Int, sort: [UserSort!], where: UserWhere): [User!]! + likesAggregate(where: UserWhere): PostUserLikesAggregationSelection + likesConnection(after: String, first: Int, sort: [PostLikesConnectionSort!], where: PostLikesConnectionWhere): PostLikesConnection! + title: String + } + + type PostAggregateSelection { + count: Int! + title: StringAggregateSelection! + } + + input PostCreateInput { + likes: PostLikesFieldInput + title: String + } + + input PostDeleteInput { + likes: [PostLikesDeleteFieldInput!] + } + + type PostEdge { + cursor: String! + node: Post! + } + + input PostLikesAggregateInput { + AND: [PostLikesAggregateInput!] + NOT: PostLikesAggregateInput + OR: [PostLikesAggregateInput!] + count: IntScalarFilters + count_EQ: Int + count_GT: Int + count_GTE: Int + count_LT: Int + count_LTE: Int + node: PostLikesNodeAggregationWhereInput + } + + input PostLikesConnectFieldInput { + edge: LikesCreateInput! + where: UserConnectWhere + } + + type PostLikesConnection { + edges: [PostLikesRelationship!]! + pageInfo: PageInfo! + totalCount: Int! + } + + input PostLikesConnectionSort { + edge: LikesSort + node: UserSort + } + + input PostLikesConnectionWhere { + AND: [PostLikesConnectionWhere!] + NOT: PostLikesConnectionWhere + OR: [PostLikesConnectionWhere!] + edge: LikesWhere + node: UserWhere + } + + input PostLikesCreateFieldInput { + edge: LikesCreateInput! + node: UserCreateInput! + } + + input PostLikesDeleteFieldInput { + where: PostLikesConnectionWhere + } + + input PostLikesDisconnectFieldInput { + where: PostLikesConnectionWhere + } + + input PostLikesFieldInput { + connect: [PostLikesConnectFieldInput!] + create: [PostLikesCreateFieldInput!] + } + + input PostLikesNodeAggregationWhereInput { + AND: [PostLikesNodeAggregationWhereInput!] + NOT: PostLikesNodeAggregationWhereInput + OR: [PostLikesNodeAggregationWhereInput!] + someBigInt: BigIntScalarAggregationFilters + someBigInt_AVERAGE_EQUAL: BigInt + someBigInt_AVERAGE_GT: BigInt + someBigInt_AVERAGE_GTE: BigInt + someBigInt_AVERAGE_LT: BigInt + someBigInt_AVERAGE_LTE: BigInt + someBigInt_MAX_EQUAL: BigInt + someBigInt_MAX_GT: BigInt + someBigInt_MAX_GTE: BigInt + someBigInt_MAX_LT: BigInt + someBigInt_MAX_LTE: BigInt + someBigInt_MIN_EQUAL: BigInt + someBigInt_MIN_GT: BigInt + someBigInt_MIN_GTE: BigInt + someBigInt_MIN_LT: BigInt + someBigInt_MIN_LTE: BigInt + someBigInt_SUM_EQUAL: BigInt + someBigInt_SUM_GT: BigInt + someBigInt_SUM_GTE: BigInt + someBigInt_SUM_LT: BigInt + someBigInt_SUM_LTE: BigInt + someDateTime: DateTimeScalarAggregationFilters + someDateTime_MAX_EQUAL: DateTime + someDateTime_MAX_GT: DateTime + someDateTime_MAX_GTE: DateTime + someDateTime_MAX_LT: DateTime + someDateTime_MAX_LTE: DateTime + someDateTime_MIN_EQUAL: DateTime + someDateTime_MIN_GT: DateTime + someDateTime_MIN_GTE: DateTime + someDateTime_MIN_LT: DateTime + someDateTime_MIN_LTE: DateTime + someDuration: DurationScalarAggregationFilters + someDuration_AVERAGE_EQUAL: Duration + someDuration_AVERAGE_GT: Duration + someDuration_AVERAGE_GTE: Duration + someDuration_AVERAGE_LT: Duration + someDuration_AVERAGE_LTE: Duration + someDuration_MAX_EQUAL: Duration + someDuration_MAX_GT: Duration + someDuration_MAX_GTE: Duration + someDuration_MAX_LT: Duration + someDuration_MAX_LTE: Duration + someDuration_MIN_EQUAL: Duration + someDuration_MIN_GT: Duration + someDuration_MIN_GTE: Duration + someDuration_MIN_LT: Duration + someDuration_MIN_LTE: Duration + someFloat: FloatScalarAggregationFilters + someFloat_AVERAGE_EQUAL: Float + someFloat_AVERAGE_GT: Float + someFloat_AVERAGE_GTE: Float + someFloat_AVERAGE_LT: Float + someFloat_AVERAGE_LTE: Float + someFloat_MAX_EQUAL: Float + someFloat_MAX_GT: Float + someFloat_MAX_GTE: Float + someFloat_MAX_LT: Float + someFloat_MAX_LTE: Float + someFloat_MIN_EQUAL: Float + someFloat_MIN_GT: Float + someFloat_MIN_GTE: Float + someFloat_MIN_LT: Float + someFloat_MIN_LTE: Float + someFloat_SUM_EQUAL: Float + someFloat_SUM_GT: Float + someFloat_SUM_GTE: Float + someFloat_SUM_LT: Float + someFloat_SUM_LTE: Float + someId: IDScalarAggregationFilters + someId_MAX_EQUAL: ID + someId_MAX_GT: ID + someId_MAX_GTE: ID + someId_MAX_LT: ID + someId_MAX_LTE: ID + someId_MIN_EQUAL: ID + someId_MIN_GT: ID + someId_MIN_GTE: ID + someId_MIN_LT: ID + someId_MIN_LTE: ID + someInt: IntScalarAggregationFilters + someInt_AVERAGE_EQUAL: Float + someInt_AVERAGE_GT: Float + someInt_AVERAGE_GTE: Float + someInt_AVERAGE_LT: Float + someInt_AVERAGE_LTE: Float + someInt_MAX_EQUAL: Int + someInt_MAX_GT: Int + someInt_MAX_GTE: Int + someInt_MAX_LT: Int + someInt_MAX_LTE: Int + someInt_MIN_EQUAL: Int + someInt_MIN_GT: Int + someInt_MIN_GTE: Int + someInt_MIN_LT: Int + someInt_MIN_LTE: Int + someInt_SUM_EQUAL: Int + someInt_SUM_GT: Int + someInt_SUM_GTE: Int + someInt_SUM_LT: Int + someInt_SUM_LTE: Int + someLocalDateTime: LocalDateTimeScalarAggregationFilters + someLocalDateTime_MAX_EQUAL: LocalDateTime + someLocalDateTime_MAX_GT: LocalDateTime + someLocalDateTime_MAX_GTE: LocalDateTime + someLocalDateTime_MAX_LT: LocalDateTime + someLocalDateTime_MAX_LTE: LocalDateTime + someLocalDateTime_MIN_EQUAL: LocalDateTime + someLocalDateTime_MIN_GT: LocalDateTime + someLocalDateTime_MIN_GTE: LocalDateTime + someLocalDateTime_MIN_LT: LocalDateTime + someLocalDateTime_MIN_LTE: LocalDateTime + someLocalTime: LocalTimeScalarAggregationFilters + someLocalTime_MAX_EQUAL: LocalTime + someLocalTime_MAX_GT: LocalTime + someLocalTime_MAX_GTE: LocalTime + someLocalTime_MAX_LT: LocalTime + someLocalTime_MAX_LTE: LocalTime + someLocalTime_MIN_EQUAL: LocalTime + someLocalTime_MIN_GT: LocalTime + someLocalTime_MIN_GTE: LocalTime + someLocalTime_MIN_LT: LocalTime + someLocalTime_MIN_LTE: LocalTime + someString: StringScalarAggregationFilters + someString_AVERAGE_LENGTH_EQUAL: Float + someString_AVERAGE_LENGTH_GT: Float + someString_AVERAGE_LENGTH_GTE: Float + someString_AVERAGE_LENGTH_LT: Float + someString_AVERAGE_LENGTH_LTE: Float + someString_LONGEST_LENGTH_EQUAL: Int + someString_LONGEST_LENGTH_GT: Int + someString_LONGEST_LENGTH_GTE: Int + someString_LONGEST_LENGTH_LT: Int + someString_LONGEST_LENGTH_LTE: Int + someString_SHORTEST_LENGTH_EQUAL: Int + someString_SHORTEST_LENGTH_GT: Int + someString_SHORTEST_LENGTH_GTE: Int + someString_SHORTEST_LENGTH_LT: Int + someString_SHORTEST_LENGTH_LTE: Int + someTime: TimeScalarAggregationFilters + someTime_MAX_EQUAL: Time + someTime_MAX_GT: Time + someTime_MAX_GTE: Time + someTime_MAX_LT: Time + someTime_MAX_LTE: Time + someTime_MIN_EQUAL: Time + someTime_MIN_GT: Time + someTime_MIN_GTE: Time + someTime_MIN_LT: Time + someTime_MIN_LTE: Time + } + + type PostLikesRelationship { + cursor: String! + node: User! + properties: Likes! + } + + input PostLikesUpdateConnectionInput { + edge: LikesUpdateInput + node: UserUpdateInput + } + + input PostLikesUpdateFieldInput { + connect: [PostLikesConnectFieldInput!] + create: [PostLikesCreateFieldInput!] + delete: [PostLikesDeleteFieldInput!] + disconnect: [PostLikesDisconnectFieldInput!] + update: PostLikesUpdateConnectionInput + where: PostLikesConnectionWhere + } + + \\"\\"\\" + Fields to sort Posts by. The order in which sorts are applied is not guaranteed when specifying many fields in one PostSort object. + \\"\\"\\" + input PostSort { + title: SortDirection + } + + input PostUpdateInput { + likes: [PostLikesUpdateFieldInput!] + title: StringScalarMutations + title_SET: String + } + + type PostUserLikesAggregationSelection { + count: Int! + node: PostUserLikesNodeAggregateSelection + } + + type PostUserLikesNodeAggregateSelection { + someBigInt: BigIntAggregateSelection! + someDateTime: DateTimeAggregateSelection! + someDuration: DurationAggregateSelection! + someFloat: FloatAggregateSelection! + someId: IDAggregateSelection! + someInt: IntAggregateSelection! + someLocalDateTime: LocalDateTimeAggregateSelection! + someLocalTime: LocalTimeAggregateSelection! + someString: StringAggregateSelection! + someTime: TimeAggregateSelection! + } + + input PostWhere { + AND: [PostWhere!] + NOT: PostWhere + OR: [PostWhere!] + likesAggregate: PostLikesAggregateInput + \\"\\"\\" + Return Posts where all of the related PostLikesConnections match this filter + \\"\\"\\" + likesConnection_ALL: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where none of the related PostLikesConnections match this filter + \\"\\"\\" + likesConnection_NONE: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where one of the related PostLikesConnections match this filter + \\"\\"\\" + likesConnection_SINGLE: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where some of the related PostLikesConnections match this filter + \\"\\"\\" + likesConnection_SOME: PostLikesConnectionWhere + \\"\\"\\"Return Posts where all of the related Users match this filter\\"\\"\\" + likes_ALL: UserWhere + \\"\\"\\"Return Posts where none of the related Users match this filter\\"\\"\\" + likes_NONE: UserWhere + \\"\\"\\"Return Posts where one of the related Users match this filter\\"\\"\\" + likes_SINGLE: UserWhere + \\"\\"\\"Return Posts where some of the related Users match this filter\\"\\"\\" + likes_SOME: UserWhere + title: StringScalarFilters + title_CONTAINS: String + title_ENDS_WITH: String + title_EQ: String + title_IN: [String] + title_STARTS_WITH: String + } + + type PostsConnection { + edges: [PostEdge!]! + pageInfo: PageInfo! + totalCount: Int! + } + + type Query { + posts(limit: Int, offset: Int, sort: [PostSort!], where: PostWhere): [Post!]! + postsAggregate(where: PostWhere): PostAggregateSelection! + postsConnection(after: String, first: Int, sort: [PostSort!], where: PostWhere): PostsConnection! + users(limit: Int, offset: Int, sort: [UserSort!], where: UserWhere): [User!]! + usersAggregate(where: UserWhere): UserAggregateSelection! + usersConnection(after: String, first: Int, sort: [UserSort!], where: UserWhere): UsersConnection! + } + + \\"\\"\\"An enum for sorting in either ascending or descending order.\\"\\"\\" + enum SortDirection { + \\"\\"\\"Sort by field values in ascending order.\\"\\"\\" + ASC + \\"\\"\\"Sort by field values in descending order.\\"\\"\\" + DESC + } + + type StringAggregateSelection { + longest: String + shortest: String + } + + \\"\\"\\"String list filters\\"\\"\\" + input StringListFilters { + eq: [String!] + includes: String + } + + \\"\\"\\"Filters for an aggregation of a string field\\"\\"\\" + input StringScalarAggregationFilters { + averageLength: FloatScalarFilters + longestLength: IntScalarFilters + shortestLength: IntScalarFilters + } + + \\"\\"\\"String filters\\"\\"\\" + input StringScalarFilters { + contains: String + endsWith: String + eq: String + gt: String + gte: String + in: [String!] + lt: String + lte: String + matches: String + startsWith: String + } + + \\"\\"\\"String mutations\\"\\"\\" + input StringScalarMutations { + set: String + } + + \\"\\"\\"A time, represented as an RFC3339 time string\\"\\"\\" + scalar Time + + type TimeAggregateSelection { + max: Time + min: Time + } + + \\"\\"\\"Time list filters\\"\\"\\" + input TimeListFilters { + eq: [Time!] + includes: Time + } + + \\"\\"\\"Filters for an aggregation of an Time input field\\"\\"\\" + input TimeScalarAggregationFilters { + max: TimeScalarFilters + min: TimeScalarFilters + } + + \\"\\"\\"Time filters\\"\\"\\" + input TimeScalarFilters { + eq: Time + gt: Time + gte: Time + in: [Time!] + lt: Time + lte: Time + } + + \\"\\"\\"Time mutations\\"\\"\\" + input TimeScalarMutations { + set: Time + } + + \\"\\"\\" + Information about the number of nodes and relationships created and deleted during an update mutation + \\"\\"\\" + type UpdateInfo { + nodesCreated: Int! + nodesDeleted: Int! + relationshipsCreated: Int! + relationshipsDeleted: Int! + } + + type UpdatePostsMutationResponse { + info: UpdateInfo! + posts: [Post!]! + } + + type UpdateUsersMutationResponse { + info: UpdateInfo! + users: [User!]! + } + + type User { + someBigInt: BigInt + someDateTime: DateTime + someDuration: Duration + someFloat: Float + someId: ID + someInt: Int + someLocalDateTime: LocalDateTime + someLocalTime: LocalTime + someString: String + someTime: Time + } + + type UserAggregateSelection { + count: Int! + someBigInt: BigIntAggregateSelection! + someDateTime: DateTimeAggregateSelection! + someDuration: DurationAggregateSelection! + someFloat: FloatAggregateSelection! + someId: IDAggregateSelection! + someInt: IntAggregateSelection! + someLocalDateTime: LocalDateTimeAggregateSelection! + someLocalTime: LocalTimeAggregateSelection! + someString: StringAggregateSelection! + someTime: TimeAggregateSelection! + } + + input UserConnectWhere { + node: UserWhere! + } + + input UserCreateInput { + someBigInt: BigInt + someDateTime: DateTime + someDuration: Duration + someFloat: Float + someId: ID + someInt: Int + someLocalDateTime: LocalDateTime + someLocalTime: LocalTime + someString: String + someTime: Time + } + + type UserEdge { + cursor: String! + node: User! + } + + \\"\\"\\" + Fields to sort Users by. The order in which sorts are applied is not guaranteed when specifying many fields in one UserSort object. + \\"\\"\\" + input UserSort { + someBigInt: SortDirection + someDateTime: SortDirection + someDuration: SortDirection + someFloat: SortDirection + someId: SortDirection + someInt: SortDirection + someLocalDateTime: SortDirection + someLocalTime: SortDirection + someString: SortDirection + someTime: SortDirection + } + + input UserUpdateInput { + someBigInt: BigIntScalarMutations + someBigInt_DECREMENT: BigInt + someBigInt_INCREMENT: BigInt + someBigInt_SET: BigInt + someDateTime: DateTimeScalarMutations + someDateTime_SET: DateTime + someDuration: DurationScalarMutations + someDuration_SET: Duration + someFloat: FloatScalarMutations + someFloat_ADD: Float + someFloat_DIVIDE: Float + someFloat_MULTIPLY: Float + someFloat_SET: Float + someFloat_SUBTRACT: Float + someId: IDScalarMutations + someId_SET: ID + someInt: IntScalarMutations + someInt_DECREMENT: Int + someInt_INCREMENT: Int + someInt_SET: Int + someLocalDateTime: LocalDateTimeScalarMutations + someLocalDateTime_SET: LocalDateTime + someLocalTime: LocalTimeScalarMutations + someLocalTime_SET: LocalTime + someString: StringScalarMutations + someString_SET: String + someTime: TimeScalarMutations + someTime_SET: Time + } + + input UserWhere { + AND: [UserWhere!] + NOT: UserWhere + OR: [UserWhere!] + someBigInt: BigIntScalarFilters + someBigInt_EQ: BigInt + someBigInt_GT: BigInt + someBigInt_GTE: BigInt + someBigInt_IN: [BigInt] + someBigInt_LT: BigInt + someBigInt_LTE: BigInt + someDateTime: DateTimeScalarFilters + someDateTime_EQ: DateTime + someDateTime_GT: DateTime + someDateTime_GTE: DateTime + someDateTime_IN: [DateTime] + someDateTime_LT: DateTime + someDateTime_LTE: DateTime + someDuration: DurationScalarFilters + someDuration_EQ: Duration + someDuration_GT: Duration + someDuration_GTE: Duration + someDuration_IN: [Duration] + someDuration_LT: Duration + someDuration_LTE: Duration + someFloat: FloatScalarFilters + someFloat_EQ: Float + someFloat_GT: Float + someFloat_GTE: Float + someFloat_IN: [Float] + someFloat_LT: Float + someFloat_LTE: Float + someId: IDScalarFilters + someId_CONTAINS: ID + someId_ENDS_WITH: ID + someId_EQ: ID + someId_IN: [ID] + someId_STARTS_WITH: ID + someInt: IntScalarFilters + someInt_EQ: Int + someInt_GT: Int + someInt_GTE: Int + someInt_IN: [Int] + someInt_LT: Int + someInt_LTE: Int + someLocalDateTime: LocalDateTimeScalarFilters + someLocalDateTime_EQ: LocalDateTime + someLocalDateTime_GT: LocalDateTime + someLocalDateTime_GTE: LocalDateTime + someLocalDateTime_IN: [LocalDateTime] + someLocalDateTime_LT: LocalDateTime + someLocalDateTime_LTE: LocalDateTime + someLocalTime: LocalTimeScalarFilters + someLocalTime_EQ: LocalTime + someLocalTime_GT: LocalTime + someLocalTime_GTE: LocalTime + someLocalTime_IN: [LocalTime] + someLocalTime_LT: LocalTime + someLocalTime_LTE: LocalTime + someString: StringScalarFilters + someString_CONTAINS: String + someString_ENDS_WITH: String + someString_EQ: String + someString_IN: [String] + someString_STARTS_WITH: String + someTime: TimeScalarFilters + someTime_EQ: Time + someTime_GT: Time + someTime_GTE: Time + someTime_IN: [Time] + someTime_LT: Time + someTime_LTE: Time + } + + type UsersConnection { + edges: [UserEdge!]! + pageInfo: PageInfo! + totalCount: Int! + }" + `); + }); }); From 08c43201f40d613991be1002ac456b9cde0c99a5 Mon Sep 17 00:00:00 2001 From: angrykoala Date: Thu, 12 Dec 2024 12:44:40 +0000 Subject: [PATCH 4/5] Remove commented code --- .../BigIntScalarAggregationFilters.ts | 9 --------- .../DateTimeScalarAggregationFilters.ts | 9 --------- .../DurationScalarAggregationFilters.ts | 9 --------- .../FloatScalarAggregationFilters.ts | 9 --------- .../IDScalarAggregationFilters.ts | 9 --------- .../IntScalarAggregationFilters.ts | 9 --------- .../LocalDateTimeScalarAggregationFilters.ts | 9 --------- .../LocalTimeScalarAggregationFilters.ts | 9 --------- .../StringScalarAggregationFilters.ts | 9 --------- .../TimeScalarAggregationFilters.ts | 9 --------- 10 files changed, 90 deletions(-) diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts index d1b534d794..c8f09f3a2f 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts @@ -30,12 +30,3 @@ export const BigIntScalarAggregationFilters = new GraphQLInputObjectType({ sum: { type: BigIntScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts index 4d9515a7f0..e58747a8f3 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts @@ -28,12 +28,3 @@ export const DateTimeScalarAggregationFilters = new GraphQLInputObjectType({ min: { type: DateTimeScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts index df6e4148f8..3853c5d534 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts @@ -29,12 +29,3 @@ export const DurationScalarAggregationFilters = new GraphQLInputObjectType({ average: { type: DurationScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts index 5e45c3ae95..2040199bb8 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts @@ -30,12 +30,3 @@ export const FloatScalarAggregationFilters = new GraphQLInputObjectType({ sum: { type: FloatScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts index cb9f43cd20..128a97a1b9 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts @@ -28,12 +28,3 @@ export const IDScalarAggregationFilters = new GraphQLInputObjectType({ min: { type: IDScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts index 5f51e3aeca..93f13eebe9 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts @@ -31,12 +31,3 @@ export const IntScalarAggregationFilters = new GraphQLInputObjectType({ sum: { type: IntScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts index 3e6892023f..f5def1a0ce 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts @@ -28,12 +28,3 @@ export const LocalDateTimeScalarAggregationFilters = new GraphQLInputObjectType( min: { type: LocalDateTimeScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts index c286a953cb..031e769c54 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts @@ -28,12 +28,3 @@ export const LocalTimeScalarAggregationFilters = new GraphQLInputObjectType({ min: { type: LocalTimeScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts index 3f8ea225c9..a3318322f9 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts @@ -30,12 +30,3 @@ export const StringScalarAggregationFilters = new GraphQLInputObjectType({ longestLength: { type: IntScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); diff --git a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts index d78bcfd6bd..c98495b819 100644 --- a/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts @@ -28,12 +28,3 @@ export const TimeScalarAggregationFilters = new GraphQLInputObjectType({ min: { type: TimeScalarFilters }, }, }); - -// export const IntListFilters = new GraphQLInputObjectType({ -// name: "IntListFilters", -// description: "Int list filters", -// fields: { -// equals: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, -// includes: { type: GraphQLInt }, -// }, -// }); From 8fcfe20246058642c561b545db4b0d0eff9e4b0a Mon Sep 17 00:00:00 2001 From: angrykoala Date: Fri, 13 Dec 2024 09:46:53 +0000 Subject: [PATCH 5/5] code review changes --- .../src/translate/queryAST/factory/FilterFactory.ts | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts index a851b32742..d1db1b3621 100644 --- a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts +++ b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts @@ -580,21 +580,17 @@ export class FilterFactory { private parseGenericOperator(key: string): FilterOperator { // we convert them to the previous format to keep the same translation logic switch (key) { - case "equals": case "eq": return "EQ"; case "in": return "IN"; - case "lessThan": // TODO: remove long syntax once tests have been updated case "lt": return "LT"; - case "lessThanEquals": case "lte": return "LTE"; case "greaterThan": case "gt": return "GT"; - case "greaterThanEquals": case "gte": return "GTE"; case "contains": @@ -616,19 +612,14 @@ export class FilterFactory { private parseGenericOperatorForAggregation(key: string): AggregationLogicalOperator { // we convert them to the previous format to keep the same translation logic switch (key) { - case "equals": case "eq": return "EQUAL"; - case "lessThan": // TODO: remove long syntax once tests have been updated case "lt": return "LT"; - case "lessThanEquals": case "lte": return "LTE"; - case "greaterThan": case "gt": return "GT"; - case "greaterThanEquals": case "gte": return "GTE"; @@ -870,7 +861,7 @@ export class FilterFactory { if (!aggregationOperator) { const filters = Object.entries(value).flatMap(([aggregationOperator, value]) => { - const parsedAggregationOperation = this.parsedGenericAggregationOperator(aggregationOperator); + const parsedAggregationOperation = this.parseGenericAggregationOperator(aggregationOperator); // NOTE: this part is duplicate of the code used for non-generic operators return Object.entries(value as Record).map(([operator, value]) => { @@ -988,7 +979,7 @@ export class FilterFactory { return targetPoint; } - private parsedGenericAggregationOperator(key: string): AggregationOperator { + private parseGenericAggregationOperator(key: string): AggregationOperator { // we convert them to the previous format to keep the same translation logic switch (key) { case "averageLength":