Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify Graphql API error #2503

Closed
manjumallesh1 opened this issue Apr 25, 2024 · 8 comments
Closed

Amplify Graphql API error #2503

manjumallesh1 opened this issue Apr 25, 2024 · 8 comments
Labels
api-graphql question Further information is requested

Comments

@manjumallesh1
Copy link

manjumallesh1 commented Apr 25, 2024

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."
}
]
}

@biller-aivy
Copy link

@manjumallesh1 i guess the team needs more info.
Which version of the cli?

Maybe you could post your generated resolver?

@AnilMaktala
Copy link

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

@manjumallesh1
Copy link
Author

manjumallesh1 commented Apr 26, 2024

@AnilMaktala - thanks for looking into this

CLI version 12.11.1

Project Identifier: edc573327dd31dc69d57250ee36b5cfb
report-1714095799222.zip

@manjumallesh1
Copy link
Author

@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. **

@AnilMaktala AnilMaktala added the question Further information is requested label Apr 26, 2024
@phani-srikar
Copy link
Contributor

@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?

@AnilMaktala
Copy link

Hey @manjumallesh1, Are you still experiencing this issue?

@manjumallesh1
Copy link
Author

manjumallesh1 commented May 11, 2024 via email

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-graphql question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants