Skip to content
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

Generating Modules Creates Variable Conflict #27

Open
Neobii opened this issue Dec 6, 2019 · 2 comments
Open

Generating Modules Creates Variable Conflict #27

Neobii opened this issue Dec 6, 2019 · 2 comments

Comments

@Neobii
Copy link
Contributor

Neobii commented Dec 6, 2019

Currently when you generate a module it does this:
collectionName: 'Movies', typeName: 'Movies',
instead of this:

collectionName: 'Movies', typeName: 'Movie',
causing this error: Error: Field "Query.movies" can only be defined once.

@Neobii
Copy link
Contributor Author

Neobii commented Dec 30, 2019

I think we should document what creating a module does, ie collection, schema, fragment and takes a typeName to make sure they don't pluralize it. However, with this convention, it seems like the folder name when created doesn't add an 's'.

@Neobii
Copy link
Contributor Author

Neobii commented Jan 30, 2020

@eric-burel I figured it out. Looks like there is a naming convention collision. When you generate the tests, it creates folders like gorilla instead of gorillas. The folders should use collectionName instead of typeName correct?

Also if you specify gorillas for typeName in the arguements
https://github.com/VulcanJS/vulcanjs-cli/blob/master/src/generator-vulcanjs/generators/module/templates/collection.js#L7 typeName shows up here with an 's'.
However, here typeName shows up without an 's'.
https://github.com/VulcanJS/vulcanjs-cli/blob/master/src/generator-vulcanjs/generators/module/fragments/templates/fragments.js#L4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant