question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Idea: Support subscriptions in Apollo-boost

See original GitHub issue

Proposed API:

const client = new ApolloClient({
  uri: 'https://nx9zvp49q7.lp.gql.zone/graphql',
  subscriptionsUri: 'https://nx9zvp49q7.lp.gql.zone/subs',
})

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:18
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
lfadescommented, Feb 24, 2018

Here’s another proposed API:

const client = new ApolloClient({
  ws: new WebSocketLink({
    uri: 'ws://...',
    options: {
      reconnect: true
    }
  })
})

This way configs for WebSocketLink are handled outside of apollo-boost and no more dependencies are needed, when doing SSR (or using something like Next.js) the above will fail cause WebSocketLink will throw an error, so it may also take a function that returns the link and is only called client side

const client = new ApolloClient({
  ws: () => new WebSocketLink({ ... })
})

I will be happy to do a PR, it’s ready 💃

1reaction
lfadescommented, May 20, 2018

Currently apollo-boost doesn’t has subscriptions

Read more comments on GitHub >

github_iconTop Results From Across the Web

GraphQL Subscriptions in Apollo Client
GraphQL subscriptions allow developers to introduce new levels of interactivity to their apps with near-realtime updates. You can keep your app ...
Read more >
GraphQL subscriptions with Apollo Client React Hooks and ...
In this post, I will continue to look at the new React Hooks implementations in Apollo Client, this time focusing in on the...
Read more >
Apollo-Angular 1.2 - using GraphQL in your apps just got a lot ...
This version also adds production and scale related features, ... Subscription as an Angular service; Apollo Angular Boost; Testing tools ...
Read more >
The React + Apollo Tutorial for 2020 (Real-World Examples)
Generally speaking, we use subscriptions as an improved kind of query. Subscriptions use a websocket connection to 'subscribe' to updates and ...
Read more >
GraphQL Subscriptions with Apollo Server and Client
For example, Google Analytics has a real-time active users feature, if a new user joins your website then the count will increase and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found