You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I have a multi field unique constraint like so on model C:
@@unique([aId, bId])
The only way I can get Prisma to be ok with my mutation is to populate the aId_bId field on the CWhereUniqueInput. This seems like it's probably not expected, since there are other fields in that type (one for each field in the model, plus OR, NOT, and AND). I'm guessing I'm doing it wrong, so can you point me to an example of how to populate *WhereUniqueInput on the client side?
Specifically the error I get is:
Argument `delete`: Invalid value provided. Expected TagToObjectRelationWhereUniqueInput, provided (Object).
I'm using Apollo client with types generated from the GraphQL schema. This doesn't come automatically with type safety when using the queries, but I've created a type safe function to generate the TagToObjectRelationWhereUniqueInput and, indeed, the type is correct in this case.
Note that this is related to this discussion and I appear to have confirmed my suspicion from that one that providing empty strings for the irrelevant IDs doesn't work. They are null in the database, but I can't provide null to GraphQL. I am currently unable to proceed.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When I have a multi field unique constraint like so on model
C
:The only way I can get Prisma to be ok with my mutation is to populate the
aId_bId
field on theCWhereUniqueInput
. This seems like it's probably not expected, since there are other fields in that type (one for each field in the model, plusOR
,NOT
, andAND
). I'm guessing I'm doing it wrong, so can you point me to an example of how to populate*WhereUniqueInput
on the client side?Specifically the error I get is:
The delete object I'm providing looks like this:
I'm using Apollo client with types generated from the GraphQL schema. This doesn't come automatically with type safety when using the queries, but I've created a type safe function to generate the
TagToObjectRelationWhereUniqueInput
and, indeed, the type is correct in this case.Note that this is related to this discussion and I appear to have confirmed my suspicion from that one that providing empty strings for the irrelevant IDs doesn't work. They are null in the database, but I can't provide null to GraphQL. I am currently unable to proceed.
Beta Was this translation helpful? Give feedback.
All reactions