Skip to main content

ActiveOrderService

This helper class is used to get a reference to the active Order from the current RequestContext.

Signature

constructor

method(sessionService: SessionService, orderService: OrderService, connection: TransactionalConnection, configService: ConfigService) => ActiveOrderService

getOrderFromContext

method(ctx: RequestContext) => Promise<Order | undefined>

Gets the active Order object from the current Session. Optionally can create a new Order if no active Order exists.

Intended to be used at the Resolver layer for those resolvers that depend upon an active Order being present.

getOrderFromContext

method(ctx: RequestContext, createIfNotExists: true) => Promise<Order>

getOrderFromContext

method(ctx: RequestContext, createIfNotExists: = false) => Promise<Order | undefined>

getActiveOrder

method(ctx: RequestContext, input: { [strategyName: string]: any } | undefined) => Promise<Order | undefined>v1.9.0

Retrieves the active Order based on the configured ActiveOrderStrategy.

getActiveOrder

method(ctx: RequestContext, input: { [strategyName: string]: any } | undefined, createIfNotExists: true) => Promise<Order>

getActiveOrder

method(ctx: RequestContext, input: { [strategyName: string]: Record<string, any> | undefined } | undefined, createIfNotExists: = false) => Promise<Order | undefined>
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page