I’m getting `You can only create scalar fields and...
# prisma-whats-new
j
I’m getting
You can only create scalar fields and '<FieldName>' is not a scalar value. Did you intend to create a relation?
when I’m creating relations. Specifically it happens when I’m setting a relation like this:
Copy code
type FirstType {
  seconds: SecondType @relation(name: "TypeRelation")
}

type SecondType {
  firsts: [FirstType!]! @relation(name: "TypeRelation")
}
a
Did you specify the @model attribute on your types?
j
Yep!
Works if I do
seconds: [SecondType!]!
instead
a
Did you change/rename anything, or was this the initial definition?
Because 1:n should just work like this
j
What do you mean initial definition?
Copy code
type Item @model {
  size: ItemSize @relation(name: "SizesOnItem")
}


type ItemSize @model {
  items: [Item!]! @relation(name: "SizesOnItem")
}
Thats the actual copy
a
I mean, did you create a new project with this definition, and did it fail, or did you change/rename anything in your schema, causing it to fail?
j
If I change
size
to
size: [ItemSize!]!
I can deploy just fine. I have used this schema for half a year or so, however this env specifically was cloned from an older one and ejected
a
Weird. I just broke my graphcool install, so I'll check in a bit 😄
j
I have a lot of existing 1:n relationships that follow the same format as well, which I have used for reference
Haha alright cool, I’ll PM you the full schema if you want to see it for yourself!
a
I could deploy your initial example without a problem