Replies: 1 comment
-
Subscriptions are intended to use as a notification about some change in the system, like new e-mail in your inbox. In case of "display instant data when i click the play button" in this example context, I'm not sure what data you would expect to see after subscribing - there's not new emails yet, so it's in a loading state.
So please show your standard |
Beta Was this translation helpful? Give feedback.
-
Hello Everyone, hopefully someone can help me out on this.
I have implemented a subscription server for my app. Everything works fine and Subscritpion are successfully Listening for changes and return correct data.
Unfortunately i am not able to retrieve data instantly when i trigger a subscription (in the playground or in useSubscription hook in front end) and i have a constantly loading state that ends only when a subscription is triggered by a mutation or query.
What i am trying to achieve is to retrieve data whenever the subscription starts (in useSubscription or when i press the play button in the playground)
this is my code and there is also a screenshot of the playground.
as you can see in the playground the Subscription is correctly listening for changes, however i would need this to display instant data when i click the play button.
I had achieved this without Type-graphql but i cant seem to make it work in here.
Thanks in advance,
Beta Was this translation helpful? Give feedback.
All reactions