3 回答
- 最新
- 投票最多
- 评论最多
0
Hi,
That feature request makes sense to me, I'll bring it back to the team for discussion and prioritization. Thanks for the feedback!
Thanks,
Jeff
已回答 5 年前
0
It is a long time since this question was posted and indeed the AppSync team added the requested functionality.
First, they added to the context object the selection set list (ctx.info.selectionSetList
).
Second, they updated the DynamoDB Tutorial to include an example of using the selection set list as the projection argument to DynamoDB, as suggested:
import { util } from '@aws-appsync/utils';
export function request(ctx) {
return dynamoDBGetItemRequest(ctx);
}
export function response(ctx) {
return ctx.result;
}
/**
* A helper function to get a DynamoDB item
*/
function dynamoDBGetItemRequest(ctx) {
return {
operation: 'GetItem',
key: util.dynamodb.toMapValues({ id: ctx.args.id}),
projection: {
expression : ctx.info.selectionSetList.join(",")
}
}
}
已回答 1 年前
相关内容
- AWS 官方已更新 1 年前