Skip to content

Latest commit

 

History

History
 
 

appsync-subscriptions

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Appsync Subscription Pattern

AWS Demonstration of the same concept

Authorization Options

For the subecsription, we can write vtl to check if the logged in user matches the userId input or the PK of the item returned:

#if(! ${context.result})
    $utils.unauthorized()
#elseif(${context.identity.cognitoIdentityId} != ${context.arguments.userId})
    $utils.unauthorized()
#else
    $util.toJson($ctx.result)
#end