Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when trying to call aggregate function #439

Open
thormengkheang opened this issue Sep 16, 2019 · 1 comment
Open

error when trying to call aggregate function #439

thormengkheang opened this issue Sep 16, 2019 · 1 comment

Comments

@thormengkheang
Copy link

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"
      ]
    }
  ]
}
@al-ani
Copy link

al-ani commented Oct 20, 2019

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants