Open asta331 opened 8 months ago
Also seeing this behavior with a TransactWriteItems
call I'm attempting to make. One of the transaction items is a GetItem, but the other is a PutItem. Error I'm seeing has nothing helpful, just that it's a Runtime error:
[
{
"path": ["<myPath>"],
"data":null,
"errorType":"Code",
"errorInfo":null,
"locations": [{"line":3,"column":13,"sourceName":null}],
"message":"Runtime Error"
}
]
In my case however, ~I don't believe my Dynamo table has versioning enabled~ I confirmed that my DDB data source does not have versioning enabled. 🤔
I had the same issue also. It turns out I was missing returnValuesOnConditionCheckFailure
This works for me:
import { AppSyncIdentityCognito, Context, DynamoDBTransactWriteItemsRequest, } from "@aws-appsync/utils";
export function request(ctx: Context
return transactionWriteItems; }
export const response = (ctx: Context) => { if (ctx.error) { util.error(ctx.error.message, ctx.error.type); }
return true; };
I am experiencing a runtime error when using the transactWriteItems operation in the AppSync JavaScript runtime, specifically with a DynamoDB data source that has the versioning feature enabled. The same code operates correctly on a data source where versioning is not enabled.
Interestingly, the transactGetItems operation functions as expected in both environments. This makes sense as the GetItem operation is not affected by the versioning feature.
I have not found any documentation stating that the transactWriteItems operation is incompatible with versioned DynamoDB data sources. Therefore, I am reporting this issue for further investigation.
Steps to Reproduce
schema { mutation: Mutation }
query
error: