You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description and expected behavior
I have a zmodel with inheritance. The base has a one to many relation. When quering the child, I am trying to use _count. However, it tries to find the relation in the child instead of the parent.
Environment (please complete the following information):
Error calling enhanced Prisma method `beer.findMany`:
Invalid `prisma.beer.findMany()` invocation:Unknown nested field '_count'for operation findManyBeer does not match any query. at loader (/home/keewijk/projects/beer-inventory/app/routes/admin/edit/beer.tsx:14:32), at async Object.callRouteLoader (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/server-runtime/dist/data.js:62:16), at async /home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:4229:21, at async callLoaderOrAction (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:4294:16), at async Promise.all (index 2), at async callDataStrategyImpl (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:4169:17), at async callDataStrategy (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:3702:19), at async loadRouteData (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:3677:19), at async queryImpl (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:3522:20), at async Object.query (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/router/dist/router.cjs.js:3416:18), at async handleDocumentRequest (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/server-runtime/dist/server.js:222:15), at async requestHandler (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/server-runtime/dist/server.js:141:18), at async nodeHandler (/home/keewijk/projects/beer-inventory/node_modules/@remix-run/dev/dist/vite/plugin.js:844:27), at async /home/keewijk/projects/beer-inventory/node_modules/@remix-run/dev/dist/vite/plugin.js:847:15 { name: 'PrismaClientUnknownRequestError', clientVersion: '5.13.0', internalStack: 'Error calling enhanced Prisma method `beer.findMany`: \n' +'Invalid `prisma.beer.findMany()` invocation:\n' +'\n' +'\n' +"Unknown nested field '_count' for operation findManyBeer does not match any query.\n" +' at Generator.next (<anonymous>),\n' +' at fulfilled (/home/keewijk/projects/beer-inventory/node_modules/@zenstackhq/runtime/enhancements/proxy.js:6:58)'}
The text was updated successfully, but these errors were encountered:
Aggregating with "sum", etc. doesn't work with fields from delegate base because Prisma doesn't allow using a relation field to aggregate. However, "_count" seems to be a special one and it may actually work ...
Description and expected behavior
I have a zmodel with inheritance. The base has a one to many relation. When quering the child, I am trying to use _count. However, it tries to find the relation in the child instead of the parent.
Environment (please complete the following information):
Additional context
The model
The code
The error
The text was updated successfully, but these errors were encountered: