objection-graphql icon indicating copy to clipboard operation
objection-graphql copied to clipboard

Get singular and plural model names from jsonSchema

Open aurium opened this issue 6 years ago • 5 comments

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.

aurium avatar Jul 21 '18 22:07 aurium

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.

andriibieriezhnoi avatar Apr 27 '19 22:04 andriibieriezhnoi

Any thought on when this will be merged? I've run in to this issue now as well.

tsimons avatar May 23 '19 16:05 tsimons

Please merge 🙏

aizotov avatar Aug 08 '19 03:08 aizotov

@sbabushkin could you check this PR please? :)

andriibieriezhnoi avatar Aug 08 '19 13:08 andriibieriezhnoi

Bump!

I've encountered this in my project as well. Would be great to get this merged in :)

CarlosFandango avatar Aug 03 '20 22:08 CarlosFandango