aws-appsync-community
aws-appsync-community copied to clipboard
Feature Request: Support for VTL Sort Tool
I have seen several requests for this before on the Community Forums, but I can't see it here so wanted to make sure it was raised officially.
Support for this: https://velocity.apache.org/tools/devel/apidocs/org/apache/velocity/tools/generic/SortTool.html
Or ideally the whole range of tools: http://velocity.apache.org/tools/3.0/generic.html?
We are finding that a Query to DynamoDB will often not have the results sorted in the right format for the UI (IDs used in the sortKey but alphabetical sorting needed for the GUI). So from a performance aspect we assume that doing this via VTL and not client side JS will yield the best results.
Thank you for the request. I'll make sure the team sees this as it's definitely a useful feature.
Sorting in the resolver response template only works if your DynamoDB query returns all of the results. If you need to page through the results then it won't work. The best solution is to combine additional DynamoDB indexes and switching the index based on the sort attribute.
Sorting in the resolver response template only works if your DynamoDB query returns all of the results. If you need to page through the results then it won't work. The best solution is to combine additional DynamoDB indexes and switching the index based on the sort attribute.
Adding another index won't help if you want to sort by an attribute from the query and not the sortKey itself. As sortKeys are often overloaded (like Rick Houlihan's v0 concept) or use some form of UUID, the only approach to sort the query results in a logical manner is via VTL or JS.
Would be great to have this implemented, it will allow to push some of the business logic to VTL resolvers instead of invoking downstream lambda functions.
Looking forward to this feature. There should be support for all VTL tools. I especially need to use the Math tool for simple min, max. https://velocity.apache.org/tools/3.0/tools-summary.html#MathTool
sorting is available now in $util https://docs.aws.amazon.com/appsync/latest/devguide/resolver-util-reference.html#list-helpers-in-util-list
Any news on this topic ?
No news?