CustomFields
CustomFields
Most entities can have additional fields added to them by defining an array of CustomFieldConfigobjects 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[];
Order?: CustomFieldConfig[];
OrderLine?: CustomFieldConfig[];
PaymentMethod?: CustomFieldConfig[];
Product?: CustomFieldConfig[];
ProductOption?: CustomFieldConfig[];
ProductOptionGroup?: CustomFieldConfig[];
ProductVariant?: CustomFieldConfig[];
ProductVariantPrice?: CustomFieldConfig[];
Promotion?: CustomFieldConfig[];
Region?: CustomFieldConfig[];
Seller?: CustomFieldConfig[];
ShippingMethod?: CustomFieldConfig[];
StockLocation?: CustomFieldConfig[];
TaxCategory?: CustomFieldConfig[];
TaxRate?: CustomFieldConfig[];
User?: CustomFieldConfig[];
Zone?: CustomFieldConfig[];
} & { [entity: string]: CustomFieldConfig[] }