Pipeline functions
When you use PIPELINE resolvers, you will also need to define the used pipeline functions. You can do so under the appSync.pipelineFunctions attribute.
It's a key-value pair object whose key is the name of the function and the value is its configuration.
Quick start
appSync:
pipelineFunctions:
myFunction:
dataSource: myDataSource
code: myFunction.js
Configuration
dataSource: The name of the dataSource to use.description: An optional description for this pipeline function.code: The path to the JS resolver handler file, relative toserverless.yml.request: The path to the VTL request mapping template file, relative toserverless.yml.response: The path to the VTL response mapping template file, relative toserverless.yml.maxBatchSize: The maximum batch size to use (only available for AWS Lambda DataSources)substitutions: See Variable Substitutionssync: See SyncConfig
JavaScript vs VTL vs Direct Lambda
When code is specified, the JavaScript runtime is used. When request and/or response are specified, the VTL runtime is used.
To use direct lambda, don't specify anything (only works with Lambda function data sources).
Inline DataSources
Just like with UNIT resolvers, you can define the dataSource inline in pipeline functions.
appSync:
pipelineFunctions:
myFunction:
dataSource:
type: 'AWS_LAMBDA'
config:
function:
timeout: 30
handler: 'functions/myFunction.handler'