Closed bjacog closed 3 years ago
Hi,
What is the name of the resource in App.js
?
The pluralization is dumb, so if your model is Category
, resource name should be: categorys
You can then change the label like:
<Resource name="categorys" options={{ label: "Categories" }} />
@MrHertal Thank you that pointed me in the right direction.
Your solution works but another issue in react-admin causes the dataprovider to pass relations as fields to amplify. So I had to implement custom graphql mutations for updates anyway. So I ended up customizing the graphql queries for the model with the name "fixed" to Categorie
and right now that seems like the solution with the cleanest implementation without having to have resources with funny names.
I have an AWS Amplify graphql api model:
My list component works 100% out of the box using what ListGuesser provides.
For Create, using a very basic Create form:
When I try to save the form data, it. produces an error:
Seems like a classic error in pluralization, but. inspecting the code of this lib or the graphql lib used yielded no information to me. I updated the Create:
And it worked. Moving on I expected the same to be required for Edit but alas it did not work. My Edit component:
This produces the some message that Create produced:
So I added the resource, first just with one
y
:Which yields:
Adding another
y
to the resource in an attempt to hack it:Which produces the same error for the updated resource name:
Any help would be greatly appreciated.