3 Risposte
- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
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
con risposta 5 anni fa
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(",")
}
}
}
con risposta un anno fa
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
- AWS UFFICIALEAggiornata 2 anni fa