Prisma 1 Forum

Where `null` is throwing error, not able to update/delete records

I changed not required field to required and some data is already stored in DB with null values. But now I want to update those pre-stored data to make my query valid because now I’m getting error like: Cannot return null for non-nullable type...

But I’m not able to delete or update those records because where selector is throwing error:
You provided an invalid argument for the where selector on User. Please provide exactly one unique field and value.

Any solution for this situation ?

image

query updateEmail result is:
image

Before change field not required to required.
query allUsers result is:
image

Datamodel:

type User {
  id: ID! @id
  name: String
  email: String! @unique
}

It should be updateMany and deleteMany mutations instead of updateUser/deleteUser

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.