serverless-appsync-plugin
serverless-appsync-plugin copied to clipboard
Feature request: Inline Lambda data sources within mappingTemplates
Hooking up Lambda functions as resolvers currently feels quite verbose and disconnected: first define the function in standard functions
section, then add an item to the plugin's mappingTemplates
section and then also define a separate data source. If you're using single-responsibility Lambda functions, the configuration file really grows.
Ideally it would be great if an appsync
event could be defined in the standard functions.functionName.events
array in serverless.yml so that the function and the resolver that triggers it are configured in the same place. However, I guess this may not be easy to hook into for a plugin, so instead would it even be possible to inline the data source within the mappingTemplates section rather than having to define it separately? I'm thinking of something like this:
mappingTemplates:
- type: Mutation
field: updateProfile
dataSource:
type: AWS_LAMBDA
functionName: updateProfile
Keep an eye on v2 :)
https://github.com/sid88in/serverless-appsync-plugin/blob/v2/doc/resolvers.md#inline-datasources
Beautiful! 😃 Thank you @bboure I know you mightn't be able to say, but do you have a rough idea of when v2 will be ready?
I'm expecting to launch an alpha soon (in a few weeks at most).
I'm a bit busy with client work right now :)