graphql-compose / graphql-compose-mongoose

Mongoose model converter to GraphQL types with resolvers for graphql-compose https://github.com/nodkz/graphql-compose
MIT License
708 stars 94 forks source link

Mongoose Deprication Warnings #121

Open michaelwclark opened 5 years ago

michaelwclark commented 5 years ago

Mongoose (actually mongo driver underlying i think) has depricated many fields in the most recent versions. I believe this package is triggering lots of warnings about this.

Example Warnings

(node:46925) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead.
(node:46925) DeprecationWarning: collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.
(node:46925) DeprecationWarning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
(node:46925) DeprecationWarning: collection.count is deprecated, and will be removed in a future version. Use collection.countDocuments or collection.estimatedDocumentCount instead

package.json (excerpt)

    "graphql": "^0.13.2",
    "graphql-compose": "^4.3.0",
    "graphql-compose-mongoose": "^4.1.1",
    "graphql-iso-date": "^3.5.0",
    "graphql-tools": "^3.0.2",
    "graphql-type-json": "^0.2.1",
    "mongoose": "^5.2.10",
israelglar commented 5 years ago

This warning are still being thrown. Is there a timeline to fix this?

nodkz commented 5 years ago

I don't have enough time right now. PR can be quite simple, like this https://github.com/graphql-compose/graphql-compose-mongoose/commit/487884488eeb977b64d880ae4b0e15b547f25d2a#diff-2944c7c61cd747255906ed1c091ea146

I will be very happy if someone makes PR. 😉