Skip to main content

FacetValueService

Contains methods relating to FacetValue entities.

Signature

constructor

method(connection: TransactionalConnection, translatableSaver: TranslatableSaver, configService: ConfigService, customFieldRelationService: CustomFieldRelationService, channelService: ChannelService, eventBus: EventBus, translator: TranslatorService, listQueryBuilder: ListQueryBuilder) => FacetValueService

findAll

method(lang: LanguageCode) => Promise<Array<Translated<FacetValue>>>

findAll

method(ctx: RequestContext, lang: LanguageCode) => Promise<Array<Translated<FacetValue>>>

findAll

method(ctxOrLang: RequestContext | LanguageCode, lang?: LanguageCode) => Promise<Array<Translated<FacetValue>>>

findAllList

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

Returns a PaginatedList of FacetValues.

TODO: in v2 this should replace the findAll() method. A separate method was created just to avoid a breaking change in v1.9.

findOne

method(ctx: RequestContext, id: ID) => Promise<Translated<FacetValue> | undefined>

findByIds

method(ctx: RequestContext, ids: ID[]) => Promise<Array<Translated<FacetValue>>>

findByFacetId

method(ctx: RequestContext, id: ID) => Promise<Array<Translated<FacetValue>>>

Returns all FacetValues belonging to the Facet with the given id.

findByFacetIdList

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

Returns all FacetValues belonging to the Facet with the given id.

create

method(ctx: RequestContext, facet: Facet, input: CreateFacetValueInput | CreateFacetValueWithFacetInput) => Promise<Translated<FacetValue>>

update

method(ctx: RequestContext, input: UpdateFacetValueInput) => Promise<Translated<FacetValue>>

delete

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

checkFacetValueUsage

method(ctx: RequestContext, facetValueIds: ID[], channelId?: ID) => Promise<{ productCount: number; variantCount: number }>

Checks for usage of the given FacetValues in any Products or Variants, and returns the counts.

Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page