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
The duplicator then gets passed to your VendureConfig object:
ConfigurableOperationDef<T>(input: { ctx: RequestContext; entityName: string; id: ID; args: ConfigArg[]; }) => Promise<VendureEntity>A function which performs the duplication of an entity.
Configuration for creating a new EntityDuplicator.
ConfigurableOperationDefOptions<T>Array<Permission | string> | Permission | stringThe 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.
string[]The entities for which this duplicator is able to duplicate.
DuplicateEntityFn<T>The function which performs the duplication.
Example