Unable to load handler matching mongoose: Cannot find module 'mongoose'
Closed this issue · 2 comments
MRVDOG commented
Hi, when trying to add a mongodb data-source and create an API to use it, I get the following error in the gateway container logs, I know this is a gateway issue, but I felt it would be best here as I used the docker composer to build my stack.
any assistance would be greatly appreciated, thanks :)
2021-09-11T13:58:19.540Z pid: 20 [router] error: Error: Unable to load handler matching mongoose: Cannot find module 'mongoose'
Require stack:
/usr/local/share/.config/yarn/global/node_modules/graphql-compose-mongoose/lib/types/MongoID.js
/usr/local/share/.config/yarn/global/node_modules/graphql-compose-mongoose/lib/index.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/mongoose/index.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/config/index.cjs.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/server/router.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/middleware/graphql-rate-limit/rate-limit.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/middleware/index.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/server/index.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/index.js
/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/bin.js
at getPackage (/usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/config/index.cjs.js:67:23)
at async getHandler (/usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/config/index.cjs.js:74:23)
at async Promise.all (index 0)
at async /usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/config/index.cjs.js:245:50
at async Promise.all (index 0)
at async Promise.all (index 0)
at async Object.processConfig (/usr/local/share/.config/yarn/global/node_modules/@graphql-mesh/config/index.cjs.js:240:84)
at async getMeshForApiDef (/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/server/router.js:126:28)
at async buildApi (/usr/local/share/.config/yarn/global/node_modules/@graphql-portal/gateway/dist/src/server/router.js:79:12)
at async Promise.all (index 2)
2021-09-11T13:58:19.540Z pid: 20 [router] error: Could not get schema for API, endpoint /test won't be added to the router
MRVDOG commented
I also want to add, that I ran through the guided tour to add the pets API, and that works perfectly
MRVDOG commented
resolved, added && yarn global add mongoose
before && graphql-portal
in the container command.
"/bin/sh" "-c" "echo 'Waiting for 10 seconds for Dashboard to come online...' && /bin/sleep 10 && cd /opt/graphql-portal && yarn global add mongoose && graphql-portal"