After update to TypeScript 3.5.1, prismaObjectType throw a error.
TS2590: Expression produces a union type that is too complex to represent.
But downgrade to 3.4.5 it works very well.

That's all, I love Nexus and Prisma. :)
I ran into this as well. I opened an issue here: https://github.com/prisma/nexus/issues/151 but I think I'll close it as this seems like a better location for it.
Having the same issue here. I tried to generate a very simple type:
const MessageType = prismaObjectType({
name: "Message",
definition(t) {
t.prismaFields([
"createdAt"
]);
}
});
Which generates the same error as above: TS2590: Expression produces a union type that is too complex to represent.
Downgrading to typescript 3.4.5 fixes the error.
Same problem here

Anyone know how to make it work with TypeScript 3.5.1 ?
Anyone know how to make it work with TypeScript 3.5.1 ?
I don't know.
For now, I think we still need to use TypeScript 3.4.5
Anyone know how to make it work with TypeScript 3.5.1 ?
I don't know.
For now, I think we still need to use TypeScript 3.4.5
I still cause the same error after I downgrading typescript to v3.4.5
@harvey-woo Same, When I use
yarn add [email protected] -D
The problem still persist in the project.
Duplicate of #291
Hope that fix/update comes along...
Yes, still an issue.
same here
This isn't best way to fix it:
const User = prismaObjectType({
name: 'User',
definition(t: any) {
t.prismaFields([
'id',
'name',
'email',
{
name: 'posts',
args: [],
}
])
}
})
If you don't wana see the error, add : any.
If you wana code intellisense, delete : any.
Ignore my poor English.
Workaround seems to be to add the type to the call, like prismaObjectType<‘User’>(...)
Workaround seems to be to add the type to the call, like prismaObjectType<‘User’>(...)
It works! But... why??? :sweat_smile:
Workaround seems to be to add the type to the call, like prismaObjectType<‘User’>(...)
Also works for me on [email protected], think this is the best workaround for me
Most helpful comment
Workaround seems to be to add the type to the call, like prismaObjectType<‘User’>(...)