CustomFields
CustomFields
Most entities can have additional fields added to them by defining an array of CustomFieldConfig objects on against the corresponding key.
Example
bootstrap({
// ...
customFields: {
Product: [
{ name: 'infoUrl', type: 'string' },
{ name: 'downloadable', type: 'boolean', defaultValue: false },
{ name: 'shortName', type: 'localeString' },
],
User: [
{ name: 'socialLoginToken', type: 'string', public: false },
],
},
})
Signature
type CustomFields = {
Address?: CustomFieldConfig[];
Administrator?: CustomFieldConfig[];
Asset?: CustomFieldConfig[];
Channel?: CustomFieldConfig[];
Collection?: CustomFieldConfig[];
Customer?: CustomFieldConfig[];
CustomerGroup?: CustomFieldConfig[];
Facet?: CustomFieldConfig[];
FacetValue?: CustomFieldConfig[];
Fulfillment?: CustomFieldConfig[];
GlobalSettings?: CustomFieldConfig[];
HistoryEntry?: CustomFieldConfig[];
Order?: CustomFieldConfig[];
OrderLine?: CustomFieldConfig[];
Payment?: CustomFieldConfig[];
PaymentMethod?: CustomFieldConfig[];
Product?: CustomFieldConfig[];
ProductOption?: CustomFieldConfig[];
ProductOptionGroup?: CustomFieldConfig[];
ProductVariant?: CustomFieldConfig[];
ProductVariantPrice?: CustomFieldConfig[];
Promotion?: CustomFieldConfig[];
Refund?: CustomFieldConfig[];
Region?: CustomFieldConfig[];
Seller?: CustomFieldConfig[];
Session?: CustomFieldConfig[];
ShippingLine?: CustomFieldConfig[];
ShippingMethod?: CustomFieldConfig[];
StockLevel?: CustomFieldConfig[];
StockLocation?: CustomFieldConfig[];
StockMovement?: CustomFieldConfig[];
TaxCategory?: CustomFieldConfig[];
TaxRate?: CustomFieldConfig[];
User?: CustomFieldConfig[];
Zone?: CustomFieldConfig[];
} & { [entity: string]: CustomFieldConfig[] }