Closed SamCullin closed 1 year ago
This should be fixed on rev = "f8ec79ad532b0bbca0d90dcaa6ecc895c82b87c3"
Out of curiosity I plugged this schema into prisma client JS and I got this
Turns out that the JS client would actually give you the same problem if you wanted to use the checked version. I'm not sure if that's a bug or a feature, but I'd like to keep consistency.
I think I'll add a create_unchecked
method that's similar to the create_many
you're doing.
EDIT: implemented in rev = "3d1451ac4036b13ed4590a08696692a4d2dbbc14"
Summary
There seems to be an issue with the generated SDK when a field is used in a relation that is not required.
Example
Schema
Outputs
This will generate the incorrect
.project().create(...)
function signature.If
main_workspace_name
andmain_workspace
are made required the generated signature is as follows.Result
In both cases, there is no way to set the required field of
name
without using thevec![Set]
arguments but this throws validation errors.Workaround
The current workaround for anyone running into this issue is to create
note: this will only work for people who have a way to create a unique query from the data they used in the
Discord chat record