Questions tagged [aws-appsync-resolver]

69 questions
5
votes
1 answer

How do you handle lists that require joined data from multiple data sources in AppSync/GraphQL?

type Employee { id: String! name: String lastObservedStatus: String } type Query { employees: [Employee] } This is a fictional schema to illustrate my question. I have two separate data sources that return lists that need to be…
Sean
  • 55
  • 4
3
votes
1 answer

AWS AppSync: No option to add Lambda resolver

I have created an AppSync API and a lambda data source and a resolver to provide data for it. I managed to successfully run queries a couple of days ago. I wanted to attach a second lambda resolver for a different GraphQL query. I added a new lambda…
3
votes
0 answers

AWS AppSync not displaying custom error properties with in Lambda Resolver ResponseMappingTemplate

We are trying to use custom error status codes with GraphQL so that our upstream services can better utilize the errors thrown. We have a simple error class that extends the base Error class to include a status code: export class ErrorWithStatusCode…
Borduhh
  • 1,975
  • 2
  • 19
  • 33
3
votes
0 answers

Select a tenant's DynamoDB table in AppSync using their Cognito identity

I am building a multi-tenant application, with the tenants sharing a GraphQL API backed by AppSync. All of a tenant's metadata is stored in a single DynamoDB table, and AppSync uses a DynamoDB data source on that table to resolve queries and…
2
votes
1 answer

AppSync graphql mutation isn't updating object in dynamoDB

I'm trying to mutate an object with the help of AppSync console. when i execute my query it executes without any error but it didn't actually update the object in the database and returns the same object. Here is my query updatePayment(input: {id:…
2
votes
1 answer

How to create a custom, hardcoded health check GraphQL query with AWS Appsync?

I'm new to AWS Appsync and to GraphQL. Previously, I used to create REST APIs in Python. I was always creating a GET /health-check endpoint, sending back, for example and among many other info, the API version number, easily parsed from the project…
bolino
  • 867
  • 1
  • 10
  • 27
2
votes
0 answers

Following migrating Amplify CLI and AppSync Transformer to v2 no longer able to access CloudFormation parameters from a custom resource

We have an AWS Amplify project that I am in the process of migrating the API from Transformer 1 to 2. As part of this, we have a number of custom resolvers that previously had their own stack JSON template in the stacks/ folder as generated by the…
1
vote
1 answer

Appsync VTL resolvers assigning null to a an object

I extended the default resolvers I received from Amplify/Appsync for one of my models. I saved my code as Mutation.updateMovement.preUpdate.1.req.vtl, and here's my VTL file: #set( $muscleGroups = $ctx.args.input.muscleGroups ) #if( $muscleGroups &&…
barshopen
  • 1,190
  • 2
  • 15
  • 28
1
vote
1 answer

AppSync how to check if a variable is an array in javascript resolver

I'm new in AWS AppSync. I just need to check if a variable is an array. I've already tried following ways but they are not working. 1. Array.isArray(variable) I got an error when I run this code This seems not to be supported according to this…
Komachi
  • 139
  • 4
1
vote
0 answers

Typescript custom bundling

I'm testing out AWS AppSync JS Resolvers and i'm currently building them in TS. To be able to use them I transpile each TS file to a JS file to be able to use them as JS Resolver in AWS AppSync and that works. But i also want to transform each local…
1
vote
1 answer

AWS::Appsync:Resolver Cloudformation error using Javascript Resolver in Code block in YML using Serverless Framework

I am having an issue while creating AWS::Appsync:Resolver Cloudformation in Serverless Framework using Javascript resolver. My Javascript Resolver code in root dir /src/resolvers/jsResolver.js which I have attached to AWS::AppSync::Resolver…
1
vote
1 answer

AppSync JavaScript Support for Array.sort of objects

While implementing JS resolvers in AWS AppSync, I can't find a way to sort an Array of objects. The documentation of AppSync (https://docs.aws.amazon.com/appsync/latest/devguide/built-in-objects-functions.html) mentions that Array.prototype.sort()…
Guy
  • 12,388
  • 3
  • 45
  • 67
1
vote
1 answer

response mapping template for a javascript resolver

I have resolvers written in JS and not VTL since AWS added support for it. I am using AWS SAM template and this is how it looks MyResolver: Type: AWS::AppSync::Resolver DependsOn: AppSyncSchema Properties: ApiId: !GetAtt…
salt-pepper
  • 115
  • 3
  • 12
1
vote
0 answers

How to send JSON data of AWSJSON Type through one AppSync to another Appsync?

I am sending the request from one AppSync to another AppSync GraphQL endpoint. Receiving error while sending JSON data for the FIELD data. In VTL Template, $ctx.args.input.data will hold the value for data field. I have tried to parse the data in a…
1
vote
1 answer

Changing logical ID of AppSync resolver result in error upon deploy (CDK)

When I change a resolver ID as follows: From: new appsync.Resolver(scope, "SuperResolver",..... To: new appsync.Resolver(scope, "MegaResolver",..... i.e from "SuperResolver" to "MegaResolver" and then I run cdk deploy, I get the following…
Hairi
  • 3,318
  • 2
  • 29
  • 68
1
2 3 4 5