wesbos
09/21/2017, 4:00 PMnilan
09/21/2017, 4:04 PMwesbos
09/21/2017, 4:04 PMwesbos
09/21/2017, 4:04 PMnilan
09/21/2017, 4:05 PMnilan
09/21/2017, 4:05 PMwesbos
09/21/2017, 4:05 PMwesbos
09/21/2017, 4:06 PMnilan
09/21/2017, 4:06 PMposition on Itemwesbos
09/21/2017, 4:06 PMnilan
09/21/2017, 4:07 PMwesbos
09/21/2017, 4:07 PMnilan
09/21/2017, 4:13 PMwesbos
09/21/2017, 4:14 PMnotrab
09/21/2017, 4:14 PMtype Cart {
id: ID! @isUnique
items: [CartItem!]! @relation(name: "CartItems")
createdAt: DateTime!
updatedAt: DateTime!
}
type CartItem {
id: ID! @isUnique
orderedItem: Variant! @relation(name: "OrderedCartItem")
quantity: Int @defaultValue(value: 1)
cart: Cart @relation(name: "CartItems")
createdAt: DateTime!
updatedAt: DateTime!
}notrab
09/21/2017, 4:15 PMOrderedItem is a relation to the Product (or Variant in my case)nilan
09/21/2017, 4:15 PMposition to the CartItem type of @notrab, you could sort the items specific to one cartwesbos
09/21/2017, 4:16 PMnilan
09/21/2017, 4:17 PMwesbos
09/21/2017, 4:17 PMnilan
09/21/2017, 4:17 PMwesbos
09/21/2017, 4:19 PMwesbos
09/21/2017, 4:19 PMnotrab
09/21/2017, 4:26 PMwesbos
09/21/2017, 4:27 PMwesbos
09/21/2017, 4:27 PMnilan
09/21/2017, 4:27 PM