Nexus-plugin-prisma: Property '<MODEL>UpdateManyDataInput' does not exist on type 'NexusGenInputs'

Created on 8 Apr 2020  路  3Comments  路  Source: graphql-nexus/nexus-plugin-prisma

Issue

I am getting the following error (screenshot) when nexus-prisma tries to generate types for my schema.

Screen Shot 2020-04-07 at 7 47 21 PM

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

````prisma
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.

Most helpful comment

I also have the issue

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings