How can I make following query in lighthouse eloquent query?
select * from mytable group by customer
How can I make following query in lighthouse eloquent query?
select * from mytable group by customer
There is no a directive for that. You can use just the @field
directive and there you can put anything you want. Or maybe adding some scopes. I mean, think in terms of Eloquent, more than plain queries.
You can either create your own directive, sth like @groupBy
or just simply use a complex function through @field(resolver: ...)
or @paginate(builder: ...)
and do the grouping by using Laravel tools.