Magento Graphql returns empty product items for no reason

Hello I am working on a headless project using magento 2 and I made a custom graphql query that has a product query inside of it. When i put aggregations as a paramameter my query returns an empty array of products. What must i do.

{
promotion(promoType:"bravo_bonus"){

products(
pageSize:20,
currentPage:1,
filter:{
glxStoreExclude:{in:["0","2"]}

})

{
items{

sku
name
catalog_rules
isGoldPrice
glxStoreExclude
no1
isTVSponsored
image{
url
}
small_image{
url
}
thumbnail{
url
}
price_range{
maximum_price{
final_price{
value
}
regular_price{
value
}
discount{
amount_off
percent_off
}
}
minimum_price{
final_price{
value
}
regular_price{
value
}
discount{
amount_off
percent_off
}
}
}

}
total_count
page_info{
page_size,
total_pages,
current_page
}
aggregations(filter:{category:{includeDirectChildrenOnly:true}}){
attribute_code,
count,
label,
options{
label,
value,
count
}
}
}
}
}

The response is

{
"data": {
"promotion": {
"products": {
"items": [],
"total_count": 0,
"page_info": {
"page_size": 20,
"total_pages": 0,
"current_page": 1
},
"aggregations": []
}
}
}
}

when i remove aggregations everything work smoothly

submitted by /u/echarissopoulos
[link] [comments]