aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

Dynamodb query works via CLI but the same query returns nothing in appsync #354

Closed jasonrdunne closed 5 months ago

jasonrdunne commented 5 months ago

New to appsync, in a confusing situation. Here's the cli query + result:

aws dynamodb query \
    --table-name Messages \
    --key-condition-expression "conversationId = :conversationId" \
    --expression-attribute-values '{":conversationId":{"S":"655206ed-f407-4c51-80df-7286ad24dc06"}}'               
{
    "Items": [
        {
            "sender": {
                "S": "04180488-9001-7092-2350-75eb70800507"
            },
            "content": {
                "S": "yo"
            },
            "conversationId": {
                "S": "655206ed-f407-4c51-80df-7286ad24dc06"
            },
...

But when i do the same query in appsync via a resolver:

Evaluated request mapping template
{
    "version": "2017-02-28",
    "operation": "Query",
    "query": {
        "expression": "conversationId = :conversationId",
        "expressionValues": {
            ":conversationId": {"S":"655206ed-f407-4c51-80df-7286ad24dc06"}
        }
    },
}

$ctx.result:
{"nextToken":""}

It does not return the list of items. I made 100% sure the data source is correct, too:

MessagesDataSource AMAZON_DYNAMODB Messages