To follow the same approach as the vue-cli-plugin-apollo
version 4 will take of the configuration part entirely.
Breaking changes
This results into breaking changes
All you need to provide are the endpoints to your apollo backend:
// nuxt.config.js
apollo:{
clientConfigs: {
default: {
httpEndpoint: YOUR_HTTP_ENDPOINT,
wsEndpoint: YOUR_WS_ENDPOINT
}
}
}
New function calls for login and logout handling
Additionally you can call now 3 functions to make your login/logout handling as easy as possible:
this.$apolloHelpers.onLogin(token) // optional you can provide as second argument this.apolloProvider.clients.otherClient
this.$apolloHelpers.onLogout() // optional you can provide this.apolloProvider.clients.otherClient
this.$apolloHelpers.getToken() // optional you can provide the token name