We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The following test passes:
func TestQueryOneToMany_WithOnlyAggregatesSelected_ShouldGroupResults(t *testing.T) { test := testUtils.TestCase{ Actions: []any{ testUtils.CreateDoc{ CollectionID: 1, Doc: `{ "name": "John Grisham", "age": 65, "verified": true }`, }, testUtils.CreateDoc{ CollectionID: 1, Doc: `{ "name": "Cornelia Funke", "age": 62, "verified": false }`, }, testUtils.CreateDoc{ CollectionID: 0, DocMap: map[string]any{ "name": "Painted House", "rating": 4.9, "author_id": testUtils.NewDocIndex(1, 0), }, }, testUtils.CreateDoc{ CollectionID: 0, DocMap: map[string]any{ "name": "A Time for Mercy", "rating": 4.5, "author_id": testUtils.NewDocIndex(1, 0), }, }, testUtils.CreateDoc{ CollectionID: 0, DocMap: map[string]any{ "name": "Theif Lord", "rating": 4.8, "author_id": testUtils.NewDocIndex(1, 1), }, }, testUtils.Request{ Request: `query { Book(groupBy: [author]) { _avg(_group: { field: rating }) } }`, Results: map[string]any{ "Book": []map[string]any{ { "_avg": 4.733333333333333, }, }, }, }, testUtils.Request{ Request: `query { Book(groupBy: [author]) { author { name } _avg(_group: { field: rating }) } }`, Results: map[string]any{ "Book": []map[string]any{ { "author": map[string]any{ "name": "John Grisham", }, "_avg": 4.7, }, { "author": map[string]any{ "name": "Cornelia Funke", }, "_avg": 4.8, }, }, }, }, }, } executeTestCase(t, test) }
But the first query (without author { name} in selected fields) should produce the same result as the second one.
author { name}
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following test passes:
But the first query (without
author { name}
in selected fields) should produce the same result as the second one.The text was updated successfully, but these errors were encountered: