This course is no longer maintained and may be out-of-date. While it remains available for reference, its content may not reflect the latest updates, best practices, or supported features.
Apollo useSubscription React hook
将实时数据带入您的用户界面的最容易的方式,是使用 Apollo React-Hook 的 useSubscription React hook。这让您可以在组件的呈现函数中直接呈现来自服务的数据流!需要注意的是,订阅只是监听器,它们在第一次连接时不会请求任何数据,只会打开连接以获得新的数据。
Did you find this page helpful?
Start with GraphQL on Hasura for Free
Build apps and APIs 10x faster
Built-in authorization and caching
8x more performant than hand-rolled APIs

