Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vmrajas committed Dec 10, 2020
1 parent 70c443f commit eac38d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions graphql/e2e/common/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,7 @@ func queryAggregateWithRepeatedFields(t *testing.T) {
tmin : titleMin
tmin_again : titleMin
tmax: titleMax
tmax_again : titleMax
navg : numLikesAvg
navg2 : numLikesAvg
}
Expand All @@ -2942,6 +2943,7 @@ func queryAggregateWithRepeatedFields(t *testing.T) {
"count":4,
"cnt2":4,
"tmax": "Random post",
"tmax_again": "Random post",
"tmin": "GraphQL doco",
"tmin_again": "GraphQL doco",
"navg": 66.25,
Expand Down
3 changes: 2 additions & 1 deletion graphql/resolve/query_rewriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ func aggregateQuery(query schema.Query, authRw *authRewriter) []*gql.GraphQuery
}
// Add selection set to mainQuery and finalMainQuery.
isAggregateFieldVisited := make(map[string]bool)
// isAggregateFunctionVisited stores if the aggregate function has been added or not.
// isAggregateFunctionVisited stores if the aggregate function for a field has been added or not.
// So the map entries would contain keys as nameMin, ageMin, nameName, etc.
isAggregateFunctionVisited := make(map[string]bool)
for _, f := range query.SelectionSet() {
fldName := f.Name()
Expand Down

0 comments on commit eac38d4

Please sign in to comment.