Browse Source

docs(core): Improve docs for customPropertyMap

Michael Bromley 3 years ago
parent
commit
a3f101ad9b

+ 6 - 2
packages/core/src/service/helpers/list-query-builder/list-query-builder.ts

@@ -66,7 +66,7 @@ export type ExtendedListQueryOptions<T extends VendureEntity> = {
      *
      * Example: we want to allow sort/filter by and Order's `customerLastName`. The actual lastName property is
      * not a column in the Order table, it exists on the Customer entity, and Order has a relation to Customer via
-     * `Order.customer`. Therefore we can define a customPropertyMap like this:
+     * `Order.customer`. Therefore, we can define a customPropertyMap like this:
      *
      * @example
      * ```GraphQL
@@ -90,7 +90,11 @@ export type ExtendedListQueryOptions<T extends VendureEntity> = {
      *   customPropertyMap: {
      *     // Tell TypeORM how to map that custom
      *     // sort/filter field to the property on a
-     *     // related entity
+     *     // related entity. Note that the `customer`
+     *     // part needs to match the *table name* of the
+     *     // related entity. So, e.g. if you are mapping to
+     *     // a `FacetValue` relation's `id` property, the value
+     *     // would be `facet_value.id`.
      *     customerLastName: 'customer.lastName',
      *   },
      * };