graphql-nexus / nexus

Code-First, Type-Safe, GraphQL Schema Construction
https://nexusjs.org
MIT License
3.4k stars 275 forks source link

Experimental CRUD type error #1159

Open Caayu opened 1 year ago

Caayu commented 1 year ago

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"
  }
}