ra-data-prisma
ra-data-prisma copied to clipboard
`pluralize("audio") === "audio"`
Sometimes the plural of a word equals its singular. For instance I had a table "audio" and pluralize.js generates "audio" as plural. Which is I think correct (for the curious, compare "video").
Anyways, it that was a hard to spot bug for me and I think there should be some mechanism to avoid this.
Another case where the simple pluralize does not work well in my view is e.g.:
- PageAbout
- PageHome
- PageCredits
they're all singular, even the third one. But we get some "PageAbouts", "PageHomes", "PageCredits"
The solution is of course to use postfix instead of prefix. (AboutPage, HomePage, CreditsPage) However, I find this a bit limiting.
same as https://github.com/panter/ra-data-prisma/issues/32
its an upstream issue. nexus-plugin-prisma suffers from the same problem
https://github.com/graphql-nexus/nexus-plugin-prisma/pull/804
Happened across this thread while looking for a completely unrelated issue. I know its ancient by now but wanted to add my own personal insight since nothing very resolute has been said yet:
This is indeed an "upstream" issue but more so in the linguistic/philisophical sense than the technical.
"Audio" is an uncountable/mass noun. Other examples include music, information, rice, milk, advice, etc.. This class of words was conceived because it's useful as a means to help people conceptualize related things that we don't usually think of in distinct countable units.
In effect, I would argue that uncountable/mass nouns are fundamentally unsuitable for class/entity names in the realms of programming & data science. Not truly understanding the nature of what you intended to embody with the word "audio" (the most immediate indicator of unsuitability from my perspective): AudioFile, AudioInstance, or just "sound" would be much better candidates.