nexus-plugin-prisma
nexus-plugin-prisma copied to clipboard
Property '<MODEL>UpdateManyDataInput' does not exist on type 'NexusGenInputs'
Issue
I am getting the following error (screenshot) when nexus-prisma tries to generate types for my schema.

Steps to reproduce
I have created a very simple repro here: https://github.com/narciero/nexus-prisma-bug-repro
Just pull the code down and run the build
command.
Schema
You can view this in the repro repo, but here is my schema
datasource db {
provider = "postgresql"
url = ""
}
generator client {
provider = "prisma-client-js"
}
model User {
id String @default(cuid()) @id
profile Profile?
}
model Profile {
userId String @id
user User @relation(fields: [userId], references: [id])
info Info @relation(fields: [infoId], references: [id])
infoId String
// test String // if I just add this dummy field, everything works again
}
model Info {
id String @id
profiles Profile[]
}
Thoughts
The issue seems to be caused by the Profile
model not having any fields other than the 2 relations to User
and Info
. For some reason, this is causing nexus-prisma to not generate some of the Input
types that are required in Typescript (causing tsc
to fail).
What's interesting is if you just add a dummy scalar field to the Profile
model, everything works fine - seems like some kind of bug in the typegen system.
Also facing this issue. Also @narciero thanks for the dirty fix, would have pulled my hair out debugging without that!
I also have the issue
how about this? I'm facing this issue when create explicit many-to-many relation in prisma.
I asked about similar bug on stackoverflow 10 months ago:
https://stackoverflow.com/questions/61449315/input-object-type-xxx-must-define-one-or-more-fields-in-prisma-2-0/66589194#66589194
@lockednlevered mentioned that this is issue connected with my problem.
It can be useful to see two different steps to reproduction.
Facing this issue too.
Was facing this same issue. Thanks @narciero