typescript - AWS AppSync + Apollo Client ends up with a broken subscription websocket
问题描述
I'm having a problem with AppSync subscription. Together with my team we have created an app (TypeScript) and we are leveraging features of GraphQL via AWS AppSync. The problem we are having is that subscription breaks after network changes e.g. establishing VPN connection / changing network etc. The app page have to be refreshed manually to make it work again. This ends up with a stale state being shown in the app.
Can you please tell me whether using Apollo client with AppSync requires any extra setup to cover such a basic scenario? On Apollo's blog I noticed that AWS official client (AWS AppSync client) uses different protocol for subscriptions: https://www.apollographql.com/blog/community/aws-appsync-powered-by-apollo/ The fragment I'm referring to: "Instead of WebSockets, AppSync’s subscriptions use MQTT as the transport layer."
Please advice if using Apollo client is fine or should I migrate to AWS AppSync client. I'm using default Apollo client config, nothing custom.
Thanks!
解决方案
推荐阅读
- inno-setup - 从注册表中检索组合框的值,并通过覆盖安装程序第二次运行的默认值来填充它
- php - 通过电子邮件更改 MySQL 值
- c++ - 使程序从头开始的循环
- php - php 内爆代码不起作用 代码丢失
- spring - Spring:双向 OneToMany/ManyToOne 关系中的 AnnotationException
- excel - 很少有细胞没有得到适当的保护,为什么?
- amazon-ec2 - 什么是 AWS Ec2 中的虚拟处理器核心以及如何使用 Linux 和 Windows 命令找到它
- elasticsearch - 弹性搜索的 Micronaut 指标
- laravel - 架构连接无法链接到非默认数据库
- nativescript - 如何在模态视图上使用 nativescript-social-share 插件?