Is it possible to use subscription without query?
See original GitHub issueI try to create react component, which uses only one subscription, no query.
But If I do not add a query to component I do not have access to subscribeToMore
fn.
Is there any way (sample) how to use subscription without query? All tutorials use a subscription with query.
As a workaround, I add dummy query to component and it looks like it works
Thanks
Issue Analytics
- State:
- Created 6 years ago
- Reactions:8
- Comments:12 (2 by maintainers)
Top Results From Across the Web
Subscriptions - Apollo GraphQL Docs
In the majority of cases, your client should not use subscriptions to stay up to date with your backend. Instead, you should poll...
Read more >GraphQL Subscriptions vs. Live Queries - Medium
There are two common ways to get live data from a GraphQL server: Subscriptions and Live Queries. A Subscription looks like this:
Read more >Subscriptions and Live Queries - Real Time with GraphQL
GraphQL subscriptions are used by many. Live Query adoption, however, has not advanced that much. Let's take a look at both methods for ......
Read more >How GraphQL Subscriptions Work: Tips, Best Practices and ...
Subscriptions use WebSocket for communication, not the normal POST method queries and mutations use. Subscriptions maintain an active ...
Read more >How GraphQL Subscriptions Work - Dgraph
Subscriptions are similar to queries in that they specify a set of fields to be delivered to the client, but instead of immediately...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @goldo i used v2 and found the way to get subs directly without subscribeToMore. Make sure your apollo-link-ws and subscriptions-transport-ws is uptodate.
For example, here is one of my component:
IMHO, using subs without subscribeToMore should be added to official doc to avoid confusion.
Hello @jbaxleyiii @nascode Do you happen to know how to unsubscribe this way? I am currently querying fake data to be able to unsubscribe on demand using the returned method of subscribeToMore.