@lolcoolkat your question should be better posted in https://github.com/Akryum/vue-apollo, this package is just the wrapper for vue-apollo code
Personally I don't use subscriptions but happy if someone would provide some code to extend the README
Yes this only has the httpLink. How would it look like with a subscription ws link?
This is my clientDefault config file:
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { WebSocketLink } from 'apollo-link-ws'
import { SubscriptionClient } from 'subscriptions-transport-ws'
export default (ctx) => {
let link = null
if (ctx.isServer) {
link = new HttpLink({ uri: 'http://localhost:3000/graphql' })
} else {
const client = new SubscriptionClient('ws://localhost:3001/graphql', {
reconnect: true
})
link = new WebSocketLink(client)
}
const cache = new InMemoryCache()
return {
link,
cache
}
}
Server side uses HTTP Link, Client uses Websocket link.
@rnenjoy does your code work in your application?
Yes dude. Works great! Fixed it last night. Need more help?
@rnenjoy nope just asking I might extend our README with your ws example so great that you make it work
By the way, here a current example for Angular 2 just in case someone wants to adopt some code: https://alligator.io/angular/graphql-subscriptions/
Example is updated in the README
Most helpful comment
This is my clientDefault config file:
Server side uses HTTP Link, Client uses Websocket link.