3 Antworten
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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
beantwortet vor 5 Jahren
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(",")
}
}
}
beantwortet vor einem Jahr
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren