nexus-plugin-prisma icon indicating copy to clipboard operation
nexus-plugin-prisma copied to clipboard

Experimental CRUD type error

Open Caayu opened this issue 1 year ago • 0 comments

Property 'model' does not exist on type 'ObjectDefinitionBlock<"User">'.ts(2339) Property 'crud' does not exist on type 'ObjectDefinitionBlock<"Query">'.ts(2339)

const User = objectType({
  name: 'User',
  definition(t) {
    t.model.id()
    t.model.name()
    t.model.email()
  }
})

const Query = queryType({
  definition(t) {
    t.crud.user()
    t.crud.users()
  }
})
{
  "dependencies": {
    "@prisma/client": "^2.23.0",
    "graphql-yoga": "^3.9.1",
    "nexus": "^1.3.0",
    "nexus-plugin-prisma": "^0.35.0"
  },
  "devDependencies": {
    "@types/node": "^20.2.1",
    "prisma": "^4.14.1",
    "typescript": "^5.0.4"
  }
}

Caayu avatar May 19 '23 01:05 Caayu