I don't get it. How can I specify nullable array?
# orm-help
t
I don't get it. How can I specify nullable array?
v
[File!]
t
But it says Possible Formats:
File
,
File!
,
[File!]!
t
"The relation field
documents
has the wrong format:
[File!]
Possible Formats:
File
,
File!
, `[File!]!`" documents: [File!] @relation(name: "ProjectDocuments")
n
You cannot specify a nullable
to-many
relation.
t
ridiculous
and what to do?
n
Did you read my elaborate post in the Forum on this?
what are you trying to achieve?
t
to have one model have optionaly related many other models
a
Document
can have many
File
. Or not to have
n
[Model!]!
works for this. As I've written in the Forum, the default value is
[]
.
t
ah
thank you. now it's clear
n
cool