Joseph Carrington
11/12/2018, 9:11 PMtype 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:
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.Joseph Carrington
11/12/2018, 9:44 PMnuno
11/13/2018, 9:59 AMJoseph Carrington
11/13/2018, 5:33 PMnuno
11/13/2018, 6:06 PMPortalCart 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.