Apollo Smart Subscription

The easiest way to bring live data to your UI is using the useSubscription() method from @vue/apollo-composable. Each subscription created with useSubscription() in a component results in the creation of a reactive subscription object.

One thing to note, subscriptions in vue-apollo are just listeners, they don’t request any data when first connected, but only open up a connection to get new data. But in Hasura GraphQL Engine, subscriptions are live queries. The initial request gives back data, if any, for the subscription.

Did you find this page helpful?
Start with GraphQL on Hasura for Free
  • ArrowBuild apps and APIs 10x faster
  • ArrowBuilt-in authorization and caching
  • Arrow8x more performant than hand-rolled APIs
Promo
footer illustration
Brand logo
© 2024 Hasura Inc. All rights reserved
Github
Titter
Discord
Facebook
Instagram
Youtube
Linkedin
graphql-handbook