Guest User

Untitled

a guest
Jun 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. UserScheduleTypeResolver:
  2. Type: AWS::AppSync::Resolver
  3. DependsOn: SessionManagerSchema
  4. Properties:
  5. ApiId: !GetAtt SessionManagerApi.ApiId
  6. TypeName: UserSchedule
  7. FieldName: Sessions
  8. DataSourceName: !GetAtt SessionsTableDataSource.Name
  9. RequestMappingTemplate: !Sub |
  10. #set($ids = [])
  11. #foreach($item in ${!ctx.source.items})
  12. #set($map = {})
  13. $util.qr($map.put("SessionId", $util.dynamodb.toString($item.SessionId)))
  14. $util.qr($ids.add($map))
  15. #end
  16.  
  17. {
  18. "version" : "2018-05-29",
  19. "operation" : "BatchGetItem",
  20. "tables" : {
  21. "${DDBSessionsTable}": {
  22. "keys": $util.toJson($ids),
  23. "consistentRead": true
  24. }
  25. }
  26. }
  27. ResponseMappingTemplate: !Sub |
  28. $util.toJson($ctx.result.data.${DDBSessionsTable})
Add Comment
Please, Sign In to add comment