I'm attempting to return some items using a batch get item template. However, according to the logs the data is being returned in a Posts structure. I don't have a Posts table and am a bit lost as to why it's returning this way. It's attempting to query from a table that doesn't exist and/or I don't have rights to. Any ideas about this error? I would appreciate any help deciphering what this means.
Thanks!
{
"errors": [],
"mappingTemplateType": "Response Mapping",
"path": "[getUser, rosters, items]",
"resolverArn": "arn:aws:appsync:us-east-1:414557938990:apis/6vfj6jlexnhqhpaajd74qzvwx4/types/UserRostersConnection/fields/items",
"transformedTemplate": "null",
"context": {
"arguments": {},
"source": {
"items": [
{
"id": "798965e5-0d7f-41fd-8abc-26ca3233171b",
"userId": "317109ab-e651-4c7d-b66a-e9638d85f47d",
"rosterId": "d38a414a-84be-4d2e-a0aa-8f9d16557f1f"
},
{
"id": "25d6a819-f667-4a2c-ae36-92e06decc778",
"userId": "317109ab-e651-4c7d-b66a-e9638d85f47d",
"rosterId": "d44402b2-43d9-48ba-8b00-6b7b3543dad6"
}
],
"nextToken": null
},
"result": {
"data": {
"Posts": [
null,
null
]
},
"unprocessedKeys": {
"Posts": [
{
"id": "d38a414a-84be-4d2e-a0aa-8f9d16557f1f"
},
{
"id": "d44402b2-43d9-48ba-8b00-6b7b3543dad6"
}
]
}
},
"error": {
"message": "User: arn:aws:sts::414557938990:assumed-role/appsync-datasource-ddb-6vfj6j-RosterTable/APPSYNC_ASSUME_ROLE is not authorized to perform: dynamodb:BatchGetItem on resource: arn:aws:dynamodb:us-east-1:414557938990:table/Posts (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: AccessDeniedException; Request ID: D8TJTO3DNF6V5CTM0U6DV8UN0VVV4KQNSO5AEMVJF66Q9ASUAAJG)",
"type": "DynamoDB:AmazonDynamoDBException"
},
"outErrors": []
},
"fieldInError": false
You probably figured it out by now, but when doing Batch operations you have to specify your table name in the request mapping template (in addition to the data source selection at the beginning). The "Posts" comes from the template you loaded into the editor and it is there as an example. Replace it by the name of your data source. (Also, do not use the name of the data source in AppSync, but the table name in DynamoDB!)
You probably figured it out by now, but when doing Batch operations you have to specify your table name in the request mapping template (in addition to the data source selection at the beginning). The "Posts" comes from the template you loaded into the editor and it is there as an example. Replace it by the name of your data source. (Also, do not use the name of the data source in AppSync, but the table name in DynamoDB!)
Yes this is correct as outlined here: https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html
@mwarger can we close this issue?
Yes, I'm good now. Thank you.
On Fri, Sep 21, 2018, 12:58 AM Richard Threlkeld notifications@github.com
wrote:
You probably figured it out by now, but when doing Batch operations you
have to specify your table name in the request mapping template (in
addition to the data source selection at the beginning). The "Posts" comes
from the template you loaded into the editor and it is there as an example.
Replace it by the name of your data source. (Also, do not use the name of
the data source in AppSync, but the table name in DynamoDB!)Yes this is correct as outlined here:
https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-batch.html@mwarger https://github.com/mwarger can we close this issue?
—
You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub
https://github.com/awslabs/aws-mobile-appsync-sdk-js/issues/242#issuecomment-423422384,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAp659AZiLtjRuMVB30STaVADC0bhhVcks5udIAGgaJpZM4WYEEH
.
Most helpful comment
You probably figured it out by now, but when doing Batch operations you have to specify your table name in the request mapping template (in addition to the data source selection at the beginning). The "Posts" comes from the template you loaded into the editor and it is there as an example. Replace it by the name of your data source. (Also, do not use the name of the data source in AppSync, but the table name in DynamoDB!)