Open fkowal opened 2 years ago
Context: When doing CSV export It's quite common to have business requirements, to add some aggregate/external fields.
ie
shops + orders_aggregate { count }
I tried several approaches and one i'd like to enable
<ExportButton resource="shops_with_orders_report" />
buildField
where shops_with_orders_report is an "alias" that only exists in the application and the resource that will be used is the shops and a custom buildField will be provided and will decorate the shops data with extra gql { orders_aggregate { count }}
shops_with_orders_report
resource
shops
gql { orders_aggregate { count }}
Context: When doing CSV export It's quite common to have business requirements, to add some aggregate/external fields.
ie
I tried several approaches and one i'd like to enable
<ExportButton resource="shops_with_orders_report" />
+buildField
where
shops_with_orders_report
is an "alias" that only exists in the application and theresource
that will be used is theshops
and a custombuildField
will be provided and will decorate the shops data with extragql { orders_aggregate { count }}