Can I provide filters to resource data being passed to the inferencer in a component?
I found the page on using the inferencer as part of a component (https://refine.dev/docs/api-reference/core/components/inferencer/), but I cannot figure out if I can apply filters to the data from the resource being provided to the inferencer. Is this possible?
(By the way, I absolutely love the inferencer, it is seriously an incredible engineering feat and the addition of it to refine has really increased my productivity, having the code it generates ready for customization is absolutely incredible!)
5 Replies
raw-harlequin•2y ago
hi i had this same question earlier today. https://discord.com/channels/837692625737613362/1078037565929701396/1078037565929701396
i am a big fan of the inferencer too
maybe this can help
https://discord.com/channels/837692625737613362/1076258140154232873/1076258140154232873
extended-salmon•2y ago
Thanks! You were able to get it working?
raw-harlequin•2y ago
import { HeadlessInferencer } from "@pankod/refine-inferencer/headless";
export default function page1() {
const transformer = (field) => {
if (field.key === "id") {
return false;
}
return field;
}
return (
<>
<span>page2</span>
<HeadlessInferencer
resource="categories"
action="list"
fieldTransformer={transformer}
/>
</>
)
}
i want way more control, so i will probably have to modify the data provider nd customize it to parse different api endpoints, but this works for already optimized apis
exotic-emerald•2y ago
Thanks for the contribution @kg6800 !
@hortinstein , did the previous message answers your question?
extended-salmon•2y ago
Yeah thank you!