Skip to main content

ProductOptionService

Contains methods relating to ProductOption entities.

Signature

constructor

method(connection: TransactionalConnection, translatableSaver: TranslatableSaver, customFieldRelationService: CustomFieldRelationService, eventBus: EventBus, translator: TranslatorService, listQueryBuilder: ListQueryBuilder) => ProductOptionService

findAll

method(ctx: RequestContext, options?: ListQueryOptions<ProductOption>, groupId?: ID, relations?: RelationPaths<ProductOption>) => Promise<PaginatedList<Translated<ProductOption>>>

findOne

method(ctx: RequestContext, id: ID, relations?: RelationPaths<ProductOption>) => Promise<Translated<ProductOption> | undefined>

create

method(ctx: RequestContext, group: ProductOptionGroup | ID, input: CreateGroupOptionInput | CreateProductOptionInput) => Promise<Translated<ProductOption>>

update

method(ctx: RequestContext, input: UpdateProductOptionInput) => Promise<Translated<ProductOption>>

delete

method(ctx: RequestContext, id: ID) => Promise<DeletionResponse>

Deletes a ProductOption.

  • If the ProductOption is used by any ProductVariants, the deletion will fail.
  • If the ProductOption is used only by soft-deleted ProductVariants, the option will itself be soft-deleted.
  • If the ProductOption is not used by any ProductVariant at all, it will be hard-deleted.
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page