3
votes

I started to use AWS Amplify for a web app.

I configured AppSync GraphQL using a DynamoDB datasource as suggested by the Getting Started tutorial.

One of my values is an empty string and I get this error when trying to do an insert

"One or more parameter values were invalid: An AttributeValue may not contain an empty string (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ValidationException; Request ID: 0000000SOMETHING0000000)"

It seems it can be solved by passing the option convertEmptyValues: true to the DynamoDB client. Do you know how I can pass a such option using AppSync ?

1

1 Answers

1
votes

I have not found such an option in the Amplify codebase. I hope it will be added.

In the meantime, I pass my emptiable strings this way:

{
  id: id,
  title: title,
  description: description || null
}