Questions tagged [aws-appsync-resolver]

69 questions
1
vote
1 answer

AWS Appsync enhanced subscription filtering not working

AWS enhanced subscription filtering feature documentation recommends to add the following response mapping template: ## Response Mapping Template - onSpecialTicketCreated…
1
vote
1 answer

Access nested body property from HTTP resolver(AppSync)

I'm new to AWS AppSync and I am trying to access certain body property(from HTTP response) in my resolver's response mapping template. For example: I am able to present the response as is via $util.toJson($ctx.result.body), but when I try to get…
Hairi
  • 3,318
  • 2
  • 29
  • 68
1
vote
0 answers

AWS AppSync - $util.typeOf() retrns 'Map' on variable containing string

I'm trying to write an AppSync resolver which updates DynamoDB nested object. In order to create correct UpdateItem expressions, I have to loop through $ctx.args and evaluate if arg is simple type ie. field updatedAt that contains a string or a…
1
vote
1 answer

Error Cannot return null for non-nullable type: 'String' within parent MyModelType' (/createMyModelType/id)

I am trying to trigger a mutation in the aws console. I have linked my resolver function to a None type data source. However, when I define my mutation with an input type as a parameter, the error " Error Cannot return null for non-nullable type:…
0
votes
0 answers

Custom resolver / response VTL templates for fine grained auth with AppSync and DataStore

I have requirement for a non standard authentication model using amplify app sync. There are different levels of access that each user can have public private sensitive and for each of these there can be readonly or writeable access. Each object…
0
votes
0 answers

Appsync returns null values

Here's the relevant schema definitions: type Course implements GrApp { id: ID! term_id: ID! term_name: String type: String! name: String! data: AWSJSON course_info: AWSJSON } interface GrApp { id: ID! type:…
0
votes
0 answers

Attaching resolvers to every field in a schema

I just got started with AppSync and I'm really confused with how I'm supposed to attach resolvers. From what I've seen, it seems like I have to attach resolvers to every field in my schema, which makes sense. However, none of the examples I've seen…
0
votes
0 answers

Amplify DataStore Sync Issue when creating the entries through AppSync

I am creating the Flutter app using AWS Amplify. I have created a DataModel and called the observeQuery() function in my code to look for any changes in the Database. When I create an entry through my Flutter app that entry is reflected in DynamoDB…
0
votes
0 answers

How can we execute two queries with same $context in AppSync

How can I store IP, keyword, and other details from OpenSearch response to DynamoDB using AWS AppSync? I have a setup involving AWS AppSync with OpenSearch and DynamoDB. My objective is to perform a search operation on the OpenSearch data source and…
0
votes
1 answer

AppSync VTL resolver - how to resolve parse error

I'm getting this error on my VTL response mapping and I'm not sure what it means graphql: Encountered "}" at velocity[line 9, column 3] Was expecting one of: "[" ... …
jordan
  • 9,570
  • 9
  • 43
  • 78
0
votes
0 answers

Why does AWS AppSync only directly support VTL (Velocity Template Language) for Resolvers?

It seems that you can write Javascript, but only by adding a new Lambda function which adds cost and complexity of the app. I am just curious to know why this is the case, as VTL seems to be much less popular and it is not a language I am familiar…
0
votes
1 answer

AWS Appsync + VTL template. Template transformation yielded an empty response

When I send a mutation request with invalid data, I get the following body: { "data": { "updateForm": null }, "errors": [ { "path": [ "updateForm" ], "data": null, "errorType": "MappingTemplate", …
0
votes
1 answer

AppSync VTL: Returning From Request Resolver Without Skipping Response Resolver

In AppSync VTL, I am attempting to generate log events in my response resolver vtl file, so I would prefer not to skip them. Below is my request.vtl file. #foreach($item in $ctx.source.get("songPlays")) $util.qr($item.put("globalContextStash",…
JTAN
  • 411
  • 2
  • 5
  • 15
0
votes
0 answers

Auto populate field in create mutation with Velocity resolver in AppSync Apmplify

In my AWS amplify app, I have 3 dynamodb tables. User, Post and Comment. Post belongs to a User. Commnet belongs to a Post. With velocity resolvers, in createComment mutation, I want to auto populate the postCommentsId (foreign key) field of…
ibex
  • 1,038
  • 9
  • 18
0
votes
1 answer

Appsync Intentionally Return Null for Nested Pipeline Giving Error

Essentially we have an optional 'childId' on the parent. The childId is used to get a child element 'Child' from DynamoDB. If there is no childId present, we return a null value - as expected. The 'Child' is not a mandatory field on the schema so…
Scott Allen
  • 513
  • 2
  • 13