genetic-orange
genetic-orange3y ago

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
exotic-emerald
exotic-emerald3y ago
genetic-orange
genetic-orangeOP3y ago
Thanks! You were able to get it working?
exotic-emerald
exotic-emerald3y 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
fascinating-indigo
fascinating-indigo3y ago
Thanks for the contribution @kg6800 ! @hortinstein , did the previous message answers your question?
genetic-orange
genetic-orangeOP3y ago
Yeah thank you!

Did you find this page helpful?