CollectionFilter

CollectionFilter

CollectionFilter

A CollectionFilter defines a rule which can be used to associate ProductVariants with a Collection. The filtering is done by defining the apply() function, which receives a TypeORM QueryBuilder object to which clauses may be added.

Creating a CollectionFilter is considered an advanced Vendure topic. For more insight into how they work, study the default collection filters source

Signature

class CollectionFilter<T extends CollectionFilterArgs = {}> extends ConfigurableOperationDef<T> {
  constructor(config: CollectionFilterConfig<T>)
  apply(qb: SelectQueryBuilder<ProductVariant>, args: ConfigArg[]) => SelectQueryBuilder<ProductVariant>;
}

Extends

Members

constructor

method
type:
(config: CollectionFilterConfig<T>) => CollectionFilter

apply

method
type:
(qb: SelectQueryBuilder<ProductVariant>, args: ConfigArg[]) => SelectQueryBuilder<ProductVariant>