1 個回答
- 最新
- 最多得票
- 最多評論
-1
I got a basic query with a single return to work using the example GetItem pipeline function.
I went back to my original query and kept messing with it. I eventually got it to work using this:
import { util } from '@aws-appsync/utils';
export function request(ctx) {
return {
operation: 'Query',
index: 'userID-index',
query: {
expression: '#userID = :userID',
expressionValues: util.dynamodb.toMapValues({ ':userID': ctx.args.userID }),
expressionNames: { '#userID': 'userID' },
},
};
}
export function response(ctx) {
return ctx.result;
}
Important notes: Ensure you've got expressionNames and your query in the Schema is setup to return ________Connection. It is not necessary to return ctx.result.items in the function or the after mapping template.
已回答 4 個月前
相關內容
- 已提問 10 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
Do you have CLI access to your DynamoDB table?
I don't use CLI much, but I have access to it, yes.
Try do a GetItem from the CLI with the same parameters and see what result you get.