Questions tagged [vtl]

The Velocity Template Language (VTL) is meant to provide the easiest, simplest, and cleanest way to incorporate dynamic content in a web page.

VTL is the Velocity Template Language.

It includes Variables, Properties, Methods, Directives, Macros, and more...

Reference: http://velocity.apache.org/engine/2.0/vtl-reference.html

193 questions
1
vote
1 answer

AWS AppSync enhanced subscription filter not working

Implementing subscriptions for AWS AppSync I use the enhanced filter capability to filter out tasks, that does not belong to a specific user. To distinguish between users an ID is used in the claims part of the verified JWT that is then parsed in…
1
vote
0 answers

How to send JSON data of AWSJSON Type through one AppSync to another Appsync?

I am sending the request from one AppSync to another AppSync GraphQL endpoint. Receiving error while sending JSON data for the FIELD data. In VTL Template, $ctx.args.input.data will hold the value for data field. I have tried to parse the data in a…
1
vote
0 answers

AWS AppSync VTL null arrays

I am creating a GraphQL API using AWS AppSync with VTL templating language. However when creating a field resolver I am encountering a problem. Code for request mapping: { "version": "2018-05-29", "statements": [ "select identifier…
1
vote
0 answers

Jira velocity release notes - linked issues, attachment and release date var

maybe you guys can help me. I would like to edit the release notes and started to build my own vm file. So far so good. Unfortunately I still can't find any reasonable documentation for the single possible VTL variables. Is there any at all? I could…
lucky_newby
  • 43
  • 1
  • 7
1
vote
1 answer

Access nested body property from HTTP resolver(AppSync)

I'm new to AWS AppSync and I am trying to access certain body property(from HTTP response) in my resolver's response mapping template. For example: I am able to present the response as is via $util.toJson($ctx.result.body), but when I try to get…
Hairi
  • 3,318
  • 2
  • 29
  • 68
1
vote
1 answer

Round off in API Gateway Mapping Template

I have overs float value as input, I need to round the float value and pass it on. How can I do it in mapping templates? #set($overs = 15.123) #set($overs_rounded = $math.roundTo(2, $overs)) { "data": { "overs": $overs_rounded …
1
vote
1 answer

AWS AppSync - GraphQL API Mapping Template Error

I am trying to integrate my GraphQL Web API with AppSync. But I am getting the following error "errorType": "MappingTemplate", "message": "Template transformation yielded an empty response." My Data Source HTTP end Point is :…
Ullan
  • 905
  • 4
  • 15
  • 28
1
vote
0 answers

Quotation marks syntax for Elastic search multiline script in Appsync resolver

In elastic search, you can update data in an index using a script in the post request. And you can write multiline script using triple quotation marks like this (in the open search dev console): POST /item/_update/123 { "script" : { …
1
vote
0 answers

How to get a unix timestamp in VTL?

Is there any modify date format action (like #set($a = $date.get('unix timestamp format code'))) in the velocity template language which will allow to change date format to the form of a unix timestamp or can I get date in a unix timestamp format…
1
vote
0 answers

AWS AppSync - $util.typeOf() retrns 'Map' on variable containing string

I'm trying to write an AppSync resolver which updates DynamoDB nested object. In order to create correct UpdateItem expressions, I have to loop through $ctx.args and evaluate if arg is simple type ie. field updatedAt that contains a string or a…
1
vote
0 answers

How to add the variable from context in keyconditions aws cdk appsync

How can I provide the id variable from context.args in the following code: requestMappingTemplate: appsync.MappingTemplate.dynamoDbQuery(appsync.KeyCondition.eq("id", ) I know how to get it in VTL, but I cannot find any example of adding the…
plutolaser
  • 448
  • 4
  • 17
1
vote
1 answer

VTL: Add a new property to an maps inside an array (AWS Appsync, DynamoDB)

I'm new to VTL and AWS appsync and try to get my head around how things are working. The maps that are representing Steps in a List should have the property id with a UUID before there are stored in DynamoDB. To accomplish this I tried to iterate…
JBDev
  • 144
  • 1
  • 10
1
vote
1 answer

What are the options for querying a DynamoDB GSI to find matching substrings?

I have a dynamodb table with a structure something like: { Type: 'AWS::DynamoDB::Table', Properties: { KeySchema: [ { AttributeName: 'itemID', KeyType: 'HASH' } ], AttributeDefinitions: [ { …
Rob Fyffe
  • 719
  • 1
  • 8
  • 22
1
vote
1 answer

How to add a field to an existing JSON in Velocity?

I have a JSON coming from a request body and I'm trying to use VTL to map it by adding an additional field to it. The request body looks like this: { "name": "John", "age": 20, "address": { "street": "Albert's Street", "City":…
Carven
  • 14,988
  • 29
  • 118
  • 161
1
vote
1 answer

AppSync Resolver Pipeline - Multiple Outputs Joining

I have a pipeline resolver that gets data from two datasources sharing the same schema. Let's say both of them return a list of 10 items each (a total of 20). How can I merge both outputs into one list and return it to AppSync properly as a Json?…
saedx1
  • 984
  • 6
  • 20