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 공식업데이트됨 일 년 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
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.