By using AWS re:Post, you agree to the Terms of Use

Appsync composite key (GSI in dynamodb) returns Null in query response


Hi, I have a appsync Schema which has composite key

@key(name: "FinderJobbyDateWithCompositKey", fields: [ "finder_id", "date", "job_status" ], queryField: "JobsFinderWithCompositKey")

I did amplify push and it successfully created GSI with the respective table. the table has the data but when I run query

query MyQuery { JobsFinderWithCompositKey(finder_id: "+929898989898", dateJob_status: {eq: {date: "2022-04-06T09:00:00.000Z", job_status: "15"}}) { items { cod_charge createdAt } } }

it give me Null in response. Please specify what is the issue and how to solve and get result.

I followed this link:

  • Hello Shaista, can you share more info about your schema (full model) and your resolver templates?

  • The names of the fields are not the same: date and dateJob_status. The simple way to check for it is to call DynamoDB directly using the AWS CLI for example with the relevant query and see if you get any results. You can also enable the "Logs" option in the AppSync Query and see if you get errors or results.

1 Answer

Hello Shaista,

I understand that you followed this guideline to make Amplify push, which successfully created GSI in the corresponding DynamoDB table. The table has expected data, however when you run the query, it is giving you null response. We need additional account specific information in order to troubleshoot this issue. Hence, kindly, reach out to AWS Support and work with Premium Support Engineers to resolve this issue. While creating the support case to Premium Support, you will need to provide following details.

•	Account ID
•	Region
•	Table Name
•	GSI name
•	Time frame(10-15 minutes window)
•	DynamoDB Request ID(Important)
answered 5 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions