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
Doing my own investigation, seems like the issue is inside info.ts where buildExistsInfo, returns only a selection on id, which is hard-coded rather than what the model considers a primary key. In the case of I18Stringkey is the ID but there is no unique primary key so it returns undefined and undefined.length throws the error.
I chose key as a non unique key because the key exists for each language (unique key + language) and I don't want prisma generating the id for me. So, I use key as the unique identifier where I set it to a human readable string e.g. "my-unique-key".
The text was updated successfully, but these errors were encountered:
An ID value is a generated unique 25-character string based on cuid. Fields with ID values are system fields and just used internally, therefore it is not possible to create new fields with the ID type.
Describe the bug
When calling prisma.exists on a type which is using "key" as the ID, prisma throws an Error.
To Reproduce
Steps to reproduce the behavior:
prisma.exists.I18String({ key: "123" })
Expected behavior
Returns true or false
Versions (please complete the following information):
OS X Mohave
prisma
CLI:prisma/1.20.0 (darwin-x64) node-v10.4.0
1.20.0
prisma-binding
,apollo-server
,ts-node
,typescript
Additional context
Doing my own investigation, seems like the issue is inside
info.ts
wherebuildExistsInfo
, returns only a selection onid
, which is hard-coded rather than what the model considers a primary key. In the case ofI18String
key
is the ID but there is no unique primary key so it returnsundefined
andundefined.length
throws the error.I chose
key
as a non unique key because the key exists for each language (unique key + language) and I don't want prisma generating theid
for me. So, I usekey
as the unique identifier where I set it to a human readable string e.g. "my-unique-key".The text was updated successfully, but these errors were encountered: