Populator

Populator

Package: @vendure/core File: populator.ts

Responsible for populating the database with InitialData, i.e. non-product data such as countries, tax rates, shipping methods, payment methods & roles.

Signature

class Populator {
  async populateInitialData(data: InitialData, channel?: Channel) => ;
  async populateCollections(data: InitialData, channel?: Channel) => ;
}

Members

populateInitialData

async method
type:
(data: InitialData, channel?: Channel) =>
Should be run before populating the products, so that there are TaxRates by which product prices can be set. If the channel argument is set, then any ChannelAware entities will be assigned to that Channel.

populateCollections

async method
type:
(data: InitialData, channel?: Channel) =>
Should be run after the products have been populated, otherwise the expected FacetValues will not yet exist.