Don't understand the inferencer's behavior #5341
-
I am discovering the refine tool and on paper I quite like the idea of inferencer. I understand that it makes a guess and generates some code. But I keep gettin the error "Something went wrong while fetching the resource data" using apis with the same structure as the one provided in the documentation with api.fake-rest. In this example I used the very famous pokeapi: Then in the Refine component pass the following in the data Provider's prop:
I understand that I can create a custom dataProvider but as the idea would be to use refine in several projects, and in some of which I will use different apis, I would like to know if there is a simpler way to solve the use of MuiInferencer or understand what I am doing wrong. Thank you in advance |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @nahuelranieri, sorry for the issue! I had to admit that this error message is not really explaining much of the issue, sorry for that 🤦 Does the error message also have the resource name? If so, then it's related with the first fetch that is sent for the main record data. If it doesn't have the resource name, then it's because there's an issue with the relation requests. In this case, you should be able to see the generated code using the prompt at the bottom of the screen and we can investigate it further if you can share the generated output and provide a sample response from the API. I'll also check this myself and try to reproduce the issue. Thank you for reporting this 🙏 I'm also adding a task to our to-do to update error messages of the inferencer components to provide meaningful traces. 🚀 |
Beta Was this translation helpful? Give feedback.
Hey @nahuelranieri, sorry for the issue! I had to admit that this error message is not really explaining much of the issue, sorry for that 🤦
Does the error message also have the resource name? If so, then it's related with the first fetch that is sent for the main record data.
If it doesn't have the resource name, then it's because there's an issue with the relation requests. In this case, you should be able to see the generated code using the prompt at the bottom of the screen and we can investigate it further if you can share the generated output and provide a sample response from the API.
I'll also check this myself and try to reproduce the issue. Thank you for reporting this 🙏 I'm als…