MCPcopy Create free account
hub / github.com/serverless/examples / getGreeting

Function getGreeting

aws-node-graphql-api-with-dynamodb/handler.js:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21});
22
23const getGreeting = firstName => promisify(callback =>
24 dynamoDb.get({
25 TableName: process.env.DYNAMODB_TABLE,
26 Key: { firstName },
27 }, callback))
28 .then((result) => {
29 if (!result.Item) {
30 return firstName;
31 }
32 return result.Item.nickname;
33 })
34 .then(name => `Hello, ${name}.`);
35
36const changeNickname = (firstName, nickname) => promisify(callback =>
37 dynamoDb.update({

Callers 1

handler.jsFile · 0.85

Calls 1

promisifyFunction · 0.85

Tested by

no test coverage detected