-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5836 from neo4j/generic-scalar-filters
Generic input filters
- Loading branch information
Showing
492 changed files
with
74,375 additions
and
20,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@neo4j/graphql": major | ||
--- | ||
|
||
The `typename_IN` filter has been renamed to `typename`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@neo4j/graphql": major | ||
--- | ||
|
||
Aggregations are no longer generated for `ID` fields. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Deprecate individual mutations in favor of generic mutations | ||
|
||
- `_SET` | ||
- `_POP` | ||
- `_PUSH` | ||
- `_INCREMENT` | ||
- `_ADD` | ||
- `_DECREMENT` | ||
- `_SUBTRACT` | ||
- `_MULTIPLY` | ||
- `_DIVIDE` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"@neo4j/graphql": minor | ||
--- | ||
|
||
Add suport for generic update operators: | ||
|
||
```graphql | ||
mutation { | ||
updateMovies(update: { name: { set: "The Matrix" } }) { | ||
movies { | ||
id | ||
name | ||
} | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Deprecates old aggregation filters for relationships in favor of more generic filters: | ||
|
||
Before: | ||
|
||
```js | ||
query Movies { | ||
movies( | ||
where: { actorsAggregate: { node: { lastRating_AVERAGE_GT: 6 } } } | ||
) { | ||
title | ||
} | ||
} | ||
``` | ||
|
||
Now: | ||
|
||
```js | ||
query Movies { | ||
movies( | ||
where: { | ||
actorsAggregate: { node: { lastRating: { average: { gt: 6 } } } } | ||
} | ||
) { | ||
title | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Deprecate relationship filtering using the non-generic version such as `actors_SOME: { title_EQ: "The Matrix" }` in favor of the generic input `actors: { some: { title: { eq: "The Matrix" } } }`. | ||
The setting `excludeDeprecatedFields` now contains the option `relationshipFilters` to remove these deprecated filters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Deprecate attribute filtering using the non-generic version such as `title_EQ: "The Matrix"` in favor of the generic input `title: { eq: "The Matrix" }`. | ||
The setting `excludeDeprecatedFields` now contains the option `attributeFilters` to remove these deprecated filters. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Add generic filters for aggregations: | ||
|
||
```graphql | ||
{ | ||
posts(where: { likesAggregate: { node: { rating: { average: { eq: 3.2 } } } } }) { | ||
title | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
"@neo4j/graphql": patch | ||
--- | ||
|
||
Introduce the flag "aggregationFilters" to remove deprecated aggregation filters: | ||
|
||
```js | ||
const neoSchema = new Neo4jGraphQL({ | ||
typeDefs, | ||
features: { excludeDeprecatedFields: { aggregationFilters: true } }, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
"@neo4j/graphql": minor | ||
--- | ||
|
||
Introduce a new style for filtering relationships and connections. | ||
The quantifiers `SOME` | `NONE` | `SINGLE` | `ALL` are now available as a nested input object. | ||
|
||
**Relationship** | ||
|
||
```graphql | ||
{ | ||
movies(where: { genres: { some: { name: { equals: "some genre" } } } }) { | ||
actorCount | ||
} | ||
} | ||
``` | ||
|
||
**Connection** | ||
```graphql | ||
{ | ||
movies(where: { genresConnection: { some: { node: { name: { equals: "some genre" } } } } }) { | ||
actorCount | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...l/src/graphql/input-objects/generic-aggregation-filters/BigIntScalarAggregationFilters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}); |
30 changes: 30 additions & 0 deletions
30
...src/graphql/input-objects/generic-aggregation-filters/DateTimeScalarAggregationFilters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}); |
31 changes: 31 additions & 0 deletions
31
...src/graphql/input-objects/generic-aggregation-filters/DurationScalarAggregationFilters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}); |
32 changes: 32 additions & 0 deletions
32
...ql/src/graphql/input-objects/generic-aggregation-filters/FloatScalarAggregationFilters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}); |
33 changes: 33 additions & 0 deletions
33
...phql/src/graphql/input-objects/generic-aggregation-filters/IntScalarAggregationFilters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
}, | ||
}); |
Oops, something went wrong.