mickhansen / graphql-sequelize

GraphQL & Relay for MySQL & Postgres via Sequelize
MIT License
1.9k stars 172 forks source link

Support latest Sequelize #687

Closed mybottt closed 4 years ago

mybottt commented 4 years ago

Sequelize.js renamed Model.findById(id) to Model.findByPk(id).

Its causing issues when I use nodeField.resolve. graphql gives error "sequelize.models[model].findById is not a function". Right now I am using following code to fix this

db["users"].constructor.prototype.findById = (id) => db["users"].findByPk(id);

mickhansen commented 4 years ago

Support latest graphgl-js

You mean support latest sequelize?

PR welcome, will need to support both methods depending on whats available.

mybottt commented 4 years ago

Support latest graphgl-js

You mean support latest sequelize?

PR welcome, will need to support both methods depending on whats available.

Yes I mean "Support latest Sequelize", changed title.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.