Serverless-offline: AppSync support

Created on 16 Apr 2018  路  8Comments  路  Source: dherault/serverless-offline

Is there any plan for AWS AppSync support?
https://aws.amazon.com/appsync/

question

Most helpful comment

Just as serverless-offline runs a web server to emulate API Gateway, it could, for AppSync, run, say, Apollo Server for the GraphQL server emulation. I would limit the emulation to only loading the Schema and executing resolver functions, which are usually implemented as Lambda functions.

All 8 comments

@DaleJefferson Not to my knowledge. What would you envision AppSync support to look like?

Just as serverless-offline runs a web server to emulate API Gateway, it could, for AppSync, run, say, Apollo Server for the GraphQL server emulation. I would limit the emulation to only loading the Schema and executing resolver functions, which are usually implemented as Lambda functions.

Would definitely love this

+1

+1

There are reactions. Why do you guys always do +1. It adds nothing & sends notifications to everyone for no reason. Plz use reactions.

Hi guys, this looks like room for a separate project that runs on top of serverless-offline. I'd gladly put a link to this fork in the readme.

I would absolutely love to see something like this. 馃榾

It could read some sort of configuration like the one defined in the serverless-appsync-plugin and use that to start. The config would link up schemas to velocity templates.

I could see codegen being used to handle VTL to Resolver mapping logic.

For DynamoDB resolvers for example:

You could look at the VTL itself which shows what the underlying DB operation is. Then using operation field you could scaffold up an appropriate resolver function with a generated Dynamo operation using the aws-sdk or some other lib. I don't know much about how AWS actually implements AppSync DynamoDB resolver codegen, but I can imagine its similar???

Linking existing Lambda resolvers may be easier as it would just reference that specific handler, but there would be questions about how AppSync users are currently referencing them in their configuration. Do the Lambdas live in the same repo? Are they using ARNs to reference already deployed remote Lambdas? If so, how would this local AppSync reference that Lambda?

Implementing Subscriptions may be tricky though...I'm not sure if AWS is using something similar to apollo directives for their @aws_subscribe directives?

As for the the local /graphql server itself, I would agree w/ @hotgazpacho and there'd be a local Apollo Server or equivalent booted up. Then using the config as a routing map of sorts, the server would bind / route the graphql queries to the appropriate resolvers.

Downside to above implementation would be adding a ton of complexity to this lib as well as more dependencies. Not my decision to make 馃槄

serverless-appsync-offline already exists, but its very untested and theres issues like this. Also, Java is a dep? 馃 And theres a baked in jwt authorizer that requires a valid jwt thats built into a dependency 馃槺

Anyone interested in starting a new project? I would def be willing to contribute code, though I'm not sure I have the capacity to be a core maintainer...

Sorry for blowing up this thread 馃檹

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidroman0O picture davidroman0O  路  4Comments

jormaechea picture jormaechea  路  4Comments

Ali-Dalal picture Ali-Dalal  路  4Comments

Looveh picture Looveh  路  4Comments

dnalborczyk picture dnalborczyk  路  3Comments