appsync-graphql-real-time-canvas icon indicating copy to clipboard operation
appsync-graphql-real-time-canvas copied to clipboard

second app instance not working

Open Jeff17Robbins opened this issue 5 years ago • 1 comments

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)

image

image

Jeff17Robbins avatar Jul 21 '20 17:07 Jeff17Robbins

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

Jeff17Robbins avatar Jul 22 '20 16:07 Jeff17Robbins