-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Improvement] Ability to override generated query/mutations names #586
Labels
enhancement
New feature or request
Comments
@Davide-Gheri I'll take a look at this it shouldn't be too hard to add. |
doug-martin
added a commit
that referenced
this issue
Oct 17, 2020
doug-martin
added a commit
that referenced
this issue
Oct 17, 2020
doug-martin
added a commit
that referenced
this issue
Oct 18, 2020
doug-martin
added a commit
that referenced
this issue
Oct 18, 2020
I published a new version Thank you for the feature request, and let me know if you have any issues! -Doug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I understood that the names of Queries and Mutations generated from CRUDResolver (and all other subsets of Resolvers) comes from the DTO name and the "plural" version is generated using
pluralize
.Thats ok for most of the cases, but sometimes plural is the same than singular (at least for pluralize), this causes the read one Query (
findById
) to be lost because it gets overridden by the read many Query (getMany
).I see that there is a
dtoName
options but it does not help me.For example, I have an ObjectType defined as
Agenda
, where singular and plural are bothagenda
, to make the read one endpoint work I had to create a custom Resolver that extendsReadResolver
and override bothqueryMany
andfindById
methods, define bothFindOneArgs
andQueryArgs
(because they are not exposed outside theReadable
mixin) and call thegetQueryManyHook
andgetFindOneHook
to keep hooks working.I also lost the "dynamic" queryMany return type based on pagingStrategy.
It would be awesome to have an option to override single endpoint names.
The text was updated successfully, but these errors were encountered: