paljs / prisma-tools

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

findMany And Count CRUD Errors occur when used in use The `select` statement for type Type must not be empty #239

Closed reaink closed 2 years ago

reaink commented 2 years ago

findMany And Count CRUD Errors occur when used in use

query findManySiteTag(
  $findManySiteTagSkip: Int
  $findManySiteTagTake: Int
  $findManySiteTagWhere: SiteTagWhereInput
  $findManySiteTagOrderBy: [SiteTagOrderByWithRelationInput]
) {
  findManySiteTag(
    skip: $findManySiteTagSkip
    take: $findManySiteTagTake
    where: $findManySiteTagWhere
    orderBy: $findManySiteTagOrderBy
  ) {
    id
    name
  }
  findManySiteTagCount # add this
}
"extensions": {
  "code": "INTERNAL_SERVER_ERROR",
  "exception": {
    "stacktrace": [
      "Error: ",
      "Invalid `prisma.siteTag.findMany()` invocation in",
      "/Users/mac/code/shisvc/shisvc-be/src/crud/SiteTag/queries/findMany.ts:15:27",
      "",
      "  12 },",
      "  13 resolve(_parent, args, { prisma, select }) {",
      "  14   console.log('🍡 select: ', select)",
      "→ 15   return prisma.siteTag.findMany({",
      "         where: {},",
      "         take: 10,",
      "         skip: 0,",
      "         select: {",
      "       ?   id?: true,",
      "       ?   name?: true,",
      "       ?   sites?: true,",
      "       ?   _count?: true",
      "         }",
      "       })",
      "",
      "",
      "The `select` statement for type SiteTag must not be empty. Available options are listed in green.",
      "",
    ]
}
reaink commented 2 years ago

that is nexus-shield plugin problem