Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get and set of array values not working in amplify-velocity-template #5593

Closed
MainAero opened this issue Oct 15, 2020 · 6 comments · Fixed by #5747
Closed

get and set of array values not working in amplify-velocity-template #5593

MainAero opened this issue Oct 15, 2020 · 6 comments · Fixed by #5747
Assignees
Labels
bug Something isn't working mock Issues tied to the mock functionality

Comments

@MainAero
Copy link

MainAero commented Oct 15, 2020

The implementation of set and get methods of an array in velocity is not working like in the real environment.

These lines should be replaced by an implimentation like:

if (id === 'get' && !baseRef[id]) {
    return baseRef[this.getLiteral(property.args[0])];
} else if (id === 'set' && !baseRef[id]) {
    return baseRef[this.getLiteral(property.args[0])] = this.getLiteral(property.args[1]);
} 
@MainAero
Copy link
Author

May related: shepherdwind/velocity.js#132

@yuth yuth added bug Something isn't working mock Issues tied to the mock functionality labels Oct 15, 2020
@yuth
Copy link
Contributor

yuth commented Oct 15, 2020

@MainAero Thank you for bringing this to our attention. We would appreciate an pull request as we are not merging the upstream to our implementation.

@yuth yuth added this to To do in Bug bash via automation Oct 19, 2020
@renebrandel
Copy link
Contributor

@MainAero - we're about to create a PR for this but wanted to make sure if you want to contribute to provide you an opportunity to do so. Happy to address this either way.

@MainAero
Copy link
Author

@renebrandel thanks I created a PR for that.

As we are currently working on a typescript based test util for Appsync which enables you to write functional / integration test for your vtl resolvers I guess we might open a few PR's.

@renebrandel
Copy link
Contributor

Cc @yuth

@yuth yuth moved this from To do to Review in Bug bash Oct 31, 2020
@litwicki litwicki self-assigned this Nov 9, 2020
@attilah attilah assigned yuth and unassigned litwicki Nov 9, 2020
Bug bash automation moved this from Review to Done Jan 16, 2021
GraphQL API Mock Improvements automation moved this from To do to Done Jan 16, 2021
@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working mock Issues tied to the mock functionality
Projects
Bug bash
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants