objection-graphql
objection-graphql copied to clipboard
Get singular and plural model names from jsonSchema
This is similar to listFieldName
and fieldName
from graphQLBuilder().model()
's extra parameter.
It can simple replace listFieldName
and fieldName
if you can add collectiveName
and singleName
to your models's jsonSchema.
The benefit is:
- Center the model description;
- Produce the correct single type name in the result graphQL schema;
- Share the model identification with oder modules in the app.
I ran into a problem when the name of the table is "users" and I have to write userss (double s)
i think this is a useful PR.
Any thought on when this will be merged? I've run in to this issue now as well.
Please merge 🙏
@sbabushkin could you check this PR please? :)
Bump!
I've encountered this in my project as well. Would be great to get this merged in :)