将AppSync和Amazon RDS与无服务器-graphql一起使用 [英] Use AppSync and Amazon RDS with serverless-graphql

查看:98
本文介绍了将AppSync和Amazon RDS与无服务器-graphql一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个很棒的存储库,其中包含不同无服务器场景的示例实现.

There is this great repository with example implementations of different serverless scenarios.

现在,我正在努力将AppSync和Amazon RDS结合使用.我尝试了独立rds的实现,以及存储库中提供的appsync示例.这些就像魅力一样运作. 但是,如果您想组合使用这些技术,显然存在许多差异和困难.我使用了rds目录中的架构,解析器和处理程序函数,并将其与appsync lambda实现结合在一起.我调整了映射模板并更新了serverless.yml文件.

Right now I'm struggling with the combination of AppSync and Amazon RDS. I tried the implementation of the standalone rds, and the appsync examples provided in the repository. These are working like a charm. But obviously there are many differences and difficulties if you'd like to combine these technologies. I used the schema, resolver and handler functions from the rds directory and combined it with the appsync lambda implementation. I adjusted the mapping templates and updated the serverless.yml file.

我可以成功部署整个appsync服务和所有资源,而不会出现任何错误.我可以从graphiql访问graphql端点并进行查询.但是当我从appsync控制台尝试时,我得到null作为响应.我想这与映射模板有关,但我不太确定.

I could successfully deploy the whole appsync service and all resources without any errors. I'm able to access the graphql endpoint from graphiql and do my queries. But when I try it from the appsync console I get null as a response. I guess it has something to do with the mapping templates, but I'm not quite sure.

有人对这种特定组合有任何建议或可行的例子吗?

Has anybody got any suggestions or maybe a working example of this specific combination?

推荐答案

我终于可以为这个特定的设置找到一个可行的实现,我想与大家分享. 在GitHub上查看我的 serverless-graphql-appsync-rds 存储库,然后给我一些东西回馈! 请注意,此存储库仅包含源代码,没有任何说明.我将在不久的将来创建更好的文档.

I finally could figure out a working implementation for this specific setup which I want to share with all of you. Check out my serverless-graphql-appsync-rds repository on GitHub and leave me some feedback! Note that this repository contains just the source code without any explanations. I'll create a better documentation in the near future.

这篇关于将AppSync和Amazon RDS与无服务器-graphql一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆