quickest-silver•5h ago
inferencer meta
I use MuiShowInferencer for Show view, and my data providers does not receive meta in getOne method?
2 Replies
Hi @p0rsche. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources, the issue you're experiencing is known: currently, Inferencer components like MuiShowInferencer do not automatically pass the resource's meta property to the data provider's getOne method. Instead, Inferencer components use the meta prop passed directly to them, and do not merge or inherit the meta from the resource definition in your <Refine /> configuration. This has been confirmed as a limitation in the current implementation and has been discussed in GitHub issues:
Your data provider's getOne will only receive meta if you pass it directly to the Inferencer component. The meta defined in the resource configuration is not automatically propagated to Inferencer-generated views at this time. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
"Inferencer components use meta prop that is passed to the component but skips the meta of the resource definition, this is not good, we can make this improvement."So, if you want your data provider to receive meta in getOne when using MuiShowInferencer, you must explicitly pass the meta prop to the Inferencer component itself. The meta from the resource definition will not be automatically forwarded. Example: This structure allows you to define meta values per resource and per method, but you must provide it directly to the Inferencer component. The current behavior does not merge meta from the resource definition in <Refine /> with the meta used by the Inferencer component or the data hooks it generates Usage with GraphQL backends and meta values. Summary:
— AntdShowInferencer with custom id column name
Your data provider's getOne will only receive meta if you pass it directly to the Inferencer component. The meta defined in the resource configuration is not automatically propagated to Inferencer-generated views at this time. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
<@170007870388043776> Kapa.ai is still learning and improving, please let me know how I did by reacting below.