AppSync BatchGetItem issues
Hello,
I have a fairly simple schema (see below), and I try to use BatchGetItem to retrieve several elements from a table. (query allFeedCurrentSequence below).
After hours of trial, I hardcoded parameters in the resolver to understand the issue. My request template is
{
"version" : "2018-05-29",
"operation" : "BatchGetItem",
"tables" : {
"PipeLineResolverFeedTable": {
"keys" : [
{ "UUID" : {"S" : "UUID6"} }
]
}
}
}
And my response template is
$util.toJson($ctx.result.data.PipeLineResolverFeedTable)
Whenever I run this query :
query allFeedCurrentSequence {
allFeedCurrentSequence(UUIDs: ["UUID6", "UUID7"]) {
UUID
currentSequence
}
}
I get the following response :
{
"data": {
"allFeedCurrentSequence": null
},
"errors": [
{
"path": [
"allFeedCurrentSequence",
"tricountUUID"
],
"locations": null,
"message": "Cannot return null for non-nullable type: 'String' within parent 'PipeLineResolverFeed' (/allFeedCurrentSequence/UUID)"
}
]
}
The logs are really helpless I must say...
Any idea would be welcome.
j.
SCHEMA
type Mutation {
addFeedEntry(UUID: String!, content: String!): PipeLineResolverFeedEntry
}
type PipeLineResolverFeed {
UUID: String!
currentSequence: Int
}
type PipeLineResolverFeedEntry {
UUID: String!
id: ID!
sequenceInFeed: Int!
content: String
}
type Query {
allFeedCurrentSequence(UUIDs: \[String]): PipeLineResolverFeed
}
schema {
query: Query
mutation: Mutation
}
Edited by: JonathanFallon on Oct 4, 2019 4:47 AM
Seems you are returning null for a non nullable field. UUID is marked with ! in your schema so your resolver must return that field. If you are still seeing the issue, you can try to enable CloudWatch logs and see the result of the transformed request and response mapping templates.
Relevant questions
How to achieve multiple Graphql endpoints
asked 4 months agoHow to use the super type as a JSON-containing argument to a procedure and use the JSON elements in a FROM clause of a SELECT
asked 4 months agoQuicksight - Using calculated field in visualizations
asked 4 months agoException in User Class: org.postgresql.util.PSQLException : ERROR: column "id" does not exist
asked 4 months agoLake Formation Governed tables: truncate and reload?
asked 3 months agoAppSync BatchGetItem issues
asked 3 years agoHow do I use a schema fields default value in a template?
asked 3 years agoSpectrum - Invalid S3 arn provided
asked a year agodrop table not working because illegal characters in name
Accepted Answerasked a year agoHow do I set up an AWS Amplify project to query an existing AWS AppSync API?
asked 2 months ago