MCPcopy Create free account
hub / github.com/aws-samples/aws-appsync-resolver-samples / response

Function response

samples/http/forward.js:21–29  ·  view source on GitHub ↗
(ctx)

Source from the content-addressed store, hash-verified

19 * @returns {*} the publish response
20 */
21export function response(ctx) {
22 const { statusCode, body } = ctx.result;
23 // if response is 200, return the response
24 if (statusCode === 200) {
25 return body;
26 }
27 // if response is not 200, append the response to error block.
28 util.appendError(body, statusCode);
29}
30
31/**
32 * Sends an HTTP request

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected