to get a personalized navigation.
to get a personalized navigation.
What's the correct syntax for grouping in a query?
f.e. count and ordersum by countryNo
example query below fails:
query read_orders($cid : Int!)
{
useCompany(no : $cid)
{
order_aggregate(
filter:{
transactionType:{ _eq: 1},
orderDateAsDate:{_gte:"2022-01-01"}
})
{
grouping{countryNo}
count{orderNo}
sum{orderSumNetDomestic}
}
}
}
The grouping aggregate is no longer available in the schema.
This will be removed in the next release of VBNXT.
Notice that this aggregate function is not mentioned in the official documentation of GraphQL available here https://docs.business.visma.net/docs/schema/queries/aggregates.
The grouping aggregate cannot be used like this. It must be used with a column that is part of a group by clause. That is not supported in GraphQL actually. It is a feature supported in VBS for on-premise Visma Business.
This was included in the GraphQL schema because the schema is generic and built dynamically from the VB model. It shouldn't be available and we will remove it for the time being.
Thank you for reporting this problem to us.
Copyright © 2022 Visma.com. All rights reserved.