Prisma2 with nexus - No subset types are available error


#1

I’ve been using prisma2 with nexus, and I got this error when trying to exposing role column (which is enum).

Error:
ERROR: No subset types are available. Please make sure that one of your GraphQL type is a subset of your t.model(’<ModelName>’)

here’s my code exposing the User schema
let User = objectType({
name: ‘User’,
definition(t) {
t.model.id();
t.model.role();
},
});

here’s my schema
model User {
id String @default(cuid()) @id @unique
email String @unique
name String?
role Role @default(USER)
createdAt DateTime @default(now())
}

I’m not really familiar with some of the new syntax of prisma2, some suggestions might be helpful. Thanks a lot!


#2

DId you find a fix for this?


#3

Hey, have you figured it out?


#4

I’m having the same issue. Anybody else having any luck implementing enum values on a model?