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ヶ月前
関連するコンテンツ
- AWS公式更新しました 1年前
- AWS公式更新しました 2年前
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.