diff --git a/packages/core/src/api/schema/common/order.type.graphql b/packages/core/src/api/schema/common/order.type.graphql index f27436a492..c70953c7c7 100644 --- a/packages/core/src/api/schema/common/order.type.graphql +++ b/packages/core/src/api/schema/common/order.type.graphql @@ -122,6 +122,7 @@ type OrderLine implements Node { createdAt: DateTime! updatedAt: DateTime! productVariant: ProductVariant! + productVariantId: ID! featuredAsset: Asset "The price of a single unit, excluding tax and discounts" unitPrice: Money! @@ -184,6 +185,7 @@ type OrderLine implements Node { discounts: [Discount!]! taxLines: [TaxLine!]! order: Order! + orderId: ID! fulfillmentLines: [FulfillmentLine!] } diff --git a/packages/core/src/entity/order-line/order-line.entity.ts b/packages/core/src/entity/order-line/order-line.entity.ts index 4f747ca67d..17bba1f14c 100644 --- a/packages/core/src/entity/order-line/order-line.entity.ts +++ b/packages/core/src/entity/order-line/order-line.entity.ts @@ -87,6 +87,9 @@ export class OrderLine extends VendureEntity implements HasCustomFields { @ManyToOne(type => Order, order => order.lines, { onDelete: 'CASCADE' }) order: Order; + @EntityId() + orderId: ID; + @OneToMany(type => OrderLineReference, lineRef => lineRef.orderLine) linesReferences: OrderLineReference[];