Same setup as #4951 (and possibly related).
This query correctly errors:
{
Book(groupBy: [genre]) {
genre
title
}
}
{
"errors": [
{
"message": "cannot select a non-group-by field at group-level. Field: title"
}
],
"data": null
}
However, if the non-group-by field is a relationship, the query happily goes through:
{
Book(groupBy: [genre]) {
genre
author { name }
}
}
{
"data": {
"Book": [
{
"author": {
"name": "David Foster Wallace"
},
"genre": "Fiction"
},
{
"author": {
"name": "David Foster Wallace"
},
"genre": "Nonfiction"
},
{
"author": {
"name": "George Orwell"
},
"genre": "Memoir"
}
]
}
}
Version: defradb dev-develop (0e679d98 2026-06-14) built with Go 1.25.9 linux/amd64
Same setup as #4951 (and possibly related).
This query correctly errors:
{ Book(groupBy: [genre]) { genre title } }{ "errors": [ { "message": "cannot select a non-group-by field at group-level. Field: title" } ], "data": null }However, if the non-group-by field is a relationship, the query happily goes through:
{ Book(groupBy: [genre]) { genre author { name } } }{ "data": { "Book": [ { "author": { "name": "David Foster Wallace" }, "genre": "Fiction" }, { "author": { "name": "David Foster Wallace" }, "genre": "Nonfiction" }, { "author": { "name": "George Orwell" }, "genre": "Memoir" } ] } }Version:
defradb dev-develop (0e679d98 2026-06-14) built with Go 1.25.9 linux/amd64