Skip to content

mongodb should be a dependency or peerDependency instead of devDependency #96

@crccheck

Description

@crccheck

In /src/cache, dataloader and bson are dependencies, but mongodb is not:

import DataLoader from 'dataloader'
import { ObjectId } from 'mongodb'
import { EJSON } from 'bson'

Current dependencies:

"dependencies": {
"@types/mongodb": "^3.5.27",
"apollo-datasource": "^0.3.1",
"apollo-server-caching": "^0.3.1",
"apollo-server-errors": "^2.4.1",
"bson": "^4.1.0",
"dataloader": "^1.4.0"
},

That means if you install apollo-datasource-mongodb, then run npm prune --production, there's a chance that the mongodb package will be pruned and this package will error with:

Error: Cannot find module 'mongodb'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions