How is this possible - this has to be a major bug?...
# orm-help
z
How is this possible - this has to be a major bug? Datamodel:
Copy code
type Test {
  id: ID! @unique
  wicked0: [String]
  wicked1: [String!]
  wicked2: [String!]!
}
becomes on prisma
Copy code
Fields
id ID!
wicked0 [String!]!
wicked1 [String!]!
wicked2 [String!]!
and gql-gen
Copy code
type Test implements Node {
  id: ID!
  wicked0: [String!]!
  wicked1: [String!]!
  wicked2: [String!]!
}
m
I guess you are referring to the scalar list fields. No this is not a bug. This is intended. We are allowing multiple syntaxes in the datamodel but only expose
[String!]!
in the output schema. This is because: 1. We guarantee to never have null elements in the list. 2. There will never a null list.
I am surprised though that you could specify all those 3 flavours for the list. We locked that down quite a while ago. What Prisma version and connector are you using?
z
my mistake, it is relation lists that convert oddly e.g. [books!]! becomes [books!]
is this enforcement of lists documented somewhere, I cannot find in current Prisma docs?
I cannot tell you details since I am not designing backend but we're using graphql-code-generator to type the graphql scema
m
I found this in our docs (https://www.prisma.io/docs/datamodel-and-migrations/datamodel-MYSQL-knul/#relations):
Note that a to-many relation field is always set to required. For example, a field that contains many user addresses always uses the type [Address!]! and can never be of type [Address!], [Address]! or [Address].
z
thx