-
Notifications
You must be signed in to change notification settings - Fork 73
What's the plan around query pluralization? #2120
Comments
/cc @craicoverflow, @wtrocki |
You are genius! I would love to kill pluralization but is this an huge impact on everything. We have hacks for it in offix datastore etc. so removing it will be something we totally forgot about |
To me
|
Thanks for chiming in @craicoverflow
I read it as
|
Also it does not have to be a breaking change, we can deprecate the pluralised form with the Everytime the old pluralised resolver is called, we could print a warning log that this is deprecated and it will be removed in the future release while suggesting to use the new way - whichever that will be. |
Marking as potential blocker for entire client side stuff and graphql crud. @craicoverflow What would be your approach for this? |
My approach would be to define a type Person @plural(name: 'Persons') {
} From the Graphback side, we can still use a |
That will make working with datasync very hard and tbh.. we looking for simplification of the code. Prisma 1 had. Letting people naming those would be option that might be worth adding complexity as well as suggested in graphql crud issue, but not sure about just pluralize itself. It will not appear to me as good change |
It's the only way I can think of adding this without changing names of all the queries.
Another way to fix it using language is But all these methods are sacrificing concise schema definitions, which is why I considered the directive. Just wondering - how does it make working with DataSync very hard?
I agree with you there - it is better than using pluralize. |
I think I figured out solution for the problem in short period. For long term we can keep this issue to consider user provided names etc. |
Include it how? By using plural form for types? |
We have JSON Schema models in client that can:
Our generator that does that (offix-datastore-cli) and uses graphback core. I will record a demo on how offix datastore works and share it with the team. |
Pluralizing queries force someones to understand different exceptions that can come with pluralizing.
E.g
resulted in
which is very confusing as an average english user I'd start asking myself where did this
findPeople
come from? Why notfindPersons
which seem more formal.Another example.
which gives,
Which got me asking: If I've a model like that, how do I "list all persons"?
I think we should drop pluralization for something more approachable by anyone with any English level.
Doing so could help fix the "Query override" error with the second model.
I think this was discussed in graphqlcrud/spec#28 without settling to what the best course of action on Graphback side.
The text was updated successfully, but these errors were encountered: