Zendro-dev / graphql-server

Skeleton NodeJS project for a graphQL server.
GNU General Public License v3.0
0 stars 1 forks source link

Switch requiring of specific models to new global module #15

Closed asishallab closed 5 years ago

asishallab commented 5 years ago

In utils/login.js line 3 const user = require('../models_index').user; raises an error: Error: Cannot find module '../models/index'

That is because we switched to single central import for all models regardless of there backend storage technology via models_index.js.

Check the whole projects graphql-server and graphql-server-model-codegen for outdated model imports and fix them. Write tests were necessary and applicable. To this efficiently use something like

find . -type f -iname '*js' -exec grep -ilP 'require.*models_index' \{\} \;

Please commit the fix in a single well encapsulated commit so that that specific commit can be used in a git cherry-pick to fix this bug in other branches.

Estimated work time: 1.5h

asishallab commented 5 years ago

Fixed in project graphql-server with commit a4a7784585ddbf35356f264f50321e0f1dae8a97. Login should now work again.

Please check project graphql-server-model-codegen using the same approach with find ....

Actual work time for the graphql-server project: 7 minutes

YKolokoltsev commented 5 years ago

Tested and closed