You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
The findAll and findOne boilerplate queries are being created with the same name, resulting in only the latter being generated on the GQL Schema file.
I've tracked the problem in the files and seems to me that the faulty code is in this file: "src/lib/resource/files/ts/name.resolver.ts" . If just altering the name of the query suffice, I could send a PR.
Expected behavior
The two resolvers should be generated into the GQL Schema file.
Minimal reproduction of the problem with instructions
run the nest g resource and select the GraphQL Code First approach**. Then, look at the generated GQL file.
What is the motivation / use case for changing the behavior?
Fix the bug
Environment
Nest version: 7.5.1
For Tooling issues:
- Node version: 14.15.0
- Platform: Linux on WSL2
The text was updated successfully, but these errors were encountered:
The solution to this issue isn't that obvious. The reason why queries are generated with the same name in your example is that pluralize package gives the exact same word for both singular and plural forms of "portfolio" (which is correct). This should not happen for most of the existing nouns.
Anyways, we should add an additional protection mechanism to prevent such names clash. If you have any ideas + you would like to create a PR for this issue, that would be more than welcome!
HI, I also ran into this issue when creating a new resource.
To solve this, I would think for findAll it should always be pluralized since you're returning multiple. Then the findOne can be singularized.
So going with the example of this issue, Portfolio, findAll would be Portfolios and findOne would be Portfolio. If the resource was already named Portfolios it seems pluralize just returns the string and doesn't double pluralize.
I'm submitting a...
Current behavior
The findAll and findOne boilerplate queries are being created with the same name, resulting in only the latter being generated on the GQL Schema file.
I've tracked the problem in the files and seems to me that the faulty code is in this file: "src/lib/resource/files/ts/name.resolver.ts" . If just altering the name of the query suffice, I could send a PR.
Expected behavior
The two resolvers should be generated into the GQL Schema file.
Minimal reproduction of the problem with instructions
run the nest g resource and select the GraphQL Code First approach**. Then, look at the generated GQL file.
What is the motivation / use case for changing the behavior?
Fix the bug
Environment
The text was updated successfully, but these errors were encountered: