Skip to main content

EntityDuplicator

An EntityDuplicator is used to define the logic for duplicating entities when the duplicateEntity mutation is called. This allows you to add support for duplication of both core and custom entities.

Example

Ts

The duplicator then gets passed to your VendureConfig object:

Ts
Signature

constructor

method(config: EntityDuplicatorConfig<T>) => EntityDuplicator

duplicate

method(input: { ctx: RequestContext; entityName: string; id: ID; args: ConfigArg[]; }) => Promise<VendureEntity>

A function which performs the duplication of an entity.

Signature

Configuration for creating a new EntityDuplicator.

Signature

requiresPermission

propertyArray<Permission | string> | Permission | string

The permissions required in order to execute this duplicator. If an array is passed, then the administrator must have at least one of the permissions in the array.

forEntities

propertystring[]

The entities for which this duplicator is able to duplicate.

duplicate

The function which performs the duplication.

Example

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