paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
679 stars 55 forks source link

_count doesn't accept arguments #322

Open f8k8 opened 3 months ago

f8k8 commented 3 months ago

Prisma's .count() method accepts arguments to filter which records to count. The generated _count field doesn't allow any filters on its fields though. I.e.:

findFirstModelA {
    _count {
      modelB
    }
  }

Should allow something like:

findFirstModelA {
    _count {
      modelB(where: $where)
    }
  }