-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aggregations): Add aggregations to graphql
- Loading branch information
1 parent
c37b7ae
commit af075d2
Showing
29 changed files
with
834 additions
and
9 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
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
82 changes: 82 additions & 0 deletions
82
packages/query-graphql/__tests__/__fixtures__/aggregate-args-type.graphql
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,82 @@ | ||
type Query { | ||
aggregate( | ||
"""Filter to find records to aggregate on""" | ||
filter: FakeTypeAggregateFilter | ||
): Int! | ||
} | ||
|
||
input FakeTypeAggregateFilter { | ||
and: [FakeTypeAggregateFilter!] | ||
or: [FakeTypeAggregateFilter!] | ||
stringField: StringFieldComparison | ||
numberField: NumberFieldComparison | ||
boolField: BooleanFieldComparison | ||
dateField: DateFieldComparison | ||
} | ||
|
||
input StringFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: String | ||
neq: String | ||
gt: String | ||
gte: String | ||
lt: String | ||
lte: String | ||
like: String | ||
notLike: String | ||
iLike: String | ||
notILike: String | ||
in: [String!] | ||
notIn: [String!] | ||
} | ||
|
||
input NumberFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: Float | ||
neq: Float | ||
gt: Float | ||
gte: Float | ||
lt: Float | ||
lte: Float | ||
in: [Float!] | ||
notIn: [Float!] | ||
between: NumberFieldComparisonBetween | ||
notBetween: NumberFieldComparisonBetween | ||
} | ||
|
||
input NumberFieldComparisonBetween { | ||
lower: Float! | ||
upper: Float! | ||
} | ||
|
||
input BooleanFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
} | ||
|
||
input DateFieldComparison { | ||
is: Boolean | ||
isNot: Boolean | ||
eq: DateTime | ||
neq: DateTime | ||
gt: DateTime | ||
gte: DateTime | ||
lt: DateTime | ||
lte: DateTime | ||
in: [DateTime!] | ||
notIn: [DateTime!] | ||
between: DateFieldComparisonBetween | ||
notBetween: DateFieldComparisonBetween | ||
} | ||
|
||
""" | ||
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. | ||
""" | ||
scalar DateTime | ||
|
||
input DateFieldComparisonBetween { | ||
lower: DateTime! | ||
upper: DateTime! | ||
} |
70 changes: 70 additions & 0 deletions
70
...ges/query-graphql/__tests__/__fixtures__/aggregate-response-type-with-custom-name.graphql
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,70 @@ | ||
type FakeTypeCountAggregate { | ||
stringField: Int | ||
numberField: Int | ||
boolField: Int | ||
dateField: Int | ||
} | ||
|
||
type FakeTypeSumAggregate { | ||
numberField: Float | ||
} | ||
|
||
type FakeTypeAvgAggregate { | ||
numberField: Float | ||
} | ||
|
||
type FakeTypeMinAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
""" | ||
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. | ||
""" | ||
scalar DateTime | ||
|
||
type FakeTypeMaxAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
type CustomPrefixCountAggregate { | ||
stringField: Int | ||
numberField: Int | ||
boolField: Int | ||
dateField: Int | ||
} | ||
|
||
type CustomPrefixSumAggregate { | ||
numberField: Float | ||
} | ||
|
||
type CustomPrefixAvgAggregate { | ||
numberField: Float | ||
} | ||
|
||
type CustomPrefixMinAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
type CustomPrefixMaxAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
type CustomPrefixAggregateResponse { | ||
count: CustomPrefixCountAggregate | ||
sum: CustomPrefixSumAggregate | ||
avg: CustomPrefixAvgAggregate | ||
min: CustomPrefixMinAggregate | ||
max: CustomPrefixMaxAggregate | ||
} | ||
|
||
type Query { | ||
aggregate: CustomPrefixAggregateResponse! | ||
} |
43 changes: 43 additions & 0 deletions
43
packages/query-graphql/__tests__/__fixtures__/aggregate-response-type.graphql
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,43 @@ | ||
type FakeTypeCountAggregate { | ||
stringField: Int | ||
numberField: Int | ||
boolField: Int | ||
dateField: Int | ||
} | ||
|
||
type FakeTypeSumAggregate { | ||
numberField: Float | ||
} | ||
|
||
type FakeTypeAvgAggregate { | ||
numberField: Float | ||
} | ||
|
||
type FakeTypeMinAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
""" | ||
A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. | ||
""" | ||
scalar DateTime | ||
|
||
type FakeTypeMaxAggregate { | ||
stringField: String | ||
numberField: Float | ||
dateField: DateTime | ||
} | ||
|
||
type FakeTypeAggregateResponse { | ||
count: FakeTypeCountAggregate | ||
sum: FakeTypeSumAggregate | ||
avg: FakeTypeAvgAggregate | ||
min: FakeTypeMinAggregate | ||
max: FakeTypeMaxAggregate | ||
} | ||
|
||
type Query { | ||
aggregate: FakeTypeAggregateResponse! | ||
} |
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.