# GraphQL aggregation

**URL:** <https://community.appfarm.io/t/graphql-aggregation/900>\
**Category:** Ask the community\
**Created:** [December 6, 2023, 9:28am UTC](https://community.appfarm.io/t/graphql-aggregation/900 "2023-12-06T09:28:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/jonas/32/17_2.png) [@Jonas](https://community.appfarm.io/u/Jonas)\
**Post date:** [December 6, 2023, 9:28am UTC](https://community.appfarm.io/t/graphql-aggregation/900/1 "2023-12-06T09:28:31Z")

</div>

I am testing the aggregation feature that was just released, but keep getting this error.

The setup looks correct, and countTransactionEmission is running as expected.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/9090ae9d33122e1e7107481a4a92eedd7558b83d.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/a24b72d9a64710d9ec8192ecfa71af0e4d403367.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/appfarm/original/1X/c709081bbeb8cb370967485b0510a8783cdf0bd4.png)

---

<div class="post-metadata">

**Author:** ![kristian](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/kristian/32/58_2.png) [@kristian](https://community.appfarm.io/u/kristian)\
**Post date:** [December 7, 2023, 9:27am UTC](https://community.appfarm.io/t/graphql-aggregation/900/2 "2023-12-07T09:27:20Z")

</div>

Hi!

It seems like we have a bug in this new feature. Not in how it operates, but to me it seems lik you must have a filter **and** a group.

**Working** :  
{aggregateOrderLine(  
filter: {product: {ne: null}},  
group: product  
) {  
product  
productNumber  
sum: amount\_sum  
\_count  
}  
}

**Not Working** (same error message as you have experienced):  
{aggregateOrderLine(  
filter: {product: {ne: null}}  
) {  
sum: amount\_sum  
\_count  
}  
}

Registering a challenge on this one. Workaround is to group by one of the properties of the object class, and then to sum these records in a function etc.

---

<div class="post-metadata">

**Author:** ![Jonas](https://dub1.discourse-cdn.com/flex013/user_avatar/community.appfarm.io/jonas/32/17_2.png) [@Jonas](https://community.appfarm.io/u/Jonas)\
**Post date:** [December 7, 2023, 11:54am UTC](https://community.appfarm.io/t/graphql-aggregation/900/3 "2023-12-07T11:54:26Z")

</div>

That worked for me as well, thank you!

Also, it looks like you don’t have any join-operations? Is there any other hack to create deep-data binding?

In my case, I would like to aggregate the object TransactionEmission for Transactions that again are filtered on the property Company. And I hope to do this filtering in GraphQL, as I want to lazy load everything from the client side. Is this possible now?
