I’m trying to create a many-many relation in my sc...
# prisma-whats-new
j
I’m trying to create a many-many relation in my schema, but I do not want the fields to be required, but it seems they are set to required even though I don’t define this… [User] => [User!]! Is it mandatory to have these relations as required?
a
Even though the schema shows the field itself as required, the relationship is not. This is because it defaults to
[]
which satisfies this condition.
👍 1
j
ok, so even if my User has employer: [Company!]! I can create a User without setting employer
a
Yes
j
great! thanks 🙂
😎 1
follow-up comment… when I tried to remove required in the field I got ‘Preview changes’ activated, but pressing it gave me ‘Apply changes’ active without any message, pressing this toggled back to ‘Preview changes’ and so forth without any errros(messages
a
Yes, error handling there is sub-optimal, I believe there's a GH issue somewhere for that.
👍 1