You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If applicable, what version of Node.js are you using?
v20.9.0
Amplify CLI Version
1.4.9
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
When the compound assignment operator (+=) is used as the return expression the behavior differs from plain JS. Specifically, JS will evaluate the expression and the new value will be returned. AppSync_JS will return "".
This occurs whether the operands are string or numeric.
Expected behavior
The behavior should be consistent with JS or disallowed via a lint rule and the syntax checker in the AWS Console.
Reproduction steps
Define the following resolver in the Amplify console.
Create the default test context and run the test.
Observe that the request and response resolvers return different results.
(Optional) Uncomment return data.foo ?? "some other value" and observe that it works as expected
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v20.9.0
Amplify CLI Version
1.4.9
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
When the compound assignment operator (+=) is used as the return expression the behavior differs from plain JS. Specifically, JS will evaluate the expression and the new value will be returned. AppSync_JS will return "".
This occurs whether the operands are string or numeric.
Expected behavior
The behavior should be consistent with JS or disallowed via a lint rule and the syntax checker in the AWS Console.
Reproduction steps
return data.foo ?? "some other value"
and observe that it works as expectedProject Identifier
No response
Log output
No response
Additional information
This will probably need to be looked at with #3170
Before submitting, please confirm:
The text was updated successfully, but these errors were encountered: