But instead I am getting typescript error Type ‘{ ...
# orm-help
b
But instead I am getting typescript error Type ‘{ name: string; }’ is not assignable to type ‘UserWhereUniqueInput’ because the type only has id param:
Copy code
export type UserWhereUniqueInput = {
    id?: number
  }
1
a
name
is not unique so the
where
selector won’t work: https://www.prisma.io/docs/reference/api-reference/prisma-client-reference#update
👌 1
you can make it
@unique
or try
findFirst
1
n
Hey Brothak 👋 For update query, prisma needs to uniquely identify a record which needs to be updated, for this specific reason it is required to only allow fields which have
@unique
attributes in where clause.