vulcanjs-cli icon indicating copy to clipboard operation
vulcanjs-cli copied to clipboard

Generating Modules Creates Variable Conflict

Open Neobii opened this issue 6 years ago • 2 comments

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 avatar Dec 06 '19 22:12 Neobii

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 avatar Dec 30 '19 04:12 Neobii

@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

Neobii avatar Jan 30 '20 08:01 Neobii