From 896836b784afdceab50ed2675e647a79a8e1e03c Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 6 Aug 2024 16:20:33 -0700 Subject: [PATCH 1/8] aggregations for track unit prices --- .../hasura/chinook/metadata/models/Track.hml | 19 +++++++++ .../common/metadata/scalar-types/Decimal.hml | 39 +++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/chinook/metadata/models/Track.hml index c681ce5c..27055df4 100644 --- a/fixtures/hasura/chinook/metadata/models/Track.hml +++ b/fixtures/hasura/chinook/metadata/models/Track.hml @@ -130,6 +130,20 @@ definition: graphql: typeName: TrackComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: TrackAggregateExp + operand: + object: + aggregatedType: Track + aggregatableFields: + - fieldName: unitPrice + aggregateExpression: DecimalAggregateExp + graphql: + selectTypeName: TrackAggregateExp + --- kind: Model version: v1 @@ -139,6 +153,7 @@ definition: source: dataConnectorName: chinook collection: Track + aggregateExpression: TrackAggregateExp filterExpressionType: TrackComparisonExp orderableFields: - fieldName: id @@ -172,6 +187,10 @@ definition: orderByDirections: enableAll: true graphql: + aggregate: + queryRootField: + trackAggregate + filterInputTypeName: TrackFilterInput selectMany: queryRootField: track selectUniques: diff --git a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml index f8a034a3..60043d93 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml @@ -68,3 +68,42 @@ definition: enable: true graphql: typeName: DecimalComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: DecimalAggregateExp + operand: + scalar: + aggregatedType: Decimal + aggregationFunctions: + - name: avg + returnType: Decimal + - name: count + returnType: Int + - name: max + returnType: Decimal + - name: min + returnType: Decimal + - name: sum + returnType: Decimal + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Decimal + functionMapping: + avg: { name: avg } + count: { name: count } + max: { name: max } + min: { name: min } + sum: { name: sum } + - dataConnectorName: sample_mflix + dataConnectorScalarType: Decimal + functionMapping: + avg: { name: avg } + count: { name: count } + max: { name: max } + min: { name: min } + sum: { name: sum } + graphql: + selectTypeName: DecimalAggregateExp From 133fd6855486f4d5f145ff35f82d5592c1d33d53 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Tue, 6 Aug 2024 17:41:58 -0700 Subject: [PATCH 2/8] enable counts, change aggregation names --- .../hasura/chinook/metadata/models/Track.hml | 1 + .../common/metadata/scalar-types/Decimal.hml | 32 +++++++++---------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/chinook/metadata/models/Track.hml index 27055df4..e403601c 100644 --- a/fixtures/hasura/chinook/metadata/models/Track.hml +++ b/fixtures/hasura/chinook/metadata/models/Track.hml @@ -141,6 +141,7 @@ definition: aggregatableFields: - fieldName: unitPrice aggregateExpression: DecimalAggregateExp + count: { enable: true } graphql: selectTypeName: TrackAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml index 60043d93..05079d83 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml @@ -78,32 +78,32 @@ definition: scalar: aggregatedType: Decimal aggregationFunctions: - - name: avg + - name: _avg returnType: Decimal - - name: count - returnType: Int - - name: max + - name: _max returnType: Decimal - - name: min + - name: _min returnType: Decimal - - name: sum + - name: _sum returnType: Decimal dataConnectorAggregationFunctionMapping: - dataConnectorName: chinook dataConnectorScalarType: Decimal functionMapping: - avg: { name: avg } - count: { name: count } - max: { name: max } - min: { name: min } - sum: { name: sum } + _avg: { name: avg } + _count: { name: count } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } - dataConnectorName: sample_mflix dataConnectorScalarType: Decimal functionMapping: - avg: { name: avg } - count: { name: count } - max: { name: max } - min: { name: min } - sum: { name: sum } + _avg: { name: avg } + _count: { name: count } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } + count: { enable: true } + countDistinct: { enable: true } graphql: selectTypeName: DecimalAggregateExp From c84afe59bb8fbe8339bb1d0652d31556c2ea12af Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 12:04:00 -0700 Subject: [PATCH 3/8] aggregate expression types for chinook --- .../chinook/metadata/models/Invoice.hml | 15 ++++++++ .../chinook/metadata/models/InvoiceLine.hml | 17 +++++++++ .../hasura/chinook/metadata/models/Track.hml | 4 ++ .../common/metadata/scalar-types/Date.hml | 29 +++++++++++++++ .../common/metadata/scalar-types/Decimal.hml | 2 - .../common/metadata/scalar-types/Double.hml | 37 +++++++++++++++++++ .../common/metadata/scalar-types/Int.hml | 37 +++++++++++++++++++ 7 files changed, 139 insertions(+), 2 deletions(-) diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/chinook/metadata/models/Invoice.hml index 654de3b8..490f237e 100644 --- a/fixtures/hasura/chinook/metadata/models/Invoice.hml +++ b/fixtures/hasura/chinook/metadata/models/Invoice.hml @@ -124,6 +124,21 @@ definition: graphql: typeName: InvoiceComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: InvoiceAggregateExp + operand: + object: + aggregatedType: Invoice + aggregatableFields: + - fieldName: total + aggregateExpression: DecimalAggregateExp + count: { enable: true } + graphql: + selectTypeName: InvoiceAggregateExp + --- kind: Model version: v1 diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml index fcf35656..0fed467d 100644 --- a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml +++ b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml @@ -92,6 +92,23 @@ definition: graphql: typeName: InvoiceLineComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: InvoiceLineAggregateExp + operand: + object: + aggregatedType: InvoiceLine + aggregatableFields: + - fieldName: quantity + aggregateExpression: IntAggregateExp + - fieldName: unitPrice + aggregateExpression: DecimalAggregateExp + count: { enable: true } + graphql: + selectTypeName: InvoiceLineAggregateExp + --- kind: Model version: v1 diff --git a/fixtures/hasura/chinook/metadata/models/Track.hml b/fixtures/hasura/chinook/metadata/models/Track.hml index e403601c..4755352d 100644 --- a/fixtures/hasura/chinook/metadata/models/Track.hml +++ b/fixtures/hasura/chinook/metadata/models/Track.hml @@ -141,6 +141,10 @@ definition: aggregatableFields: - fieldName: unitPrice aggregateExpression: DecimalAggregateExp + - fieldName: bytes + aggregateExpression: IntAggregateExp + - fieldName: milliseconds + aggregateExpression: IntAggregateExp count: { enable: true } graphql: selectTypeName: TrackAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/Date.hml b/fixtures/hasura/common/metadata/scalar-types/Date.hml index 56e6f057..62085c8c 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Date.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Date.hml @@ -69,3 +69,32 @@ definition: graphql: typeName: DateComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: DateAggregateExp + operand: + scalar: + aggregatedType: Date + aggregationFunctions: + - name: _max + returnType: Date + - name: _min + returnType: Date + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Date + functionMapping: + _max: { name: max } + _min: { name: min } + - dataConnectorName: sample_mflix + dataConnectorScalarType: Date + functionMapping: + _max: { name: max } + _min: { name: min } + count: { enable: true } + countDistinct: { enable: true } + graphql: + selectTypeName: DateAggregateExp + diff --git a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml index 05079d83..1b1eb061 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Decimal.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Decimal.hml @@ -91,7 +91,6 @@ definition: dataConnectorScalarType: Decimal functionMapping: _avg: { name: avg } - _count: { name: count } _max: { name: max } _min: { name: min } _sum: { name: sum } @@ -99,7 +98,6 @@ definition: dataConnectorScalarType: Decimal functionMapping: _avg: { name: avg } - _count: { name: count } _max: { name: max } _min: { name: min } _sum: { name: sum } diff --git a/fixtures/hasura/common/metadata/scalar-types/Double.hml b/fixtures/hasura/common/metadata/scalar-types/Double.hml index ea7e305a..7d4af850 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Double.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Double.hml @@ -60,3 +60,40 @@ definition: enable: true graphql: typeName: DoubleComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: FloatAggregateExp + operand: + scalar: + aggregatedType: Float + aggregationFunctions: + - name: _avg + returnType: Float + - name: _max + returnType: Float + - name: _min + returnType: Float + - name: _sum + returnType: Float + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Double + functionMapping: + _avg: { name: avg } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } + - dataConnectorName: sample_mflix + dataConnectorScalarType: Double + functionMapping: + _avg: { name: avg } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } + count: { enable: true } + countDistinct: { enable: true } + graphql: + selectTypeName: FloatAggregateExp diff --git a/fixtures/hasura/common/metadata/scalar-types/Int.hml b/fixtures/hasura/common/metadata/scalar-types/Int.hml index 0afb1b1e..d5d7b0bd 100644 --- a/fixtures/hasura/common/metadata/scalar-types/Int.hml +++ b/fixtures/hasura/common/metadata/scalar-types/Int.hml @@ -60,3 +60,40 @@ definition: enable: true graphql: typeName: IntComparisonExp + +--- +kind: AggregateExpression +version: v1 +definition: + name: IntAggregateExp + operand: + scalar: + aggregatedType: Int + aggregationFunctions: + - name: _avg + returnType: Int + - name: _max + returnType: Int + - name: _min + returnType: Int + - name: _sum + returnType: Int + dataConnectorAggregationFunctionMapping: + - dataConnectorName: chinook + dataConnectorScalarType: Int + functionMapping: + _avg: { name: avg } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } + - dataConnectorName: sample_mflix + dataConnectorScalarType: Int + functionMapping: + _avg: { name: avg } + _max: { name: max } + _min: { name: min } + _sum: { name: sum } + count: { enable: true } + countDistinct: { enable: true } + graphql: + selectTypeName: IntAggregateExp From 51cbe921cf05a247add79f0fc961d755d8e1e3c1 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 12:23:19 -0700 Subject: [PATCH 4/8] aggregate expression types for sample_mlix --- .../sample_mflix/metadata/models/Comments.hml | 15 +++ .../sample_mflix/metadata/models/Movies.hml | 124 ++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml index 9014c47c..c6adadf8 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml @@ -100,6 +100,21 @@ definition: graphql: typeName: CommentsComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: CommentsAggregateExp + operand: + object: + aggregatedType: Comments + aggregatableFields: + - fieldName: date + aggregateExpression: DateAggregateExp + count: { enable: true } + graphql: + selectTypeName: CommentsAggregateExp + --- kind: Model version: v1 diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index bf25fadc..55e11579 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -53,6 +53,23 @@ definition: graphql: typeName: MoviesAwardsComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesAwardsAggregateExp + operand: + object: + aggregatedType: MoviesAwards + aggregatableFields: + - fieldName: nominations + aggregateExpression: IntAggregateExp + - fieldName: wins + aggregateExpression: IntAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesAwardsAggregateExp + --- kind: ObjectType version: v1 @@ -108,6 +125,23 @@ definition: graphql: typeName: MoviesImdbComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesImdbAggregateExp + operand: + object: + aggregatedType: MoviesImdb + aggregatableFields: + - fieldName: rating + aggregateExpression: FloatAggregateExp + - fieldName: votes + aggregateExpression: IntAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesImdbAggregateExp + --- kind: ObjectType version: v1 @@ -163,6 +197,25 @@ definition: graphql: typeName: MoviesTomatoesCriticComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesTomatoesCriticAggregateExp + operand: + object: + aggregatedType: MoviesTomatoesCritic + aggregatableFields: + - fieldName: meter + aggregateExpression: IntAggregateExp + - fieldName: numReviews + aggregateExpression: IntAggregateExp + - fieldName: rating + aggregateExpression: FloatAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesTomatoesCriticAggregateExp + --- kind: ObjectType version: v1 @@ -218,6 +271,25 @@ definition: graphql: typeName: MoviesTomatoesViewerComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesTomatoesViewerAggregateExp + operand: + object: + aggregatedType: MoviesTomatoesViewer + aggregatableFields: + - fieldName: meter + aggregateExpression: IntAggregateExp + - fieldName: numReviews + aggregateExpression: IntAggregateExp + - fieldName: rating + aggregateExpression: FloatAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesTomatoesViewerAggregateExp + --- kind: ObjectType version: v1 @@ -308,6 +380,29 @@ definition: graphql: typeName: MoviesTomatoesComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesTomatoesAggregateExp + operand: + object: + aggregatedType: MoviesTomatoes + aggregatableFields: + - fieldName: critic + aggregateExpression: MoviesTomatoesCriticAggregateExp + - fieldName: dvd + aggregateExpression: DateAggregateExp + - fieldName: fresh + aggregateExpression: IntAggregateExp + - fieldName: rotten + aggregateExpression: IntAggregateExp + - fieldName: viewer + aggregateExpression: MoviesTomatoesViewerAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesTomatoesAggregateExp + --- kind: ObjectType version: v1 @@ -515,6 +610,35 @@ definition: graphql: typeName: MoviesComparisonExp +--- +kind: AggregateExpression +version: v1 +definition: + name: MoviesAggregateExp + operand: + object: + aggregatedType: Movies + aggregatableFields: + - fieldName: awards + aggregateExpression: MoviesAwardsAggregateExp + - fieldName: imdb + aggregateExpression: MoviesImdbAggregateExp + - fieldName: metacritic + aggregateExpression: IntAggregateExp + - fieldName: numMflixComments + aggregateExpression: IntAggregateExp + - fieldName: released + aggregateExpression: DateAggregateExp + - fieldName: runtime + aggregateExpression: IntAggregateExp + - fieldName: tomatoes + aggregateExpression: MoviesTomatoesAggregateExp + - fieldName: year + aggregateExpression: IntAggregateExp + count: { enable: true } + graphql: + selectTypeName: MoviesAggregateExp + --- kind: Model version: v1 From a91e68e0cf0d55e9fc20c8ac523a61c02757988d Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 12:31:54 -0700 Subject: [PATCH 5/8] oh right, we need to configure aggregates in Model definitions --- fixtures/hasura/chinook/metadata/models/Invoice.hml | 4 ++++ fixtures/hasura/chinook/metadata/models/InvoiceLine.hml | 4 ++++ fixtures/hasura/sample_mflix/metadata/models/Comments.hml | 3 +++ fixtures/hasura/sample_mflix/metadata/models/Movies.hml | 4 ++++ 4 files changed, 15 insertions(+) diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/chinook/metadata/models/Invoice.hml index 490f237e..9264cef6 100644 --- a/fixtures/hasura/chinook/metadata/models/Invoice.hml +++ b/fixtures/hasura/chinook/metadata/models/Invoice.hml @@ -148,6 +148,7 @@ definition: source: dataConnectorName: chinook collection: Invoice + aggregateExpression: InvoiceAggregateExp filterExpressionType: InvoiceComparisonExp orderableFields: - fieldName: id @@ -181,6 +182,9 @@ definition: orderByDirections: enableAll: true graphql: + aggregate: + queryRootField: + invoiceAggregate selectMany: queryRootField: invoice selectUniques: diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml index 0fed467d..e5b27c72 100644 --- a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml +++ b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml @@ -118,6 +118,7 @@ definition: source: dataConnectorName: chinook collection: InvoiceLine + aggregateExpression: InvoiceLineAggregateExp filterExpressionType: InvoiceLineComparisonExp orderableFields: - fieldName: id @@ -139,6 +140,9 @@ definition: orderByDirections: enableAll: true graphql: + aggregate: + queryRootField: + invoiceLineAggregate selectMany: queryRootField: invoiceLine selectUniques: diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml index c6adadf8..f0c92213 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml @@ -145,6 +145,9 @@ definition: orderByDirections: enableAll: true graphql: + aggregate: + queryRootField: + commentsAggregate selectMany: queryRootField: comments selectUniques: diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index 55e11579..79d9d2e8 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -648,6 +648,7 @@ definition: source: dataConnectorName: sample_mflix collection: movies + aggregateExpression: MoviesAggregateExp filterExpressionType: MoviesComparisonExp orderableFields: - fieldName: id @@ -717,6 +718,9 @@ definition: orderByDirections: enableAll: true graphql: + aggregate: + queryRootField: + moviesAggregate selectMany: queryRootField: movies selectUniques: From feed62093b2c19cb03963fa4fe36b3e72cf85ded Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 12:39:33 -0700 Subject: [PATCH 6/8] comment out nested field aggregates pending connector update --- .../hasura/sample_mflix/metadata/models/Movies.hml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index 79d9d2e8..dc8c3f18 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -619,10 +619,12 @@ definition: object: aggregatedType: Movies aggregatableFields: - - fieldName: awards - aggregateExpression: MoviesAwardsAggregateExp - - fieldName: imdb - aggregateExpression: MoviesImdbAggregateExp + # TODO: This requires updating the connector to support nested field + # aggregates + # - fieldName: awards + # aggregateExpression: MoviesAwardsAggregateExp + # - fieldName: imdb + # aggregateExpression: MoviesImdbAggregateExp - fieldName: metacritic aggregateExpression: IntAggregateExp - fieldName: numMflixComments @@ -631,8 +633,8 @@ definition: aggregateExpression: DateAggregateExp - fieldName: runtime aggregateExpression: IntAggregateExp - - fieldName: tomatoes - aggregateExpression: MoviesTomatoesAggregateExp + # - fieldName: tomatoes + # aggregateExpression: MoviesTomatoesAggregateExp - fieldName: year aggregateExpression: IntAggregateExp count: { enable: true } From 45022a9cdf57da50aa1772cecdc47c8e4bc9b2e3 Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 12:40:50 -0700 Subject: [PATCH 7/8] oh right, we need to specify filterInputTypeName --- fixtures/hasura/chinook/metadata/models/Invoice.hml | 1 + fixtures/hasura/chinook/metadata/models/InvoiceLine.hml | 1 + fixtures/hasura/sample_mflix/metadata/models/Comments.hml | 2 ++ fixtures/hasura/sample_mflix/metadata/models/Movies.hml | 1 + 4 files changed, 5 insertions(+) diff --git a/fixtures/hasura/chinook/metadata/models/Invoice.hml b/fixtures/hasura/chinook/metadata/models/Invoice.hml index 9264cef6..f48cdd1c 100644 --- a/fixtures/hasura/chinook/metadata/models/Invoice.hml +++ b/fixtures/hasura/chinook/metadata/models/Invoice.hml @@ -185,6 +185,7 @@ definition: aggregate: queryRootField: invoiceAggregate + filterInputTypeName: InvoiceFilterInput selectMany: queryRootField: invoice selectUniques: diff --git a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml index e5b27c72..223b5902 100644 --- a/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml +++ b/fixtures/hasura/chinook/metadata/models/InvoiceLine.hml @@ -143,6 +143,7 @@ definition: aggregate: queryRootField: invoiceLineAggregate + filterInputTypeName: InvoiceLineFilterInput selectMany: queryRootField: invoiceLine selectUniques: diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml index f0c92213..a08960ce 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml @@ -124,6 +124,7 @@ definition: source: dataConnectorName: sample_mflix collection: comments + aggregateExpression: CommentsAggregateExp filterExpressionType: CommentsComparisonExp orderableFields: - fieldName: id @@ -148,6 +149,7 @@ definition: aggregate: queryRootField: commentsAggregate + filterInputTypeName: CommentsFilterInput selectMany: queryRootField: comments selectUniques: diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index dc8c3f18..611cbdf4 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -723,6 +723,7 @@ definition: aggregate: queryRootField: moviesAggregate + filterInputTypeName: MoviesFilterInput selectMany: queryRootField: movies selectUniques: From 078a0ae7424dac16cf61328da050a38d3d5c145d Mon Sep 17 00:00:00 2001 From: Jesse Hallett Date: Thu, 8 Aug 2024 16:33:18 -0700 Subject: [PATCH 8/8] fixes --- .../sample_mflix/metadata/models/Comments.hml | 9 ++++----- .../hasura/sample_mflix/metadata/models/Movies.hml | 14 +++++++------- .../hasura/sample_mflix/metadata/sample_mflix.hml | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml index a08960ce..f6bb1d91 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Comments.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Comments.hml @@ -147,8 +147,7 @@ definition: enableAll: true graphql: aggregate: - queryRootField: - commentsAggregate + queryRootField: commentsAggregate filterInputTypeName: CommentsFilterInput selectMany: queryRootField: comments @@ -169,12 +168,12 @@ definition: filter: null - role: user select: - filter: + filter: relationship: name: user - predicate: + predicate: fieldComparison: field: id operator: _eq - value: + value: sessionVariable: x-hasura-user-id diff --git a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml index 611cbdf4..87479299 100644 --- a/fixtures/hasura/sample_mflix/metadata/models/Movies.hml +++ b/fixtures/hasura/sample_mflix/metadata/models/Movies.hml @@ -307,7 +307,7 @@ definition: - name: fresh type: Int - name: lastUpdated - type: String! + type: Date! - name: production type: String - name: rotten @@ -363,7 +363,7 @@ definition: - fieldName: fresh booleanExpressionType: IntComparisonExp - fieldName: lastUpdated - booleanExpressionType: StringComparisonExp + booleanExpressionType: DateComparisonExp - fieldName: production booleanExpressionType: StringComparisonExp - fieldName: rotten @@ -395,6 +395,8 @@ definition: aggregateExpression: DateAggregateExp - fieldName: fresh aggregateExpression: IntAggregateExp + - fieldName: lastUpdated + aggregateExpression: DateAggregateExp - fieldName: rotten aggregateExpression: IntAggregateExp - fieldName: viewer @@ -428,7 +430,7 @@ definition: - name: languages type: "[String!]" - name: lastupdated - type: Date! + type: String! - name: metacritic type: Int - name: numMflixComments @@ -577,7 +579,7 @@ definition: - fieldName: imdb booleanExpressionType: MoviesImdbComparisonExp - fieldName: lastupdated - booleanExpressionType: DateComparisonExp + booleanExpressionType: StringComparisonExp - fieldName: metacritic booleanExpressionType: IntComparisonExp - fieldName: numMflixComments @@ -721,8 +723,7 @@ definition: enableAll: true graphql: aggregate: - queryRootField: - moviesAggregate + queryRootField: moviesAggregate filterInputTypeName: MoviesFilterInput selectMany: queryRootField: movies @@ -741,4 +742,3 @@ definition: - role: admin select: filter: null - diff --git a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml index 66d3e245..e552ce2f 100644 --- a/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml +++ b/fixtures/hasura/sample_mflix/metadata/sample_mflix.hml @@ -964,7 +964,7 @@ definition: name: String procedures: [] capabilities: - version: 0.1.4 + version: 0.1.5 capabilities: query: aggregates: {}