tafelito
08/14/2019, 6:23 PMtype Product {
id: ID! @id
....
}
type CartItem {
id: ID! @id
product: Product!
quantity: Float!
cart: Cart!
}
type Cart {
id: ID! @id
user: User! @relation(name: "Cart", link: INLINE)
items: [CartItem] @relation(onDelete: CASCADE)
}
the CRUD operations generated by prisma does not allow to update a CartItem based on a product.id, is there any other way to do this other than manually add productId to the cartItem?
type CartItem {
id: ID! @id
productId: ID! @unique
product: Product!
quantity: Float!
cart: Cart!
}
Basically, I want to update an item of a Cart where instead of doing it by CartItem.id I want to do it by CartItem.product.id or even by Cart.id