Graphql query count for get product count

Hello,
I am facing an issue while querying my product data using GraphQL in relation to filtered aggregation counts.

interface product {
  id: ID!
  name: String! @id @search(by: [regexp])
  sku: String @search(by: [regexp])
  manufacturer: manufacturer!
}
type manufacturer {
  name: String! @id @search(by: [regexp])
  products: [product] @hasInverse(field: manufacturer)
}
type device implements product {
  lockStatus: lockStatus! @search
}

I want to get details using graphql query as below.

query {
   querydevice(filter: {lockStatus: { in: [LOCKED] }})  {
      id
      name
      sku
      manufacturer() {
         name
         productsAggregate {
            count
         }
      }
   }
}

When I pass a filter in the querydevice query, the productsAggregate count returns incorrect data (it seems to be aggregating from all products rather than just the filtered ones).
Additionally, I want to get the count of all devices with lockStatus = "LOCKED" (which is an enum) in the same query. Could you please guide me on how to properly handle this and get the expected results?

See How to aggregate with @cascade filter?

It’s not about my problem. According to my schema, the product interface is associated with the manufacturer type.

In the query below, the manufacturer comes from the interface, so aggregateDevice can’t be used for the manufacturer total count. Additionally, productsAggregate returns all product data without applying the (filter: {lockStatus: {in: [LOCKED]}}) filter, which is only available in the device type.