what's the difference of exclamation mark. `[Stri...
# orm-help
x
what's the difference of exclamation mark.
[String!]
or `[String!]! or `[String] or `[String]!
s
the exclamation indicates that the field is required to have a value. [String!] means that undefined, null, [], and ['hi'] are valid, but [undefined] is not valid. [String]! means that [], [undefined], ['hi'] are valid but undefined, null are not valid
it is a graphql thing
x
👌
✖️ The scalar field
objectives
has the wrong format:
[String]!
Possible Formats:
String
,
String!
,
[String!]
or `[String!]!
@Sam but it's ok to define [String]! as graphql query return type.
s
try [String!]!
x
[String!]! is ok
s
FYI. I have no experience with Prisma or graph.cool. Just trying to explain the !
I just stumbled upon Prisma yesterday 😉
x
😁
confused about the restriction of []! @nikolasburk
s
I think that []! means a list/array that must have a value, so [], or [undefined] would work, but undefined/null would not work
the list/array must exists, but nothing is being said about its element values