Nexus not expose all functions, not able to call aggregation from nexus interface

prisma

#1

I tried to follow the prisma guide and use nexus-prisma to expose all my queries and mutations in my graphql server as below.

const Query = prismaObjectType({
  name: "Query",
  definition: t => t.prismaFields(["*"])
});
const Mutation = prismaObjectType({
  name: "Mutation",
  definition: t => t.prismaFields(["*"])
});

It is possible to call the aggregation function directly from prisma server, but I could not access the aggregation function from web server, below is my gql.

{
  myquery: endPoints(first: 10, skip: 0) {
    id
    name
    type
    path
  }
  meta: endPointsConnection {
    aggregate {
      count
    }
  }
}

result of prisma server

result of my web server(as new comer, one image limited)

{
  "data": null,
  "errors": [
    {
      "message": "Unknown prisma-client function for field EndPointConnection.aggregate",
      "locations": [
        {
          "line": 9,
          "column": 5
        }
      ],
      "path": [
        "meta",
        "aggregate"
      ]
    }
  ]
}

anybody could help, thanks!


#2

I have the same problem :confused:


#3

I have exactly the same issue


#4

Same here. It’s need to include connections someway separatly?


#5

Same issue here. What is the best way to do pagination with prisma using nexus if this doesn’t work?


#6

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.