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

fix(amplify-appsync-simulator): make ExpressionAttributeNames optional #5575

Conversation

chucre
Copy link
Contributor

@chucre chucre commented Oct 13, 2020

When you map a unit or a function to use a DynamoDB data source and use the operation UpdateItem and
do not set condition.expressionNames or update.expressionNames in the payload the
amplify-appsync-simulator stops execution. The AppSync DynamoDB template reference says that those
attributes are optional.

Issue #, if available:
fix #5573

Description of changes:
Replace to null if the object is empty, the same approach used in the Query operator.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

When you map a unit or a function to use a DynamoDB data source and use the operation UpdateItem and
do not set condition.expressionNames or update.expressionNames in the payload the
amplify-appsync-simulator stops execution. The AppSync DynamoDB template reference says that those
attributes are optional.

fix aws-amplify#5573
@codecov
Copy link

codecov bot commented Oct 13, 2020

Codecov Report

Merging #5575 into master will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5575      +/-   ##
==========================================
- Coverage   59.08%   59.08%   -0.01%     
==========================================
  Files         402      402              
  Lines       18043    18045       +2     
  Branches     3575     3390     -185     
==========================================
  Hits        10661    10661              
- Misses       6723     6745      +22     
+ Partials      659      639      -20     
Impacted Files Coverage Δ
...psync-simulator/src/data-loader/dynamo-db/index.ts 10.86% <0.00%> (-0.25%) ⬇️
packages/amplify-util-mock/src/api/api.ts 0.00% <0.00%> (ø)
packages/graphql-mapping-template/src/print.ts 34.65% <0.00%> (ø)
packages/amplify-util-mock/src/storage/storage.ts 0.00% <0.00%> (ø)
...ges/amplify-util-mock/src/CFNParser/stack/index.ts 0.00% <0.00%> (ø)
...es/amplify-util-mock/src/api/resolver-overrides.ts 0.00% <0.00%> (ø)
...es/graphql-transformer-core/src/stripDirectives.ts 35.29% <0.00%> (ø)
.../amplify-cli-core/src/state-manager/pathManager.ts 70.42% <0.00%> (ø)
.../amplify-util-mock/src/utils/lambda/loadMinimal.ts 0.00% <0.00%> (ø)
...graphql-transformer-core/src/TransformerContext.ts 24.81% <0.00%> (ø)
... and 10 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 763f4af...b9e007e. Read the comment docs.

@yuth yuth self-requested a review October 14, 2020 00:14
Copy link
Contributor

@yuth yuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR

@yuth yuth merged commit 35af053 into aws-amplify:master Oct 14, 2020
r0zar pushed a commit to r0zar/amplify-cli that referenced this pull request Nov 19, 2020
aws-amplify#5575)

When you map a unit or a function to use a DynamoDB data source and use the operation UpdateItem and
do not set condition.expressionNames or update.expressionNames in the payload the
amplify-appsync-simulator stops execution. The AppSync DynamoDB template reference says that those
attributes are optional.

fix aws-amplify#5573

Co-authored-by: Fernando Chucre <fernando@oraoncology.com>
@github-actions
Copy link

This pull request 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 Oct 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(amplify-appsync-simulator) Throw error: ExpressionAttributeNames must not be empty in UpdateItem operation
2 participants