1

I am trying to subscribe the apollo and I am getting following error

apolloClient.Subsribe is undefined

Attaching my client side subscription

const networkInterface = createNetworkInterface('http://localhost:8000/graphql');

const wsClient = new SubscriptionClient(`ws://localhost:8000/`, {
                 reconnect: true,
                 connectionParams: {
                 }
}); 

const networkInterfaceWithSubscriptions = addGraphQLSubscriptions(networkInterface,wsClient);


const apolloClient = new ApolloClient({
    networkInterface: networkInterfaceWithSubscriptions
})
Sai Ram
  • 4,196
  • 4
  • 26
  • 39

1 Answers1

1

The reason is because of the wrong name .

apolloClient.subscribe fixes my issue

Sai Ram
  • 4,196
  • 4
  • 26
  • 39