Reputation: 1637
those are the dependencies I'm using
"dependencies": {
"express": "^4.16.3",
"express-graphql": "^0.6.12",
"graphql": "^0.13.2",
"lodash": "^4.17.10"
}
here is my schema.js file looks like
here is the code inside my server.js file
Upvotes: 2
Views: 1261
Reputation: 1637
lodash library find methods first parameter is the data source. so URLSearchParam
is mistakenly typed. be careful about auto completions of some IDEs provide. so they may fill incorrect data as you type.
using a good JavaScript linter can point you that problem. I do recommend eslint.
in this situation the data source is the variable users
so replacing URLSearchParam
with users solved this problem.
Upvotes: 0
Reputation: 61
I was facing the same issue. Here's how I managed to fix it:
const { URLSearchParams } = require('url');
global.URLSearchParams = URLSearchParams;
Upvotes: 6