Skip to content

Commit

Permalink
fix(core): Add field resolver for Order.shippingLines
Browse files Browse the repository at this point in the history
Relates to #2859
  • Loading branch information
michaelbromley committed Jun 3, 2024
1 parent d917874 commit 84ec0aa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/core/src/api/resolvers/entity/order-entity.resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ export class OrderEntityResolver {
return lines;
}

@ResolveField()
async shippingLines(@Ctx() ctx: RequestContext, @Parent() order: Order) {
if (order.shippingLines) {
return order.shippingLines;
}
const { shippingLines } = await assertFound(
this.orderService.findOne(ctx, order.id, ['shippingLines.shippingMethod']),
);
return shippingLines;
}

@ResolveField()
async history(
@Ctx() ctx: RequestContext,
Expand Down

0 comments on commit 84ec0aa

Please sign in to comment.