AppSync better tools for building Mapping Templates.
- Dominant language
- TypeScript
- Stars
- 12.9k
- Forks
- 4.6k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 83
Description
Change the current MappingTemplate class to allow users to more easily build and customize request and response templates for AppSync resolvers.
### Use Case
`MappingTemplate` currently contains a number of common mappings out of the box. However if users want to customize any of the behavior they have to write a new template from scratch.
### Proposed Solution
Change the `MappingTemplate` interface to use a DSL for building and composing VTL request/response templates for AppSync APIs.
### Other
Some idealized example
```typescript
myDataSource.createResolver({
typeName: 'Mutation',
fieldName: 'mySchemaField',
requestMappingTemplate: HttpRequestMapping
.get('/apiPath')
.forwardHeaders('Authorization', 'Header-X')
.forwardBody(),
responseMappingTemplate: HttpResponseMapping
.forwardErrors()
.forwardBodyAsJson(),
});
```
* [x] :wave: I may be able to implement this feature request
* [x] :warning: This feature might incur a breaking change
---
This is a :rocket: Feature Request
Contributor guide
Research direction
Start by locating the current MappingTemplate interface and its existing AppSync request and response mappings. Define what the proposed DSL must support for composing and customizing VTL templates, including the resolver example, and verify that the resulting interface handles both request and response templates without leaving the intended behavior unspecified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, cloud
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100