Create Lambda resolver

One especially useful feature of AWS AppSync is its ability to resolve GraphQL queries against non-traditional data sources. This can be done with Lambda resolvers. With Lambda resolvers, anything that can be retrieved using Lambda can be returned in response to a GraphQL query. In your case, you’ll be attaching the Lambda function created earlier as the resolver for various resources in this schema.

Next to the schema there is an Attach button to attach a resolver to a particular entity in the schema. Click the button next to createProduct.

Attach a resolver to the mutations

You are taken to a page where you will need to look up the Lambda function created previously. Begin by clicking Add datasource, name it ambSupplyChainConnector, then select AWS Lambda function, then the region you are currently in, then select the previously-created Lambda function from the drop-down. Leave New role selected. Finally, click Create.

AWS Lambda in the Management Console