-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[WIP] Add AppSync support for sam local #2491
Conversation
acc2bd9
to
73a06db
Compare
Processing the template into a set of resolvers, not fully working yet
This adds the first elements of a local GraphQL server based on Ariadne
… and improved printed message when starting service
…s resolved using the Lambda invocation. Added some tests
this would be awesome |
Anybody from the maintainers that can have a look at this and tell me what they think? I'm happy to continue in this PR but haven't gotten any response so far, so I'd love some pointers on what still needs to be done apart from some functional tests and documentation. |
@bramkoot @es50678
|
This is a highly discouraging response to hear. AppSync is a tool for developers to build applications. The biggest obstacle right now to building an application of any complexity on AWS is the lack of local development support. It is the biggest frustration, a serious roadblock to iterating quickly during development, and expensive. No other way of building web applications has this drawback and it's the biggest reason to not develop complex applications using AWS tooling. Despite this, an enterprising user has gone to great effort to do AWS's job for them and created this PR to fix this major gap that makes developing a GraphQL API using AWS tooling (e.g. CDK) a lot harder than it should be. For their efforts they're told no thanks. Furthermore it will discourage others from trying to contribute to this project to make it better. I would be happy to contribute to maintaining the feature because I need it right now. But if radio silence on a much-needed PR for ten months is then followed by this I'm going to have to give up on SAM again and go back to Serverless or try out SST. I would consider Amplify but it still doesn't support postgres with AppSync.
My application is split into nested stacks per AWS recommendation and the lambda hotswap feature does not work with nested stacks in CDK. I tested it with sam-cdk-beta. |
I absolutely understand your frustration, we can only apologize for the radio silence on this PR. We are organizing ourselves to do better going forward. We thought about this and debated long and hard. Ultimately, we feel that testing against a real environment in the cloud is the best way to ensure that the results are accurate and include all pieces of the equation - for example IAM permissions. I am happy to get on a call with you to talk more about your specific use case - feel free to DM me.
With SAM Accelerate we have added two new features to the SAM CLI: The |
@praneetap - I too would love AppSync support. I do think that some kind of plugin system for sam would be a huge benefit. There are no doubt plenty of other things that might be quite complex to solve generically (e.g. authorizer support) but might be otherwise quite easy to do. So please +1 for plugins. Running locally was the reason we started using sam. In a team it means none of us will interfere with each other until we are ready to deploy. If we were all to run our own stacks then it can become quite complicated. |
I am going to close this PR as we currently not accepting more local emulations into the CLI. We are still heavily talking about local internally and how we could meet the customer need here for Appsync and other resources/services. So this is NOT a signal that we are ignoring customer wants in this area but the team does feel like we need to find a better solution than accepting local emulations directly into the CLI (aka. possible through a Plugin system). I would like to move further conversations into #3265. We do need feedback for Plugins to help us scope and make sure we balance things correctly but more importantly that it does support what Appsync or other emulations would need. Thank you @bramkoot for spending the time on this and want to apologize the radio silence from us. Our speed to respond to PRs (across our repos) is slow. As a team, we are working on ways to address this going forward and trying to stay on top of incoming PRs first and (at the same time) work through our PR backlog. |
Which issue(s) does this change fix?
#551
Why is this change necessary?
sam local start-api is awesome for all API gateway based setups, but as more and more people start using AppSync they do not have a way to test their code locally.
How does it address the issue?
It adds an extra command sam local start-graphql-api that is similar to start-api but uses the template to determine a GraphQL schema and the direct lambda resolvers. It'll setup a GraphQL server and uses the local lambda invocations as resolvers.
What side effects does this change have?
Checklist
make pr
passesmake update-reproducible-reqs
if dependencies were changedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.