This repository has been archived by the owner on Dec 9, 2024. It is now read-only.
WIP - Mongo Integration Initial Commit, works on localhost, not lambda #305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In response to #260
WIP:
Issue No. 1 -
sls logs -f graphql -s production
gives me the following errorMongoDB connection error. Please make sure MongoDb is running. { MongoError: failed to connect to server [undefined:27017] on first connect [MongoError: getaddrinfo ENOTFOUND undefined undefined:27017]
Issue No. 2 -
When I deploy to lambda, I get
I tried on my visiting my cloud front url, and directly on the s3 endpoint that is http but always seeing this.
In Postman I enter the following query:
http://localhost:4000/graphql
{"query":"{\n getUserById(_id:\"5a5eb1dcc33a4d6706dbc344\"){\n _id }\n }\n"}
And here is the response:
When I use my endpoint in lambda
I can't tell if the cors issue and mongo connection issue are independent or is cors causing the failure to connect to mongo, or is my code the reason. I am using mongoose.
I left my development cluster in the
config/mongo/security.env.local
because i have mock data in it, leaving prod and local env files inconfig/mongo
directory.