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年前