amplify-category-api
amplify-category-api copied to clipboard
Amplify Graphql API error
Hi,
We are facing the following error after recent Amplify push. There is no data returned from Appsync Graphql APIs.
query MyQuery { listBatteryTypes { items { id } } }
Response
{ "data": { "listBatteryTypes": null }, "errors": [ { "path": [ "listBatteryTypes" ], "data": null, "errorType": "MappingTemplate", "errorInfo": null, "locations": [ { "line": 2, "column": 3, "sourceName": null } ], "message": "Value for field '$[operation]' not found." } ] }
@manjumallesh1 i guess the team needs more info. Which version of the cli?
Maybe you could post your generated resolver?
Hi @manjumallesh1 👋, thanks for raising this issue.we are working on reproducing the issue. Could you please run below command and send us the report .
amplify diagnose --send-report.
please refer here
@AnilMaktala - thanks for looking into this
CLI version 12.11.1
Project Identifier: edc573327dd31dc69d57250ee36b5cfb report-1714095799222.zip
@manjumallesh1 i guess the team needs more info. Which version of the cli?
Maybe you could post your generated resolver?
[Start] Get Request template. **
#set( $GetRequest = { "version": "2018-05-29", "operation": "Query" } ) #if( $ctx.stash.metadata.modelObjectKey ) #set( $expression = "" ) #set( $expressionNames = {} ) #set( $expressionValues = {} ) #foreach( $item in $ctx.stash.metadata.modelObjectKey.entrySet() ) #set( $expression = "$expression#keyCount$velocityCount = :valueCount$velocityCount AND " ) $util.qr($expressionNames.put("#keyCount$velocityCount", $item.key)) $util.qr($expressionValues.put(":valueCount$velocityCount", $item.value)) #end #set( $expression = $expression.replaceAll("AND $", "") ) #set( $query = { "expression": $expression, "expressionNames": $expressionNames, "expressionValues": $expressionValues } ) #else #set( $query = { "expression": "id = :id", "expressionValues": { ":id": $util.parseJson($util.dynamodb.toDynamoDBJson($ctx.args.id)) } } ) #end $util.qr($GetRequest.put("query", $query)) #if( !$util.isNullOrEmpty($ctx.stash.authFilter) ) $util.qr($GetRequest.put("filter", $util.parseJson($util.transform.toDynamoDBFilterExpression($ctx.stash.authFilter)))) #end $util.toJson($GetRequest)
[End] Get Request template. **
@manjumallesh1, since the error looks very much like this other issue where you described that you have manually deleted and re-added the DDB table, can you confirm that this started happening after you took those actions?
Hey @manjumallesh1, Are you still experiencing this issue?
Hi Anil,
We were able to resolve the issue. Thanks!
From: Anil Maktala @.> Sent: 09 May 2024 19:37 To: aws-amplify/amplify-category-api @.> Cc: Manjunath @.>; Mention @.> Subject: Re: [aws-amplify/amplify-category-api] Amplify Graphql API error (Issue #2503)
Hey @manjumallesh1https://github.com/manjumallesh1, Are you still experiencing this issue?
— Reply to this email directly, view it on GitHubhttps://github.com/aws-amplify/amplify-category-api/issues/2503#issuecomment-2102733613, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BAEJQSHO7SCFTYES3PIWJKDZBN7LHAVCNFSM6AAAAABGZM3FQWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBSG4ZTGNRRGM. You are receiving this because you were mentioned.Message ID: @.***>
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.