Given this datamodel: ``` type PortalCart { id: ...
# orm-help
j
Given this datamodel:
Copy code
type PortalCart {
  id: ID! @unique
  owner: PortalUser! @relation(name: "UserCart")
  items: [CartItem!]! @relation(name: "ItemsInCart", onDelete: CASCADE)
  createdAt: DateTime!
  updatedAt: DateTime!
}

type CartItem {
  id: ID! @unique
  cart: PortalCart! @relation(name: "ItemsInCart")
  quantity: Int! @default(value: 1)
  productId: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
}

type PortalUser {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  cart: PortalCart @relation(name: "UserCart", onDelete: CASCADE)
  OTTAuthorizations: [OTTAuthorization!]!
  isGuest: Boolean! @default(value: "true")
}

type OTTAuthorization {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  videoId: String!
  authorizationCode: String!
  expires: DateTime!
}
I always get this error on prisma generate:
Copy code
Generating schema... 25ms
Syntax Error: Expected Name, found }

GraphQL request (512:1)
511:
512: }
     ^
There is of course not a line 512 of anything I have been able to view, so I am assuming something about the datamodel is generating an AST that prisma doesnt like.
I was able to fix this by adding a required dummy: String! @default(value: “dummy”) to every type
n
j
I feel like all of those types do have scalar fields though, even without the dummy field, am I misunderstanding what a scalar field is?
n
PortalCart
has no scalar field excluding the system fields (id, createdAt and updatedAt). Try adding
dummy: String
field to that type. No need for required, I think.