-
Notifications
You must be signed in to change notification settings - Fork 2
awesome demo! couple of suggestions #1
Description
first and foremost: thanks for this, a really fun walk-thru that taught me about appsync functions, very cool
A few improvements:
Thge mongo db resoucePath in lib/graphql/mappings/listApplicants.js and addApplicant will vary from mongodb instance to instance. Or maybe it's related to region. In any case, mine was different from yours. Maybe adding it as a ssm variable or something to indicate that it will vary might be a good idea
It might also be a good idea to include the erro msg from the mongodb api in the functions, something like
util.error(`record failed to be inserted: ${res}`)
Lastly, the lib/graphql/mappings/getMongoSecret.js function prints the secret in cleartext. I think it might make sense to add least add a code comment that it's probably not a good idea to do so in a real-world application. We don't want secrets leaking into cloudwatch logs...