Want to update user getting this error `RatingWhereUniqueInput`

Anyone an idea what this is?
1 Reply
neochrome
neochrome3y ago
await ctx.prisma.rating.update({
where: { userId_sportId: {
userId: winner.id,
sportId: input.sportId
} },
data: { rating: newWinnerScore },
});
await ctx.prisma.rating.update({
where: { userId_sportId: {
userId: winner.id,
sportId: input.sportId
} },
data: { rating: newWinnerScore },
});
code snippet
error - unhandledRejection: PrismaClientValidationError:
Invalid `prisma.rating.update()` invocation:

{
where: {
userId_sportId: {
~~~~~~~~~~~~~~
userId: 'cl9e7sl87000kj6z3rnxhq09y',
sportId: 'cl9e3lxfj0008j6z33daqcxou'
}
},
data: {
rating: 801
}
}

Unknown arg `userId_sportId` in where.userId_sportId for type RatingWhereUniqueInput. Available args:

type RatingWhereUniqueInput {
id?: String
}
error - unhandledRejection: PrismaClientValidationError:
Invalid `prisma.rating.update()` invocation:

{
where: {
userId_sportId: {
~~~~~~~~~~~~~~
userId: 'cl9e7sl87000kj6z3rnxhq09y',
sportId: 'cl9e3lxfj0008j6z33daqcxou'
}
},
data: {
rating: 801
}
}

Unknown arg `userId_sportId` in where.userId_sportId for type RatingWhereUniqueInput. Available args:

type RatingWhereUniqueInput {
id?: String
}
dont understand this maybe i got it lol fixed id vs firstid_secondid When you have a composite key you can't have unique ID in your model as easy as that DB basics lol
Want results from more Discord servers?
Add your server