appsync-graphql-real-time-canvas
appsync-graphql-real-time-canvas copied to clipboard
second app instance not working
The createCanvas call throws an error, and the error handling code assumes that the error object has a data object, but that object is null. The error message is:
The conditional request failed (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ConditionalCheckFailedException; Request ID: CDG8DQK720CJA210C65IH2T7E3VV4KQNSO5AEMVJF66Q9ASUAAJG)


Apparently AppSync's behavior must have changed since this app was written. Changing the resolver for Mutation.createCanvas to this seems to fix the problem.
#if( $ctx.error ) #if ( $ctx.error.type.equals("DynamoDB:ConditionalCheckFailedException") ) $util.toJson($ctx.result) #else $util.error($ctx.error.message, $ctx.error.type) #end #else $util.toJson($ctx.result) #end