wise-white
wise-whiteβ€’2y ago

manually modifying inferencer fields

reference: https://refine.dev/docs/packages/documentation/inferencer/#modifying-the-inferred-fields sorry if this sounds novice, but what is an inferencer component, and does anyone have a guide on using the inferencer components?
Inferencer | refine
@pankod/refine-inferencer is a package that provides a way to automatically generate views for resources based on the data structure. The aim is to reduce the amount of time spent on creating views for resources by generating the code automatically that can be customized easily.
4 Replies
refine-support-bot
refine-support-botβ€’2y ago
Hi, I am refine support bot :wave:. I am here to help you with your question. I searched for the answer to your question in the refine documentation and found an answer! πŸ†
Answer: An inferencer component is a component that is used to generate CRUD pages based on an API response. It is part of the @pankod/refine-inferencer package and can be imported from @pankod/refine-inferencer/headless, @pankod/refine-inferencer/mui, @pankod/refine-inferencer/mantine, or @pankod/refine-inferencer/antd. A guide on using the inferencer components can be found at https://refine.dev/docs/packages/documentation/inferencer/#modifying-the-inferred-fields. SOURCES: https://refine.dev/docs/packages/documentation/inferencer/#modifying-the-inferred-fields

Note: If this is the answer you need, then we are very lucky. If not, please wait for someone from the refine core team or the community to try to help you.
Inferencer | refine
@pankod/refine-inferencer is a package that provides a way to automatically generate views for resources based on the data structure. The aim is to reduce the amount of time spent on creating views for resources by generating the code automatically that can be customized easily.
wise-white
wise-whiteβ€’2y ago
Hey @kg6800, you can use fieldTransformer prop and pass a function in form
(field: InferField) => InferField | undefined | null | false
(field: InferField) => InferField | undefined | null | false
Inferencer will pass, each inferred fields and replace them with the value you returned. Other than that, there's currently no way to provide extra fields to the inferencer.
wise-white
wise-whiteβ€’2y ago
hey is there a way I can 1) define a specific schema through an object etc and 2) forward it to the inferencer to generate a view without making an external api call
wise-white
wise-whiteβ€’2y ago
Sorry, @kg6800 currently there's no way to do this but this is actually on our backlog for inferencer πŸ˜