prisma-binding
prisma-binding copied to clipboard
error when trying to call aggregate function
I can query customersConnection via GraphQL playground but I can't access vai code like in the document https://www.prisma.io/docs/prisma-client/basic-data-access/reading-data-JAVASCRIPT-rsc2/#aggregations
await prisma.customersConnection().aggregate().count()
got an error like this
{
"data": null,
"errors": [
{
"message": "prisma.customersConnection is not a function",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"customers"
]
}
]
}
I have the same issue with Prisma-binding
const bookCount = await prisma.query.usersConnection().aggregate().count();
console.log(bookCount)
TypeError: prisma.query.usersConnection(...).aggregate is not a function
at _callee3$ (/home/ayman/graphql/docker-postgres/src/resolvers/mutations/Book.js:82:68)
at tryCatch (/home/ayman/graphql/docker-postgres/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:65:40)
at Generator.invoke [as _invoke] (/home/ayman/graphql/docker-postgres/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:303:22)
at Generator.prototype.(anonymous function) [as next] (/home/ayman/graphql/docker-postgres/node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js:117:21)
at step (/home/ayman/graphql/docker-postgres/src/resolvers/mutations/Book.js:17:191)
at /home/ayman/graphql/docker-postgres/src/resolvers/mutations/Book.js:17:361
at process._tickCallback (internal/process/next_tick.js:68:7)