marshallswain / feathers-graph-populate

Add lightning fast, GraphQL-like populates to your FeathersJS API

Home Page:https://feathers-graph-populate.netlify.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`transformResult`

fratzinger opened this issue · comments

I've an app with customers and orders. In my frontend I've a table with customers and a column with ordersCount. I would like to populate that with graph-populate. So dynamically populate a number to an item.
A possible way would be:

ordersCount: {
    service: 'orders',
    nameAs: 'ordersCount',
    params: { query: { limit: 0 }, paginate: true }
    transformResult: (item, context) => item.total
  },