Search code examples
laravelamazon-web-servicesaws-lambdaaws-appsyncaws-appsync-ios

Proper integration of AWS AppSync with Laravel?


Anyone successfully integrated AWS AppSync with Laravel?

I am new to AWS AppSync but good experience with laravel.

I am trying to implement an offline-app feature in my mobile app and the mobile API part is what Laravel handles.

I looked into AWS AppSync but all they are talking about is dynamoDB and graphQL. Someplace it says i need to use AWS Lambda.

I really can't get a grip on how to properly implement this.

Any suggestions or pieces of advice are greatly appreciated.

I have basic experience with graphQL

Thanks

I checked a few video sessions and found HTTP endpoint can be used as a resolver. is this the proper way?

If I use HTTP as resolver can I still use the real-time features?

links

https://aws.amazon.com/appsync/


Solution

  • Laravel is a PHP framework, so I think the two options you would want to consider would be HTTP and Lambda data sources.

    Lambda can be something of a catch-all for data sources: you have absolute control over what you call, how you do it, and in what language you do it. You just have to set up a Lambda function and create a data source in the AppSync console pointing to it, then have your Lambda function interact with your framework however it needs to.

    I'm not terribly familiar with Laravel myself, but I believe HTTP is also a totally viable option. I would think this would be the way you want to go, as it cuts out the added complexity and latency of a Lambda function between AppSync and your end destination. A tutorial for setting one up is available here: https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-http-resolvers.html

    In either case, real time updates will be absolutely available to you.