-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement aggregations on nested fields (#136)
Turns on the nested field aggregation connector capability, and makes it work. This also touches up the aggregation implementation generally. It uses the updated, unified system for referencing fields with paths. It also changes aggregation result types (besides count) to be nullable which avoids an error when aggregating over an empty document set.
- Loading branch information
Showing
22 changed files
with
780 additions
and
254 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
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
17 changes: 17 additions & 0 deletions
17
...ests/snapshots/integration_tests__tests__aggregation__aggregates_nested_field_values.snap
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,17 @@ | ||
--- | ||
source: crates/integration-tests/src/tests/aggregation.rs | ||
expression: "graphql_query(r#\"\n query {\n moviesAggregate(\n filter_input: {where: {title: {_in: [\"Within Our Gates\", \"The Ace of Hearts\"]}}}\n ) {\n tomatoes {\n viewer {\n rating {\n avg\n }\n }\n critic {\n rating {\n avg\n }\n }\n }\n imdb {\n rating {\n avg\n }\n }\n }\n }\n \"#).run().await?" | ||
--- | ||
data: | ||
moviesAggregate: | ||
tomatoes: | ||
viewer: | ||
rating: | ||
avg: 3.45 | ||
critic: | ||
rating: | ||
avg: ~ | ||
imdb: | ||
rating: | ||
avg: 6.65 | ||
errors: ~ |
9 changes: 9 additions & 0 deletions
9
...ntegration_tests__tests__aggregation__returns_null_when_aggregating_empty_result_set.snap
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,9 @@ | ||
--- | ||
source: crates/integration-tests/src/tests/aggregation.rs | ||
expression: "graphql_query(r#\"\n query {\n moviesAggregate(filter_input: {where: {title: {_eq: \"no such movie\"}}}) {\n runtime {\n avg\n }\n }\n }\n \"#).run().await?" | ||
--- | ||
data: | ||
moviesAggregate: | ||
runtime: | ||
avg: ~ | ||
errors: ~ |
10 changes: 10 additions & 0 deletions
10
...s/integration_tests__tests__aggregation__returns_zero_when_counting_empty_result_set.snap
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,10 @@ | ||
--- | ||
source: crates/integration-tests/src/tests/aggregation.rs | ||
expression: "graphql_query(r#\"\n query {\n moviesAggregate(filter_input: {where: {title: {_eq: \"no such movie\"}}}) {\n _count\n title {\n count\n }\n }\n }\n \"#).run().await?" | ||
--- | ||
data: | ||
moviesAggregate: | ||
_count: 0 | ||
title: | ||
count: 0 | ||
errors: ~ |
11 changes: 11 additions & 0 deletions
11
...ts__tests__aggregation__returns_zero_when_counting_nested_fields_in_empty_result_set.snap
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,11 @@ | ||
--- | ||
source: crates/integration-tests/src/tests/aggregation.rs | ||
expression: "graphql_query(r#\"\n query {\n moviesAggregate(filter_input: {where: {title: {_eq: \"no such movie\"}}}) {\n awards {\n nominations {\n count\n _count\n }\n }\n }\n }\n \"#).run().await?" | ||
--- | ||
data: | ||
moviesAggregate: | ||
awards: | ||
nominations: | ||
count: 0 | ||
_count: 0 | ||
errors: ~ |
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
Oops, something went wrong.