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/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..c8f09f3a2f --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts @@ -0,0 +1,32 @@ +/* + * 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 }, + }, +}); 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..e58747a8f3 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts @@ -0,0 +1,30 @@ +/* + * 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 }, + }, +}); 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..3853c5d534 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts @@ -0,0 +1,31 @@ +/* + * 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 }, + }, +}); 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..2040199bb8 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts @@ -0,0 +1,32 @@ +/* + * 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 }, + }, +}); 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..128a97a1b9 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IDScalarAggregationFilters.ts @@ -0,0 +1,30 @@ +/* + * 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 }, + }, +}); 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..93f13eebe9 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts @@ -0,0 +1,33 @@ +/* + * 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 }, + }, +}); 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..f5def1a0ce --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalDateTimeScalarAggregationFilters.ts @@ -0,0 +1,30 @@ +/* + * 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 }, + }, +}); 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..031e769c54 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/LocalTimeScalarAggregationFilters.ts @@ -0,0 +1,30 @@ +/* + * 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 }, + }, +}); 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..a3318322f9 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/StringScalarAggregationFilters.ts @@ -0,0 +1,32 @@ +/* + * 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 }, + }, +}); 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..c98495b819 --- /dev/null +++ b/packages/graphql/src/graphql/input-objects/generic-aggregation-filters/TimeScalarAggregationFilters.ts @@ -0,0 +1,30 @@ +/* + * 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 }, + }, +}); diff --git a/packages/graphql/src/schema/generation/aggregate-types.ts b/packages/graphql/src/schema/generation/aggregate-types.ts index bb3bce3973..3dec6b4782 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"; @@ -35,6 +36,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 +108,7 @@ export function withAggregateInputType({ count_LTE: GraphQLInt, count_GT: GraphQLInt, count_GTE: GraphQLInt, + count: IntScalarFilters, }, }); @@ -190,6 +193,9 @@ function makeAggregationFields( const fields: InputTypeComposerFieldConfigMapDefinition = {}; for (const attribute of attributes) { addAggregationFieldsByType(attribute, userDefinedDirectivesOnTargetFields?.get(attribute.name), fields); + if (attribute.isAggregationWhereField()) { + fields[attribute.name] = getAggregationFilterFromAttributeType(attribute); + } } return fields; } @@ -218,6 +224,7 @@ function addAggregationFieldsByType( directives: deprecatedDirectives, }; } + return fields; } if (attribute.typeHelper.isNumeric() || attribute.typeHelper.isDuration()) { @@ -247,6 +254,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..fb2cef7bb1 --- /dev/null +++ b/packages/graphql/src/schema/generation/get-aggregation-filter-from-attribute-type.ts @@ -0,0 +1,71 @@ +/* + * 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 { + if (attribute.typeHelper.isList()) { + throw new Error("List types not available for aggregations"); + } + + if (attribute.typeHelper.isID()) { + return IDScalarAggregationFilters; + } + if (attribute.typeHelper.isString()) { + return StringScalarAggregationFilters; + } + if (attribute.typeHelper.isInt()) { + return IntScalarAggregationFilters; + } + if (attribute.typeHelper.isFloat()) { + return FloatScalarAggregationFilters; + } + if (attribute.typeHelper.isBigInt()) { + return BigIntScalarAggregationFilters; + } + if (attribute.typeHelper.isTime()) { + return TimeScalarAggregationFilters; + } + + if (attribute.typeHelper.isDateTime()) { + return DateTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isLocalTime()) { + return LocalTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isLocalDateTime()) { + return LocalDateTimeScalarAggregationFilters; + } + if (attribute.typeHelper.isDuration()) { + return DurationScalarAggregationFilters; + } + + throw new Error(`No scalar filter found for attribute ${attribute.type.name}`); +} diff --git a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts index 6fa72887d7..d1db1b3621 100644 --- a/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts +++ b/packages/graphql/src/translate/queryAST/factory/FilterFactory.ts @@ -51,7 +51,12 @@ 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 { parseAggregationWhereFields, parseWhereField } from "./parsers/parse-where-field"; +import { + parseAggregationWhereFields, + parseWhereField, + type AggregationLogicalOperator, + type AggregationOperator, +} from "./parsers/parse-where-field"; type AggregateWhereInput = { count: number; @@ -575,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": @@ -608,6 +609,24 @@ 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 "eq": + return "EQUAL"; + case "lt": + return "LT"; + case "lte": + return "LTE"; + case "gt": + return "GT"; + case "gte": + return "GTE"; + + default: + throw new Error(`Invalid operator ${key}`); + } + } private convertRelationshipOperatorToLegacyOperator(operator: string): RelationshipWhereOperator { switch (operator) { @@ -771,10 +790,20 @@ export class FilterFactory { } const { fieldName, operator } = 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, + comparisonValue: value, + }); + }); + } + const countFilter = new CountFilter({ - operator: filterOperator, + operator: operator ?? "EQ", comparisonValue: value, }); return [countFilter]; @@ -812,7 +841,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); @@ -830,6 +859,36 @@ export class FilterFactory { const attachedTo = entity instanceof RelationshipAdapter ? "relationship" : "node"; + if (!aggregationOperator) { + const filters = Object.entries(value).flatMap(([aggregationOperator, value]) => { + 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]) => { + 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, @@ -919,4 +978,27 @@ export class FilterFactory { } return targetPoint; } + + private parseGenericAggregationOperator(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 269d2860b3..af3c9740f1 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 @@ -1148,6 +1213,7 @@ describe("Aggregations", () => { AND: [PostLikesAggregateInput!] NOT: PostLikesAggregateInput OR: [PostLikesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1222,6 +1288,7 @@ describe("Aggregations", () => { AND: [PostLikesNodeAggregationWhereInput!] NOT: PostLikesNodeAggregationWhereInput OR: [PostLikesNodeAggregationWhereInput!] + someBigInt: BigIntScalarAggregationFilters someBigInt_AVERAGE_EQUAL: BigInt someBigInt_AVERAGE_GT: BigInt someBigInt_AVERAGE_GTE: BigInt @@ -1242,6 +1309,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 @@ -1252,6 +1320,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 @@ -1267,6 +1336,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 @@ -1287,6 +1357,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 @@ -1297,6 +1368,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 @@ -1317,6 +1389,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 @@ -1327,6 +1400,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 @@ -1337,6 +1411,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 @@ -1352,6 +1427,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 @@ -1507,6 +1583,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 @@ -1534,6 +1617,1239 @@ 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 + 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 @deprecated(reason: \\"Please use the relevant generic mutation 'someBigInt: { decrement: ... } }' instead.\\") + someBigInt_INCREMENT: BigInt @deprecated(reason: \\"Please use the relevant generic mutation 'someBigInt: { increment: ... } }' instead.\\") + someBigInt_SET: BigInt @deprecated(reason: \\"Please use the generic mutation 'someBigInt: { set: ... } }' instead.\\") + someDateTime: DateTimeScalarMutations + someDateTime_SET: DateTime @deprecated(reason: \\"Please use the generic mutation 'someDateTime: { set: ... } }' instead.\\") + someDuration: DurationScalarMutations + someDuration_SET: Duration @deprecated(reason: \\"Please use the generic mutation 'someDuration: { set: ... } }' instead.\\") + someFloat: FloatScalarMutations + someFloat_ADD: Float @deprecated(reason: \\"Please use the relevant generic mutation 'someFloat: { add: ... } }' instead.\\") + someFloat_DIVIDE: Float @deprecated(reason: \\"Please use the relevant generic mutation 'someFloat: { divide: ... } }' instead.\\") + someFloat_MULTIPLY: Float @deprecated(reason: \\"Please use the relevant generic mutation 'someFloat: { multiply: ... } }' instead.\\") + someFloat_SET: Float @deprecated(reason: \\"Please use the generic mutation 'someFloat: { set: ... } }' instead.\\") + someFloat_SUBTRACT: Float @deprecated(reason: \\"Please use the relevant generic mutation 'someFloat: { subtract: ... } }' instead.\\") + someId: IDScalarMutations + someId_SET: ID @deprecated(reason: \\"Please use the generic mutation 'someId: { set: ... } }' instead.\\") + someInt: IntScalarMutations + someInt_DECREMENT: Int @deprecated(reason: \\"Please use the relevant generic mutation 'someInt: { decrement: ... } }' instead.\\") + someInt_INCREMENT: Int @deprecated(reason: \\"Please use the relevant generic mutation 'someInt: { increment: ... } }' instead.\\") + someInt_SET: Int @deprecated(reason: \\"Please use the generic mutation 'someInt: { set: ... } }' instead.\\") + someLocalDateTime: LocalDateTimeScalarMutations + someLocalDateTime_SET: LocalDateTime @deprecated(reason: \\"Please use the generic mutation 'someLocalDateTime: { set: ... } }' instead.\\") + someLocalTime: LocalTimeScalarMutations + someLocalTime_SET: LocalTime @deprecated(reason: \\"Please use the generic mutation 'someLocalTime: { set: ... } }' instead.\\") + someString: StringScalarMutations + someString_SET: String @deprecated(reason: \\"Please use the generic mutation 'someString: { set: ... } }' instead.\\") + someTime: TimeScalarMutations + someTime_SET: Time @deprecated(reason: \\"Please use the generic mutation 'someTime: { set: ... } }' instead.\\") + } + + 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! + }" + `); + }); + + 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 @deprecated(reason: \\"Please use the generic mutation 'someBigInt: { pop: ... } }' instead.\\") + someBigInt_PUSH: [BigInt!] @deprecated(reason: \\"Please use the generic mutation 'someBigInt: { push: ... } }' instead.\\") + someBigInt_SET: [BigInt!] @deprecated(reason: \\"Please use the generic mutation 'someBigInt: { set: ... } }' instead.\\") + someDateTime: ListDateTimeMutations + someDateTime_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someDateTime: { pop: ... } }' instead.\\") + someDateTime_PUSH: [DateTime!] @deprecated(reason: \\"Please use the generic mutation 'someDateTime: { push: ... } }' instead.\\") + someDateTime_SET: [DateTime!] @deprecated(reason: \\"Please use the generic mutation 'someDateTime: { set: ... } }' instead.\\") + someDuration: ListDurationMutations + someDuration_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someDuration: { pop: ... } }' instead.\\") + someDuration_PUSH: [Duration!] @deprecated(reason: \\"Please use the generic mutation 'someDuration: { push: ... } }' instead.\\") + someDuration_SET: [Duration!] @deprecated(reason: \\"Please use the generic mutation 'someDuration: { set: ... } }' instead.\\") + someFloat: ListFloatMutations + someFloat_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someFloat: { pop: ... } }' instead.\\") + someFloat_PUSH: [Float!] @deprecated(reason: \\"Please use the generic mutation 'someFloat: { push: ... } }' instead.\\") + someFloat_SET: [Float!] @deprecated(reason: \\"Please use the generic mutation 'someFloat: { set: ... } }' instead.\\") + someId: ListIDMutations + someId_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someId: { pop: ... } }' instead.\\") + someId_PUSH: [ID!] @deprecated(reason: \\"Please use the generic mutation 'someId: { push: ... } }' instead.\\") + someId_SET: [ID!] @deprecated(reason: \\"Please use the generic mutation 'someId: { set: ... } }' instead.\\") + someInt: ListIntMutations + someInt_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someInt: { pop: ... } }' instead.\\") + someInt_PUSH: [Int!] @deprecated(reason: \\"Please use the generic mutation 'someInt: { push: ... } }' instead.\\") + someInt_SET: [Int!] @deprecated(reason: \\"Please use the generic mutation 'someInt: { set: ... } }' instead.\\") + someLocalDateTime: ListLocalDateTimeMutations + someLocalDateTime_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someLocalDateTime: { pop: ... } }' instead.\\") + someLocalDateTime_PUSH: [LocalDateTime!] @deprecated(reason: \\"Please use the generic mutation 'someLocalDateTime: { push: ... } }' instead.\\") + someLocalDateTime_SET: [LocalDateTime!] @deprecated(reason: \\"Please use the generic mutation 'someLocalDateTime: { set: ... } }' instead.\\") + someLocalTime: ListLocalTimeMutations + someLocalTime_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someLocalTime: { pop: ... } }' instead.\\") + someLocalTime_PUSH: [LocalTime!] @deprecated(reason: \\"Please use the generic mutation 'someLocalTime: { push: ... } }' instead.\\") + someLocalTime_SET: [LocalTime!] @deprecated(reason: \\"Please use the generic mutation 'someLocalTime: { set: ... } }' instead.\\") + someString: ListStringMutations + someString_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someString: { pop: ... } }' instead.\\") + someString_PUSH: [String!] @deprecated(reason: \\"Please use the generic mutation 'someString: { push: ... } }' instead.\\") + someString_SET: [String!] @deprecated(reason: \\"Please use the generic mutation 'someString: { set: ... } }' instead.\\") + someTime: ListTimeMutations + someTime_POP: Int @deprecated(reason: \\"Please use the generic mutation 'someTime: { pop: ... } }' instead.\\") + someTime_PUSH: [Time!] @deprecated(reason: \\"Please use the generic mutation 'someTime: { push: ... } }' instead.\\") + someTime_SET: [Time!] @deprecated(reason: \\"Please use the generic mutation 'someTime: { set: ... } }' instead.\\") + } + + 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 PostLikesConnectionFilters { + \\"\\"\\" + Return Posts where all of the related PostLikesConnections match this filter + \\"\\"\\" + all: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where none of the related PostLikesConnections match this filter + \\"\\"\\" + none: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where one of the related PostLikesConnections match this filter + \\"\\"\\" + single: PostLikesConnectionWhere + \\"\\"\\" + Return Posts where some of the related PostLikesConnections match this filter + \\"\\"\\" + some: PostLikesConnectionWhere + } + + 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 PostLikesRelationshipFilters { + \\"\\"\\"Return Posts where all of the related Users match this filter\\"\\"\\" + all: UserWhere + \\"\\"\\"Return Posts where none of the related Users match this filter\\"\\"\\" + none: UserWhere + \\"\\"\\"Return Posts where one of the related Users match this filter\\"\\"\\" + single: UserWhere + \\"\\"\\"Return Posts where some of the related Users match this filter\\"\\"\\" + some: UserWhere + } + + 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 @deprecated(reason: \\"Please use the generic mutation 'title: { set: ... } }' instead.\\") + } + + 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!] + likes: PostLikesRelationshipFilters + likesAggregate: PostLikesAggregateInput + likesConnection: PostLikesConnectionFilters + \\"\\"\\" + 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 diff --git a/packages/graphql/tests/schema/array-methods.test.ts b/packages/graphql/tests/schema/array-methods.test.ts index ba1aad3490..a0120e4a99 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 @@ -170,6 +171,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -190,6 +192,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 @@ -371,6 +374,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 @@ -395,6 +406,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 @@ -414,6 +431,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 @@ -443,6 +470,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -519,6 +547,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 @@ -719,6 +748,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 b0720415b1..46ea99a357 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! @@ -132,6 +158,7 @@ describe("Authorization", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -204,6 +231,7 @@ describe("Authorization", () => { AND: [PostAuthorNodeAggregationWhereInput!] NOT: PostAuthorNodeAggregationWhereInput OR: [PostAuthorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -214,6 +242,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 @@ -374,6 +403,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 @@ -458,6 +494,7 @@ describe("Authorization", () => { AND: [UserPostsAggregateInput!] NOT: UserPostsAggregateInput OR: [UserPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -530,6 +567,7 @@ describe("Authorization", () => { AND: [UserPostsNodeAggregationWhereInput!] NOT: UserPostsNodeAggregationWhereInput OR: [UserPostsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -540,6 +578,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 49808861b1..d28ccbe2b6 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!]! @@ -503,6 +523,7 @@ describe("Comments", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -572,6 +593,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 @@ -734,6 +756,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 @@ -822,6 +851,7 @@ describe("Comments", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -884,6 +914,7 @@ describe("Comments", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -958,6 +989,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 @@ -1128,6 +1160,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 @@ -1135,6 +1177,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 @@ -1385,6 +1435,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 7d733a208f..f600c5cc89 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 @@ -211,6 +212,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 @@ -343,6 +345,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 @@ -363,6 +385,7 @@ describe("Enums", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -439,6 +462,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 @@ -631,6 +655,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 682fbeceb8..59dcd25dd8 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 @@ -196,6 +197,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 @@ -325,6 +327,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 @@ -405,6 +413,7 @@ describe("Connection with interfaces", () => { AND: [MovieDirectorAggregateInput!] NOT: MovieDirectorAggregateInput OR: [MovieDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -460,6 +469,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 @@ -624,6 +634,7 @@ describe("Connection with interfaces", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -679,6 +690,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 @@ -808,6 +820,7 @@ describe("Connection with interfaces", () => { AND: [ProductionDirectorAggregateInput!] NOT: ProductionDirectorAggregateInput OR: [ProductionDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -875,6 +888,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 @@ -1069,6 +1083,7 @@ describe("Connection with interfaces", () => { AND: [SeriesDirectorAggregateInput!] NOT: SeriesDirectorAggregateInput OR: [SeriesDirectorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1124,6 +1139,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 0d74e97ec3..a9bb01cb8d 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! @@ -124,6 +144,7 @@ describe("Sort", () => { AND: [Node1RelatedToAggregateInput!] NOT: Node1RelatedToAggregateInput OR: [Node1RelatedToAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -322,6 +343,7 @@ describe("Sort", () => { AND: [Node2RelatedToAggregateInput!] NOT: Node2RelatedToAggregateInput OR: [Node2RelatedToAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -394,6 +416,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 @@ -513,6 +536,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 1eb8ce3bc5..da7442e364 100644 --- a/packages/graphql/tests/schema/connections/unions.test.ts +++ b/packages/graphql/tests/schema/connections/unions.test.ts @@ -345,6 +345,7 @@ describe("Unions", () => { AND: [BookAuthorAggregateInput!] NOT: BookAuthorAggregateInput OR: [BookAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -436,6 +437,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 @@ -599,6 +601,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 @@ -606,6 +618,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 @@ -639,6 +659,7 @@ describe("Unions", () => { AND: [JournalAuthorAggregateInput!] NOT: JournalAuthorAggregateInput OR: [JournalAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -730,6 +751,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 @@ -915,6 +937,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 @@ -973,6 +1002,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 56c6ae8542..b0d1af5889 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 @@ -312,6 +320,7 @@ describe("Directive-preserve", () => { AND: [GenreMoviesAggregateInput!] NOT: GenreMoviesAggregateInput OR: [GenreMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -384,6 +393,7 @@ describe("Directive-preserve", () => { AND: [GenreMoviesNodeAggregationWhereInput!] NOT: GenreMoviesNodeAggregationWhereInput OR: [GenreMoviesNodeAggregationWhereInput!] + imdbRating: FloatScalarAggregationFilters imdbRating_AVERAGE_EQUAL: Float imdbRating_AVERAGE_GT: Float imdbRating_AVERAGE_GTE: Float @@ -404,6 +414,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 @@ -419,6 +430,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 @@ -535,6 +547,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 @@ -609,6 +629,7 @@ describe("Directive-preserve", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -681,6 +702,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 @@ -850,6 +872,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 @@ -953,6 +982,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 @@ -1006,6 +1036,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1083,6 +1114,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 @@ -1265,6 +1297,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 @@ -1315,6 +1357,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1363,6 +1406,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 @@ -1526,6 +1570,7 @@ describe("Directive-preserve", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1643,6 +1688,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 @@ -1829,6 +1875,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1877,6 +1924,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 @@ -2023,6 +2071,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 @@ -2132,6 +2187,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 @@ -2185,6 +2241,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2259,6 +2316,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 @@ -2441,6 +2499,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 @@ -2491,6 +2559,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2568,6 +2637,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 @@ -2828,6 +2898,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2905,6 +2976,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 @@ -3057,6 +3129,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 @@ -3154,6 +3233,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 @@ -3207,6 +3287,7 @@ describe("Directive-preserve", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3281,6 +3362,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 @@ -3463,6 +3545,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 @@ -3513,6 +3605,7 @@ describe("Directive-preserve", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3590,6 +3683,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 @@ -3850,6 +3944,7 @@ describe("Directive-preserve", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3927,6 +4022,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 @@ -4079,6 +4175,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 @@ -4206,6 +4309,7 @@ describe("Directive-preserve", () => { AND: [BlogPostsAggregateInput!] NOT: BlogPostsAggregateInput OR: [BlogPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4275,6 +4379,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\\") @@ -4417,6 +4522,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! @@ -4515,6 +4640,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 4c55fd7a27..8288e4125f 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 @@ -136,6 +137,7 @@ describe("Alias", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + rating: FloatScalarAggregationFilters rating_AVERAGE_EQUAL: Float rating_AVERAGE_GT: Float rating_AVERAGE_GTE: Float @@ -156,6 +158,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 @@ -186,6 +189,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 @@ -201,6 +205,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 @@ -429,6 +434,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 @@ -455,6 +468,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 @@ -580,6 +601,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 a13fa614c9..390027b06f 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 @@ -1186,6 +1187,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 @@ -1207,6 +1228,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1279,6 +1301,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 @@ -1294,6 +1317,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 @@ -1503,6 +1527,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 @@ -1652,6 +1683,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1724,6 +1756,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 @@ -1896,6 +1929,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 @@ -1917,6 +1970,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1989,6 +2043,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 @@ -2004,6 +2059,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 @@ -2213,6 +2269,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 @@ -2362,6 +2425,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2434,6 +2498,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 @@ -2606,6 +2671,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 @@ -2627,6 +2712,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2699,6 +2785,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 @@ -2714,6 +2801,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 @@ -2905,6 +2993,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 @@ -3057,6 +3152,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3129,6 +3225,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 @@ -3301,6 +3398,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 @@ -3569,6 +3686,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 @@ -3720,6 +3844,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3792,6 +3917,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 @@ -3964,6 +4090,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 @@ -3985,6 +4131,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4057,6 +4204,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 @@ -4072,6 +4220,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 @@ -4281,6 +4430,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 @@ -4432,6 +4588,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4504,6 +4661,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 @@ -4676,6 +4834,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 @@ -4697,6 +4875,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4750,6 +4929,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 @@ -4765,6 +4945,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 @@ -4937,6 +5118,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 @@ -5088,6 +5276,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5160,6 +5349,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 @@ -5332,6 +5522,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 @@ -5600,6 +5810,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 @@ -5744,6 +5961,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5816,6 +6034,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 @@ -5988,6 +6207,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 @@ -6312,6 +6551,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 @@ -6456,6 +6702,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6528,6 +6775,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 @@ -6700,6 +6948,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 @@ -6711,6 +6979,7 @@ describe("@filterable directive", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6780,6 +7049,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 @@ -7058,6 +7328,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 @@ -7202,6 +7479,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7274,6 +7552,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 @@ -7446,6 +7725,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 @@ -7770,6 +8069,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 @@ -7930,6 +8236,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8002,6 +8309,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 @@ -8211,6 +8519,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8283,6 +8592,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 @@ -8460,6 +8770,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! @@ -8801,6 +9131,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 @@ -8969,6 +9306,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9041,6 +9379,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 @@ -9250,6 +9589,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9322,6 +9662,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 @@ -9499,6 +9840,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! @@ -9840,6 +10201,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 @@ -10008,6 +10376,7 @@ describe("@filterable directive", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10080,6 +10449,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 @@ -10289,6 +10659,7 @@ describe("@filterable directive", () => { AND: [AppearanceMoviesAggregateInput!] NOT: AppearanceMoviesAggregateInput OR: [AppearanceMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10361,6 +10732,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 @@ -10538,6 +10910,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! @@ -10879,6 +11271,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 6178731479..2d39b6f278 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 @@ -914,6 +940,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -988,6 +1015,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1130,6 +1158,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 @@ -1145,6 +1174,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 @@ -1160,6 +1190,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 @@ -1175,6 +1206,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 @@ -1249,6 +1281,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 @@ -1360,6 +1399,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! } @@ -1417,6 +1466,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 @@ -1443,6 +1498,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 @@ -1507,6 +1570,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresAggregateInput!] NOT: MovieGenresAggregateInput OR: [MovieGenresAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1581,6 +1645,7 @@ describe("@populatedBy tests", () => { AND: [MovieGenresNodeAggregationWhereInput!] NOT: MovieGenresNodeAggregationWhereInput OR: [MovieGenresNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1723,6 +1788,7 @@ describe("@populatedBy tests", () => { AND: [RelPropertiesAggregationWhereInput!] NOT: RelPropertiesAggregationWhereInput OR: [RelPropertiesAggregationWhereInput!] + callback1: IntScalarAggregationFilters callback1_AVERAGE_EQUAL: Float callback1_AVERAGE_GT: Float callback1_AVERAGE_GTE: Float @@ -1743,6 +1809,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 @@ -1763,6 +1830,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 @@ -1783,6 +1851,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 b9cc1f9522..862ba4e33c 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! @@ -327,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 @@ -396,6 +417,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 @@ -411,6 +433,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 @@ -573,6 +596,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 @@ -726,6 +756,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 @@ -747,6 +797,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -816,6 +867,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 @@ -831,6 +883,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 @@ -993,6 +1046,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 @@ -1148,6 +1208,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! @@ -1158,6 +1238,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1227,6 +1308,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 @@ -1242,6 +1324,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 @@ -1475,6 +1558,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 @@ -1628,6 +1718,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 @@ -1639,6 +1749,7 @@ describe("@relationship directive, aggregate argument", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1708,6 +1819,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 @@ -1723,6 +1835,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 @@ -1966,6 +2079,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 7a99e3eaf3..1dcbdc89f3 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 @@ -111,6 +131,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -159,6 +180,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 @@ -359,6 +381,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 @@ -446,6 +475,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 @@ -470,6 +509,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 @@ -481,6 +530,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -537,6 +587,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 @@ -744,6 +795,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 @@ -831,6 +889,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 @@ -855,6 +923,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 @@ -866,6 +944,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -922,6 +1001,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 @@ -1133,6 +1213,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 @@ -1220,6 +1307,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 @@ -1244,6 +1341,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 @@ -1255,6 +1362,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1303,6 +1411,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 @@ -1513,6 +1622,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 @@ -1600,6 +1716,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 @@ -1624,6 +1750,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 @@ -1635,6 +1771,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1687,6 +1824,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 @@ -1897,6 +2035,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 @@ -1984,6 +2129,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 @@ -2008,6 +2163,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 @@ -2019,6 +2184,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2071,6 +2237,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 @@ -2277,6 +2444,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 @@ -2365,6 +2539,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 @@ -2389,6 +2573,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 @@ -2400,6 +2594,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2448,6 +2643,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 @@ -2648,6 +2844,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 @@ -2737,11 +2940,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 @@ -2761,6 +2980,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 @@ -2772,6 +3001,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2820,6 +3050,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 @@ -2830,6 +3061,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 @@ -3040,6 +3272,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 @@ -3128,6 +3367,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 @@ -3152,6 +3401,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 @@ -3166,6 +3425,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3235,6 +3495,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 @@ -3322,6 +3583,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3374,6 +3636,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 @@ -3589,6 +3852,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 @@ -3677,6 +3947,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 @@ -3701,6 +3981,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 @@ -3715,6 +4005,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3771,6 +4062,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 @@ -3846,6 +4138,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3898,6 +4191,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 @@ -4109,6 +4403,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 @@ -8892,6 +9193,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 @@ -8922,6 +9233,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 @@ -8940,6 +9261,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8988,6 +9310,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 @@ -9299,6 +9622,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 @@ -9405,6 +9735,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 @@ -9435,6 +9775,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 @@ -9453,6 +9803,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9509,6 +9860,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 @@ -9832,6 +10184,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 @@ -9938,6 +10297,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 @@ -9968,6 +10337,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 @@ -9986,6 +10365,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10042,6 +10422,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 @@ -10364,6 +10745,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 @@ -10470,6 +10858,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 @@ -10500,6 +10898,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 @@ -10518,6 +10926,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10566,6 +10975,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 @@ -10892,6 +11302,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 @@ -10998,6 +11415,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 @@ -11028,6 +11455,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 @@ -11046,6 +11483,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -11098,6 +11536,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 @@ -11419,6 +11858,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 @@ -11525,6 +11971,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 @@ -11555,6 +12011,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 @@ -11573,6 +12039,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -11625,6 +12092,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 @@ -11942,6 +12410,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 @@ -12049,6 +12524,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 @@ -12079,6 +12564,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 @@ -12100,6 +12595,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12169,6 +12665,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 @@ -12256,6 +12753,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12308,6 +12806,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 @@ -12644,6 +13143,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 @@ -12752,6 +13258,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 @@ -12782,6 +13298,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 @@ -12803,6 +13329,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12863,6 +13390,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 @@ -12943,6 +13471,7 @@ describe("Relationship nested operations", () => { AND: [MovieProducersAggregateInput!] NOT: MovieProducersAggregateInput OR: [MovieProducersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -12995,6 +13524,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 @@ -13322,6 +13852,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 eaa15b7568..3e0c9373f3 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 @@ -188,6 +189,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -265,6 +267,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 @@ -425,6 +428,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 @@ -432,6 +445,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 @@ -474,6 +495,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -551,6 +573,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 @@ -727,6 +750,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 @@ -810,6 +840,7 @@ describe("Relationship-properties", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -820,6 +851,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 @@ -840,6 +872,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 @@ -953,6 +986,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1030,6 +1064,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 @@ -1162,6 +1197,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 @@ -1180,11 +1221,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 @@ -1206,6 +1263,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 @@ -1250,6 +1315,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1327,6 +1393,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 @@ -1503,6 +1570,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 @@ -1584,6 +1658,7 @@ describe("Relationship-properties", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -1594,6 +1669,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 @@ -1687,6 +1763,7 @@ describe("Relationship-properties", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1762,6 +1839,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 @@ -1893,6 +1971,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 @@ -1911,11 +1995,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 @@ -1930,6 +2030,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 @@ -1956,6 +2066,7 @@ describe("Relationship-properties", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2031,6 +2142,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 @@ -2206,6 +2318,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 906b2c6611..6be0857608 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 @@ -167,6 +168,7 @@ describe("Relationship", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -292,11 +294,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 @@ -316,6 +334,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 @@ -336,6 +364,7 @@ describe("Relationship", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -408,6 +437,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 @@ -582,6 +612,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 fe66c42516..c086ac33e6 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 @@ -826,6 +827,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 @@ -841,6 +843,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 @@ -995,6 +998,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! @@ -1098,6 +1121,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 @@ -1171,6 +1201,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1240,6 +1271,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 @@ -1255,6 +1287,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 @@ -1414,6 +1447,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! @@ -1517,6 +1570,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 @@ -2613,6 +2673,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2672,6 +2733,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 @@ -2687,6 +2749,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 @@ -2846,6 +2909,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! @@ -3084,6 +3167,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 @@ -3172,6 +3262,7 @@ describe("@selectable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3241,6 +3332,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 @@ -3256,6 +3348,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 @@ -3420,6 +3513,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! @@ -3658,6 +3771,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 76417799b8..5bce5bb05b 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 @@ -668,6 +669,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 @@ -683,6 +685,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 @@ -841,6 +844,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! @@ -944,6 +967,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 @@ -1018,6 +1048,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1083,6 +1114,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 @@ -1098,6 +1130,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 @@ -1243,6 +1276,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! @@ -1346,6 +1399,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 @@ -1419,6 +1479,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1491,6 +1552,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 @@ -1506,6 +1568,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 @@ -1663,6 +1726,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 @@ -1684,6 +1767,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1756,6 +1840,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 @@ -1941,6 +2026,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 @@ -2014,6 +2106,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2081,6 +2174,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 @@ -2096,6 +2190,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 @@ -2266,6 +2361,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 @@ -2287,6 +2402,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2359,6 +2475,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 @@ -2544,6 +2661,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 @@ -3831,6 +3955,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 @@ -3852,6 +3996,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3924,6 +4069,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 @@ -4187,6 +4333,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 @@ -4526,6 +4679,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 @@ -4547,6 +4720,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4619,6 +4793,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 @@ -4882,6 +5057,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 @@ -4973,6 +5155,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5037,6 +5220,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 @@ -5052,6 +5236,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 @@ -5215,6 +5400,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! @@ -5453,6 +5658,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 @@ -5542,6 +5754,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5607,6 +5820,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 @@ -5622,6 +5836,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 @@ -5772,6 +5987,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! @@ -6003,6 +6238,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 @@ -6093,6 +6335,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6165,6 +6408,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 @@ -6180,6 +6424,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 @@ -6342,6 +6587,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 @@ -6363,6 +6628,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6408,6 +6674,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 @@ -6568,6 +6835,7 @@ describe("@settable", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6631,6 +6899,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 @@ -6797,6 +7066,7 @@ describe("@settable", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6842,6 +7112,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 @@ -6984,6 +7255,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 @@ -7074,6 +7352,7 @@ describe("@settable", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7141,6 +7420,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 @@ -7156,6 +7436,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 @@ -7331,6 +7612,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 @@ -7352,6 +7653,7 @@ describe("@settable", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7397,6 +7699,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 @@ -7557,6 +7860,7 @@ describe("@settable", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7624,6 +7928,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 @@ -7811,6 +8116,7 @@ describe("@settable", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7856,6 +8162,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 @@ -7998,6 +8305,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 7d4b89ed91..bc26ccb9f9 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 @@ -128,6 +148,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -200,6 +221,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 @@ -362,6 +384,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 @@ -452,6 +481,7 @@ describe("Apollo Federation", () => { AND: [UserPostsAggregateInput!] NOT: UserPostsAggregateInput OR: [UserPostsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -524,6 +554,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 @@ -722,6 +753,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! @@ -755,6 +806,7 @@ describe("Apollo Federation", () => { AND: [PostAuthorAggregateInput!] NOT: PostAuthorAggregateInput OR: [PostAuthorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -824,6 +876,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 @@ -975,6 +1028,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 4431eb0c58..5daa86e9f8 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 @@ -146,6 +147,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 @@ -281,6 +283,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 @@ -293,6 +305,7 @@ describe("inheritance", () => { AND: [FriendsWithAggregationWhereInput!] NOT: FriendsWithAggregationWhereInput OR: [FriendsWithAggregationWhereInput!] + since: IntScalarAggregationFilters since_AVERAGE_EQUAL: Float since_AVERAGE_GT: Float since_AVERAGE_GTE: Float @@ -350,6 +363,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 @@ -427,6 +448,7 @@ describe("inheritance", () => { AND: [PersonFriendsAggregateInput!] NOT: PersonFriendsAggregateInput OR: [PersonFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -539,6 +561,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 @@ -668,6 +691,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 20ce8aac5d..4cee47d3a7 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 @@ -130,6 +131,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -204,6 +206,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 @@ -374,6 +377,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 @@ -381,6 +394,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 @@ -631,6 +652,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 @@ -734,6 +762,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -795,6 +824,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -872,6 +902,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 @@ -1101,6 +1132,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesAggregateInput!] NOT: EpisodeSeriesAggregateInput OR: [EpisodeSeriesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1173,6 +1205,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesNodeAggregationWhereInput!] NOT: EpisodeSeriesNodeAggregationWhereInput OR: [EpisodeSeriesNodeAggregationWhereInput!] + episodeCount: IntScalarAggregationFilters episodeCount_AVERAGE_EQUAL: Float episodeCount_AVERAGE_GT: Float episodeCount_AVERAGE_GTE: Float @@ -1193,6 +1226,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 @@ -1310,6 +1344,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 @@ -1317,6 +1361,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 @@ -1360,6 +1412,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1408,6 +1461,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 @@ -1574,6 +1628,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1691,6 +1746,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 @@ -1883,6 +1939,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1931,6 +1988,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 @@ -2029,6 +2087,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesAggregateInput!] NOT: SeriesEpisodesAggregateInput OR: [SeriesEpisodesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2101,6 +2160,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesNodeAggregationWhereInput!] NOT: SeriesEpisodesNodeAggregationWhereInput OR: [SeriesEpisodesNodeAggregationWhereInput!] + runtime: IntScalarAggregationFilters runtime_AVERAGE_EQUAL: Float runtime_AVERAGE_GT: Float runtime_AVERAGE_GTE: Float @@ -2257,6 +2317,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 @@ -2368,6 +2435,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -2429,6 +2497,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2506,6 +2575,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 @@ -2735,6 +2805,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesAggregateInput!] NOT: EpisodeSeriesAggregateInput OR: [EpisodeSeriesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2807,6 +2878,7 @@ describe("Interface Relationships", () => { AND: [EpisodeSeriesNodeAggregationWhereInput!] NOT: EpisodeSeriesNodeAggregationWhereInput OR: [EpisodeSeriesNodeAggregationWhereInput!] + episodeCount: IntScalarAggregationFilters episodeCount_AVERAGE_EQUAL: Float episodeCount_AVERAGE_GT: Float episodeCount_AVERAGE_GTE: Float @@ -2827,6 +2899,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 @@ -2944,6 +3017,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 @@ -2951,6 +3034,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 @@ -2994,6 +3085,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3042,6 +3134,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 @@ -3208,6 +3301,7 @@ describe("Interface Relationships", () => { AND: [ProductionActorsAggregateInput!] NOT: ProductionActorsAggregateInput OR: [ProductionActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3345,6 +3439,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 @@ -3537,6 +3632,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3585,6 +3681,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 @@ -3683,6 +3780,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesAggregateInput!] NOT: SeriesEpisodesAggregateInput OR: [SeriesEpisodesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3755,6 +3853,7 @@ describe("Interface Relationships", () => { AND: [SeriesEpisodesNodeAggregationWhereInput!] NOT: SeriesEpisodesNodeAggregationWhereInput OR: [SeriesEpisodesNodeAggregationWhereInput!] + runtime: IntScalarAggregationFilters runtime_AVERAGE_EQUAL: Float runtime_AVERAGE_GT: Float runtime_AVERAGE_GTE: Float @@ -3918,6 +4017,7 @@ describe("Interface Relationships", () => { AND: [StarredInAggregationWhereInput!] NOT: StarredInAggregationWhereInput OR: [StarredInAggregationWhereInput!] + seasons: IntScalarAggregationFilters seasons_AVERAGE_EQUAL: Float seasons_AVERAGE_GT: Float seasons_AVERAGE_GTE: Float @@ -3973,6 +4073,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 @@ -4109,6 +4216,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!]! @@ -4155,6 +4282,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4219,6 +4347,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 @@ -4462,6 +4591,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 @@ -4518,6 +4654,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4618,6 +4755,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4679,6 +4817,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 @@ -4732,6 +4871,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 @@ -4980,6 +5120,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5041,6 +5182,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 @@ -5335,6 +5477,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 @@ -5342,6 +5494,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 @@ -5405,6 +5565,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5519,6 +5680,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 @@ -5742,6 +5904,7 @@ describe("Interface Relationships", () => { AND: [PropsAggregationWhereInput!] NOT: PropsAggregationWhereInput OR: [PropsAggregationWhereInput!] + propsField: IntScalarAggregationFilters propsField_AVERAGE_EQUAL: Float propsField_AVERAGE_GT: Float propsField_AVERAGE_GTE: Float @@ -5829,6 +5992,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 @@ -5885,6 +6055,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -5985,6 +6156,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6054,6 +6226,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 @@ -6108,6 +6281,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 @@ -6356,6 +6530,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6425,6 +6600,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 @@ -6726,6 +6902,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 @@ -6733,6 +6919,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 @@ -6796,6 +6990,7 @@ describe("Interface Relationships", () => { AND: [Interface1Interface2AggregateInput!] NOT: Interface1Interface2AggregateInput OR: [Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -6930,6 +7125,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 @@ -7177,6 +7373,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 @@ -7233,6 +7436,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1AggregateInput!] NOT: Type1Interface1AggregateInput OR: [Type1Interface1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7333,6 +7537,7 @@ describe("Interface Relationships", () => { AND: [Type1Interface1Interface2AggregateInput!] NOT: Type1Interface1Interface2AggregateInput OR: [Type1Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7402,6 +7607,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 @@ -7456,6 +7662,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 @@ -7628,6 +7835,7 @@ describe("Interface Relationships", () => { AND: [Type1PropsAggregationWhereInput!] NOT: Type1PropsAggregationWhereInput OR: [Type1PropsAggregationWhereInput!] + type1Field: IntScalarAggregationFilters type1Field_AVERAGE_EQUAL: Float type1Field_AVERAGE_GT: Float type1Field_AVERAGE_GTE: Float @@ -7766,6 +7974,7 @@ describe("Interface Relationships", () => { AND: [Type2Interface1Interface2AggregateInput!] NOT: Type2Interface1Interface2AggregateInput OR: [Type2Interface1Interface2AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -7835,6 +8044,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 @@ -8011,6 +8221,7 @@ describe("Interface Relationships", () => { AND: [Type2PropsAggregationWhereInput!] NOT: Type2PropsAggregationWhereInput OR: [Type2PropsAggregationWhereInput!] + type2Field: IntScalarAggregationFilters type2Field_AVERAGE_EQUAL: Float type2Field_AVERAGE_GT: Float type2Field_AVERAGE_GTE: Float @@ -8178,6 +8389,7 @@ describe("Interface Relationships", () => { AND: [CommentCreatorAggregateInput!] NOT: CommentCreatorAggregateInput OR: [CommentCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8223,6 +8435,7 @@ describe("Interface Relationships", () => { AND: [CommentCreatorNodeAggregationWhereInput!] NOT: CommentCreatorNodeAggregationWhereInput OR: [CommentCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -8233,6 +8446,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 @@ -8293,6 +8507,7 @@ describe("Interface Relationships", () => { AND: [CommentPostAggregateInput!] NOT: CommentPostAggregateInput OR: [CommentPostAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8365,6 +8580,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 @@ -8380,6 +8596,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 @@ -8566,6 +8783,7 @@ describe("Interface Relationships", () => { AND: [ContentCreatorAggregateInput!] NOT: ContentCreatorAggregateInput OR: [ContentCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8633,6 +8851,7 @@ describe("Interface Relationships", () => { AND: [ContentCreatorNodeAggregationWhereInput!] NOT: ContentCreatorNodeAggregationWhereInput OR: [ContentCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -8643,6 +8862,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 @@ -8806,11 +9026,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 @@ -8830,6 +9066,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! @@ -8881,6 +9127,7 @@ describe("Interface Relationships", () => { AND: [PostCommentsAggregateInput!] NOT: PostCommentsAggregateInput OR: [PostCommentsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -8953,6 +9200,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 @@ -8968,6 +9216,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 @@ -9029,6 +9278,7 @@ describe("Interface Relationships", () => { AND: [PostCreatorAggregateInput!] NOT: PostCreatorAggregateInput OR: [PostCreatorAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9074,6 +9324,7 @@ describe("Interface Relationships", () => { AND: [PostCreatorNodeAggregationWhereInput!] NOT: PostCreatorNodeAggregationWhereInput OR: [PostCreatorNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -9084,6 +9335,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 @@ -9273,6 +9525,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 @@ -9343,6 +9602,7 @@ describe("Interface Relationships", () => { AND: [UserContentAggregateInput!] NOT: UserContentAggregateInput OR: [UserContentAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9425,6 +9685,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 @@ -9440,6 +9701,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 @@ -9629,6 +9891,7 @@ describe("Interface Relationships", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -9690,6 +9953,7 @@ describe("Interface Relationships", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -9767,6 +10031,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 @@ -9949,6 +10214,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 @@ -9956,6 +10231,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 @@ -9999,6 +10282,7 @@ describe("Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10047,6 +10331,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 @@ -10290,6 +10575,7 @@ describe("Interface Relationships", () => { AND: [SeriesActorsAggregateInput!] NOT: SeriesActorsAggregateInput OR: [SeriesActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10338,6 +10624,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 @@ -10481,6 +10768,7 @@ describe("Interface Relationships", () => { AND: [ShowActorsAggregateInput!] NOT: ShowActorsAggregateInput OR: [ShowActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -10618,6 +10906,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 @@ -10783,6 +11072,7 @@ describe("Interface Relationships", () => { AND: [StarredInAggregationWhereInput!] NOT: StarredInAggregationWhereInput OR: [StarredInAggregationWhereInput!] + episodeNr: IntScalarAggregationFilters episodeNr_AVERAGE_EQUAL: Float episodeNr_AVERAGE_GT: Float episodeNr_AVERAGE_GTE: Float @@ -10838,6 +11128,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 9e5a0a0d9b..df295e984d 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 @@ -99,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 @@ -152,6 +168,7 @@ describe("Interfaces", () => { AND: [MovieMoviesAggregateInput!] NOT: MovieMoviesAggregateInput OR: [MovieMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -197,6 +214,7 @@ describe("Interfaces", () => { AND: [MovieMoviesNodeAggregationWhereInput!] NOT: MovieMoviesNodeAggregationWhereInput OR: [MovieMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -258,6 +276,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesAggregateInput!] NOT: MovieNodeMoviesAggregateInput OR: [MovieNodeMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -316,6 +335,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesNodeAggregationWhereInput!] NOT: MovieNodeMoviesNodeAggregationWhereInput OR: [MovieNodeMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -567,6 +587,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 @@ -586,6 +612,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 @@ -639,6 +675,7 @@ describe("Interfaces", () => { AND: [MovieMoviesAggregateInput!] NOT: MovieMoviesAggregateInput OR: [MovieMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -684,6 +721,7 @@ describe("Interfaces", () => { AND: [MovieMoviesNodeAggregationWhereInput!] NOT: MovieMoviesNodeAggregationWhereInput OR: [MovieMoviesNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -745,6 +783,7 @@ describe("Interfaces", () => { AND: [MovieNodeMoviesAggregateInput!] NOT: MovieNodeMoviesAggregateInput OR: [MovieNodeMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -803,6 +842,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 9274840149..89e747dbcf 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 @@ -225,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 @@ -294,6 +327,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 @@ -304,6 +338,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 @@ -314,6 +349,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 @@ -531,6 +567,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 1a9635efeb..53e31fd0d7 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 @@ -180,6 +181,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 @@ -326,6 +328,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! } @@ -417,6 +439,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 e427aa79bd..cc98936c5e 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 @@ -226,6 +250,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1AggregateInput!] NOT: TigerJawLevel2Part1AggregateInput OR: [TigerJawLevel2Part1AggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -329,6 +354,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1NodeAggregationWhereInput!] NOT: TigerJawLevel2Part1NodeAggregationWhereInput OR: [TigerJawLevel2Part1NodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -376,6 +402,7 @@ describe("162", () => { AND: [TigerJawLevel2Part1TigerAggregateInput!] NOT: TigerJawLevel2Part1TigerAggregateInput OR: [TigerJawLevel2Part1TigerAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -445,6 +472,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 25105120d3..c9d58d4ad8 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 @@ -153,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 @@ -225,6 +234,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 @@ -245,6 +255,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\\") @@ -260,6 +271,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 @@ -376,6 +388,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 @@ -450,6 +470,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 @@ -522,6 +543,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 @@ -691,6 +713,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 7d995913e5..5901b39f8f 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 @@ -245,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 @@ -317,6 +350,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 @@ -327,6 +361,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 @@ -337,6 +372,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 @@ -352,6 +388,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 @@ -635,6 +672,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 4e7a2dac9a..184e7e237e 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 @@ -334,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 @@ -406,6 +447,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 @@ -416,6 +458,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 c0abbdba44..6130469024 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 @@ -105,6 +131,7 @@ describe("Relationship nested operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -153,6 +180,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 @@ -163,6 +191,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 @@ -373,6 +402,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 2d7ef2af19..9eec3def8a 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 @@ -124,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 @@ -172,6 +193,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 @@ -299,6 +321,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 @@ -460,6 +489,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 @@ -479,6 +518,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 @@ -500,6 +549,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 @@ -569,6 +619,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 @@ -716,6 +767,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 9a10ecdd95..f484750c0d 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!]! @@ -174,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 @@ -243,6 +254,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 @@ -258,6 +270,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 @@ -273,6 +286,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 @@ -476,6 +490,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 @@ -527,6 +551,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 @@ -608,6 +633,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 @@ -788,6 +814,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 f885ccef9d..39c5ee50e4 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! @@ -212,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 @@ -287,6 +315,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 @@ -413,6 +442,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 d907be46c1..2ca407ff86 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 @@ -196,6 +197,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 @@ -318,6 +320,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 @@ -393,6 +401,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 @@ -602,6 +611,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 @@ -657,6 +667,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 @@ -776,6 +787,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 @@ -1023,6 +1035,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 1c9dc80bdf..1872dadcbd 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 @@ -138,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 @@ -215,6 +217,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 @@ -420,6 +423,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 @@ -427,6 +440,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 @@ -471,6 +492,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 @@ -519,6 +541,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 @@ -725,6 +748,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 @@ -773,6 +797,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 @@ -916,6 +941,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 @@ -1033,6 +1059,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 @@ -1191,6 +1218,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 677375b1ef..e9223dfcba 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 @@ -165,6 +166,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 @@ -175,6 +177,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 @@ -312,6 +315,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 @@ -381,6 +385,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 @@ -391,6 +396,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 @@ -526,11 +532,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 @@ -545,6 +567,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! @@ -651,6 +683,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 e47400a3ba..dd62ea4aa1 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 @@ -261,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 @@ -333,6 +365,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 @@ -343,6 +376,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 @@ -358,6 +392,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 @@ -373,6 +408,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 @@ -524,6 +560,7 @@ describe("lower case type names", () => { AND: [movieActorsAggregateInput!] NOT: movieActorsAggregateInput OR: [movieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -596,6 +633,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 @@ -606,6 +644,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 @@ -621,6 +660,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 a12d4f0902..8d7a56a4a0 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 @@ -761,6 +762,7 @@ describe("Algebraic", () => { AND: [DirectorDirectsNodeAggregationWhereInput!] NOT: DirectorDirectsNodeAggregationWhereInput OR: [DirectorDirectsNodeAggregationWhereInput!] + id: IDScalarAggregationFilters id_MAX_EQUAL: ID id_MAX_GT: ID id_MAX_GTE: ID @@ -771,6 +773,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 @@ -899,11 +902,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 @@ -930,6 +949,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 @@ -983,6 +1010,7 @@ describe("Algebraic", () => { AND: [MovieDirectedByAggregateInput!] NOT: MovieDirectedByAggregateInput OR: [MovieDirectedByAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1055,6 +1083,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 @@ -1228,6 +1257,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 @@ -1320,6 +1356,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 @@ -1351,6 +1397,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 @@ -1474,6 +1528,7 @@ describe("Algebraic", () => { AND: [MovieWorkersAggregateInput!] NOT: MovieWorkersAggregateInput OR: [MovieWorkersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1546,6 +1601,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 @@ -1724,6 +1780,7 @@ describe("Algebraic", () => { AND: [PersonWorksInProductionAggregateInput!] NOT: PersonWorksInProductionAggregateInput OR: [PersonWorksInProductionAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1793,6 +1850,7 @@ describe("Algebraic", () => { AND: [PersonWorksInProductionNodeAggregationWhereInput!] NOT: PersonWorksInProductionNodeAggregationWhereInput OR: [PersonWorksInProductionNodeAggregationWhereInput!] + viewers: IntScalarAggregationFilters viewers_AVERAGE_EQUAL: Float viewers_AVERAGE_GT: Float viewers_AVERAGE_GTE: Float @@ -1929,6 +1987,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 @@ -2010,6 +2075,7 @@ describe("Algebraic", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + pay: FloatScalarAggregationFilters pay_AVERAGE_EQUAL: Float pay_AVERAGE_GT: Float pay_AVERAGE_GTE: Float @@ -2104,6 +2170,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 @@ -2123,6 +2197,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 @@ -2141,6 +2225,7 @@ describe("Algebraic", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2218,6 +2303,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 @@ -2403,6 +2489,7 @@ describe("Algebraic", () => { AND: [PersonActedInMoviesAggregateInput!] NOT: PersonActedInMoviesAggregateInput OR: [PersonActedInMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2480,6 +2567,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 @@ -2653,6 +2741,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 12dde5350d..c983f59f01 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 @@ -103,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 @@ -177,6 +179,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 @@ -197,6 +200,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 @@ -217,6 +221,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 @@ -391,6 +396,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 @@ -417,6 +430,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 @@ -557,6 +578,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 3e7e4cb656..659c64d589 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 @@ -235,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 @@ -304,6 +332,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 9d1c7e9a1f..859b8cd1ec 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 @@ -169,6 +196,7 @@ describe("Query Direction", () => { AND: [UserFriendsAggregateInput!] NOT: UserFriendsAggregateInput OR: [UserFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -241,6 +269,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 @@ -393,6 +422,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! @@ -426,6 +475,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 @@ -502,6 +558,7 @@ describe("Query Direction", () => { AND: [UserFriendsAggregateInput!] NOT: UserFriendsAggregateInput OR: [UserFriendsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -574,6 +631,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 aac97a0eda..ed061678df 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 @@ -172,6 +173,7 @@ describe("Arrays Methods", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -192,6 +194,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 @@ -373,6 +376,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 @@ -397,6 +408,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 @@ -416,6 +433,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 @@ -445,6 +472,7 @@ describe("Arrays Methods", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -521,6 +549,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 @@ -721,6 +750,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 7d953e2ba7..b48e70c390 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!]! @@ -507,6 +527,7 @@ describe("Comments", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -576,6 +597,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 @@ -738,6 +760,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 @@ -828,6 +857,7 @@ describe("Comments", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -890,6 +920,7 @@ describe("Comments", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -964,6 +995,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 @@ -1134,6 +1166,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 @@ -1141,6 +1183,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 @@ -1391,6 +1441,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/remove-deprecated/mutation-operations.test.ts b/packages/graphql/tests/schema/remove-deprecated/mutation-operations.test.ts index 01a97181df..2b465b18eb 100644 --- a/packages/graphql/tests/schema/remove-deprecated/mutation-operations.test.ts +++ b/packages/graphql/tests/schema/remove-deprecated/mutation-operations.test.ts @@ -74,6 +74,7 @@ describe("Deprecated mutation operations", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + value: IntScalarAggregationFilters value_AVERAGE_EQUAL: Float value_AVERAGE_GT: Float value_AVERAGE_GTE: Float @@ -144,6 +145,7 @@ describe("Deprecated mutation operations", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -165,6 +167,25 @@ describe("Deprecated mutation operations", () => { totalCount: Int! } + input ActorActedInConnectionFilters { + \\"\\"\\" + Return Actors where all of the related ActorActedInConnections match this filter + \\"\\"\\" + all: ActorActedInConnectionWhere + \\"\\"\\" + Return Actors where none of the related ActorActedInConnections match this filter + \\"\\"\\" + none: ActorActedInConnectionWhere + \\"\\"\\" + Return Actors where one of the related ActorActedInConnections match this filter + \\"\\"\\" + single: ActorActedInConnectionWhere + \\"\\"\\" + Return Actors where some of the related ActorActedInConnections match this filter + \\"\\"\\" + some: ActorActedInConnectionWhere + } + input ActorActedInConnectionSort { edge: ActedInSort node: MovieSort @@ -202,6 +223,7 @@ describe("Deprecated mutation operations", () => { AND: [ActorActedInNodeAggregationWhereInput!] NOT: ActorActedInNodeAggregationWhereInput OR: [ActorActedInNodeAggregationWhereInput!] + averageRating: FloatScalarAggregationFilters averageRating_AVERAGE_EQUAL: Float averageRating_AVERAGE_GT: Float averageRating_AVERAGE_GTE: Float @@ -222,6 +244,7 @@ describe("Deprecated mutation operations", () => { 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 @@ -240,6 +263,17 @@ describe("Deprecated mutation operations", () => { properties: ActedIn! } + input ActorActedInRelationshipFilters { + \\"\\"\\"Return Actors where all of the related Movies match this filter\\"\\"\\" + all: MovieWhere + \\"\\"\\"Return Actors where none of the related Movies match this filter\\"\\"\\" + none: MovieWhere + \\"\\"\\"Return Actors where one of the related Movies match this filter\\"\\"\\" + single: MovieWhere + \\"\\"\\"Return Actors where some of the related Movies match this filter\\"\\"\\" + some: MovieWhere + } + input ActorActedInUpdateConnectionInput { edge: ActedInUpdateInput node: MovieUpdateInput @@ -317,7 +351,9 @@ describe("Deprecated mutation operations", () => { AND: [ActorWhere!] NOT: ActorWhere OR: [ActorWhere!] + actedIn: ActorActedInRelationshipFilters actedInAggregate: ActorActedInAggregateInput + actedInConnection: ActorActedInConnectionFilters \\"\\"\\" Return Actors where all of the related ActorActedInConnections match this filter \\"\\"\\" @@ -379,12 +415,12 @@ describe("Deprecated mutation operations", () => { \\"\\"\\"Date filters\\"\\"\\" input DateScalarFilters { - equals: Date - greaterThan: Date - greaterThanEquals: Date + eq: Date + gt: Date + gte: Date in: [Date!] - lessThan: Date - lessThanEquals: Date + lt: Date + lte: Date } \\"\\"\\"Date mutations\\"\\"\\" @@ -409,18 +445,26 @@ describe("Deprecated mutation operations", () => { \\"\\"\\"Float list filters\\"\\"\\" input FloatListFilters { - equals: [FloatScalarFilters!] + 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 { - equals: Float - greaterThan: Float - greaterThanEquals: Float + eq: Float + gt: Float + gte: Float in: [Float!] - lessThan: Float - lessThanEquals: Float + lt: Float + lte: Float } \\"\\"\\"Float mutations\\"\\"\\" @@ -437,16 +481,22 @@ describe("Deprecated mutation operations", () => { shortest: ID } + \\"\\"\\"Filters for an aggregation of an ID input field\\"\\"\\" + input IDScalarAggregationFilters { + max: IDScalarFilters + min: IDScalarFilters + } + \\"\\"\\"ID filters\\"\\"\\" input IDScalarFilters { contains: ID endsWith: ID - equals: ID - greaterThan: ID - greaterThanEquals: ID + eq: ID + gt: ID + gte: ID in: [ID!] - lessThan: ID - lessThanEquals: ID + lt: ID + lte: ID matches: ID startsWith: ID } @@ -463,14 +513,22 @@ describe("Deprecated mutation operations", () => { sum: Int } + \\"\\"\\"Filters for an aggregation of an int field\\"\\"\\" + input IntScalarAggregationFilters { + average: FloatScalarFilters + max: IntScalarFilters + min: IntScalarFilters + sum: IntScalarFilters + } + \\"\\"\\"Int filters\\"\\"\\" input IntScalarFilters { - equals: Int - greaterThan: Int - greaterThanEquals: Int + eq: Int + gt: Int + gte: Int in: [Int!] - lessThan: Int - lessThanEquals: Int + lt: Int + lte: Int } \\"\\"\\"Int mutations\\"\\"\\" @@ -516,6 +574,7 @@ describe("Deprecated mutation operations", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -537,6 +596,25 @@ describe("Deprecated mutation operations", () => { totalCount: Int! } + input MovieActorsConnectionFilters { + \\"\\"\\" + Return Movies where all of the related MovieActorsConnections match this filter + \\"\\"\\" + all: MovieActorsConnectionWhere + \\"\\"\\" + Return Movies where none of the related MovieActorsConnections match this filter + \\"\\"\\" + none: MovieActorsConnectionWhere + \\"\\"\\" + Return Movies where one of the related MovieActorsConnections match this filter + \\"\\"\\" + single: MovieActorsConnectionWhere + \\"\\"\\" + Return Movies where some of the related MovieActorsConnections match this filter + \\"\\"\\" + some: MovieActorsConnectionWhere + } + input MovieActorsConnectionSort { edge: ActedInSort node: ActorSort @@ -574,6 +652,7 @@ describe("Deprecated mutation operations", () => { AND: [MovieActorsNodeAggregationWhereInput!] NOT: MovieActorsNodeAggregationWhereInput OR: [MovieActorsNodeAggregationWhereInput!] + name: StringScalarAggregationFilters name_AVERAGE_LENGTH_EQUAL: Float name_AVERAGE_LENGTH_GT: Float name_AVERAGE_LENGTH_GTE: Float @@ -597,6 +676,17 @@ describe("Deprecated mutation operations", () => { properties: ActedIn! } + input MovieActorsRelationshipFilters { + \\"\\"\\"Return Movies where all of the related Actors match this filter\\"\\"\\" + all: ActorWhere + \\"\\"\\"Return Movies where none of the related Actors match this filter\\"\\"\\" + none: ActorWhere + \\"\\"\\"Return Movies where one of the related Actors match this filter\\"\\"\\" + single: ActorWhere + \\"\\"\\"Return Movies where some of the related Actors match this filter\\"\\"\\" + some: ActorWhere + } + input MovieActorsUpdateConnectionInput { edge: ActedInUpdateInput node: ActorUpdateInput @@ -681,7 +771,9 @@ describe("Deprecated mutation operations", () => { AND: [MovieWhere!] NOT: MovieWhere OR: [MovieWhere!] + actors: MovieActorsRelationshipFilters actorsAggregate: MovieActorsAggregateInput + actorsConnection: MovieActorsConnectionFilters \\"\\"\\" Return Movies where all of the related MovieActorsConnections match this filter \\"\\"\\" @@ -782,17 +874,18 @@ describe("Deprecated mutation operations", () => { \\"\\"\\"Distance filters\\"\\"\\" input PointDistanceFilters { - equals: PointDistance - greaterThan: PointDistance - greaterThanEquals: PointDistance - lessThan: PointDistance - lessThanEquals: PointDistance + eq: Float + from: PointInput! + gt: Float + gte: Float + lt: Float + lte: Float } \\"\\"\\"Point filters\\"\\"\\" input PointFilters { distance: PointDistanceFilters - equals: PointInput + eq: PointInput in: [PointInput!] } @@ -830,16 +923,23 @@ describe("Deprecated mutation 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 endsWith: String - equals: String - greaterThan: String - greaterThanEquals: String + eq: String + gt: String + gte: String in: [String!] - lessThan: String - lessThanEquals: String + lt: String + lte: String matches: String startsWith: String } diff --git a/packages/graphql/tests/schema/string-comparators.test.ts b/packages/graphql/tests/schema/string-comparators.test.ts index 3dcc5b90c1..620cac8bf4 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 @@ -621,6 +622,7 @@ describe("String Comparators", () => { AND: [ActorActedInAggregateInput!] NOT: ActorActedInAggregateInput OR: [ActorActedInAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -698,6 +700,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 @@ -879,6 +882,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 @@ -904,6 +927,7 @@ describe("String Comparators", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -981,6 +1005,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 @@ -1161,6 +1186,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 96cfe206ac..953566312e 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 @@ -350,6 +351,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 @@ -602,6 +604,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 @@ -743,6 +752,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -815,6 +825,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -835,6 +846,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 @@ -855,6 +867,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 @@ -995,6 +1008,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 @@ -1019,6 +1040,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 @@ -1045,6 +1072,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 @@ -1080,6 +1115,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1515,6 +1551,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 @@ -1539,6 +1583,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 @@ -1565,6 +1615,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 @@ -2014,6 +2072,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2086,6 +2145,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -2106,6 +2166,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 @@ -2126,6 +2187,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 @@ -2290,6 +2352,7 @@ describe("Subscriptions", () => { AND: [StarMoviesAggregateInput!] NOT: StarMoviesAggregateInput OR: [StarMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2362,6 +2425,7 @@ describe("Subscriptions", () => { AND: [StarMoviesNodeAggregationWhereInput!] NOT: StarMoviesNodeAggregationWhereInput OR: [StarMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -2382,6 +2446,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 @@ -2402,6 +2467,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 @@ -2577,6 +2643,7 @@ describe("Subscriptions", () => { AND: [ActedInAggregationWhereInput!] NOT: ActedInAggregationWhereInput OR: [ActedInAggregationWhereInput!] + screenTime: IntScalarAggregationFilters screenTime_AVERAGE_EQUAL: Float screenTime_AVERAGE_GT: Float screenTime_AVERAGE_GTE: Float @@ -2687,6 +2754,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -2759,6 +2827,7 @@ describe("Subscriptions", () => { AND: [ActorMoviesNodeAggregationWhereInput!] NOT: ActorMoviesNodeAggregationWhereInput OR: [ActorMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -2779,6 +2848,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 @@ -2799,6 +2869,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 @@ -2939,6 +3010,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 @@ -2963,6 +3042,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 @@ -2989,6 +3074,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 @@ -3029,6 +3122,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3632,6 +3726,7 @@ describe("Subscriptions", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -3701,6 +3796,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 @@ -3899,6 +3995,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 @@ -4045,6 +4148,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 @@ -4069,6 +4180,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 @@ -4095,6 +4212,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 @@ -4544,6 +4669,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4616,6 +4742,7 @@ describe("Subscriptions", () => { AND: [PersonMoviesNodeAggregationWhereInput!] NOT: PersonMoviesNodeAggregationWhereInput OR: [PersonMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -4636,6 +4763,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 @@ -4656,6 +4784,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 @@ -4810,6 +4939,7 @@ describe("Subscriptions", () => { AND: [StarMoviesAggregateInput!] NOT: StarMoviesAggregateInput OR: [StarMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -4882,6 +5012,7 @@ describe("Subscriptions", () => { AND: [StarMoviesNodeAggregationWhereInput!] NOT: StarMoviesNodeAggregationWhereInput OR: [StarMoviesNodeAggregationWhereInput!] + actorCount: IntScalarAggregationFilters actorCount_AVERAGE_EQUAL: Float actorCount_AVERAGE_GT: Float actorCount_AVERAGE_GTE: Float @@ -4902,6 +5033,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 @@ -4922,6 +5054,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 d21101acd7..cb7a4dbb4f 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 @@ -203,6 +204,7 @@ describe("Union Interface Relationships", () => { AND: [ActorMoviesAggregateInput!] NOT: ActorMoviesAggregateInput OR: [ActorMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -280,6 +282,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 @@ -300,6 +303,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 @@ -497,6 +501,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 @@ -582,6 +596,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 @@ -631,6 +653,7 @@ describe("Union Interface Relationships", () => { AND: [MovieActorsAggregateInput!] NOT: MovieActorsAggregateInput OR: [MovieActorsAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -708,6 +731,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 @@ -728,6 +752,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 @@ -1008,6 +1033,7 @@ describe("Union Interface Relationships", () => { AND: [MovieReviewersAggregateInput!] NOT: MovieReviewersAggregateInput OR: [MovieReviewersAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1082,6 +1108,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 @@ -1102,6 +1129,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 @@ -1375,6 +1403,7 @@ describe("Union Interface Relationships", () => { AND: [PersonMoviesAggregateInput!] NOT: PersonMoviesAggregateInput OR: [PersonMoviesAggregateInput!] + count: IntScalarFilters count_EQ: Int count_GT: Int count_GTE: Int @@ -1452,6 +1481,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 @@ -1472,6 +1502,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 @@ -1640,6 +1671,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 @@ -1779,6 +1811,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