1 Respuesta
- Más nuevo
- Más votos
- Más comentarios
-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.
respondido hace 4 meses
Contenido relevante
- OFICIAL DE AWSActualizada hace 2 años
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.