Updating uri of apollo client instance


Updating uri of apollo client instance



I'm using Angular Apollo for one of our project. I'm creating the apollo client as:


this.apollo.create({
link: this.httpLink.create({ uri: `${environment.apiBase}/graphql?access_token=${this.tokenService.token}`}),
cache: new InMemoryCache()
})



Since our uri has an access token which also gets expired after a certain point of time, we had to refresh it and get the new access token, hence a new uri.



I was unable find any method in apollo docs regarding the way to update the uri(maybe I've missed it out?), also if I create a new instance like that, it throws me an error that apollo client is already present.



Is there any way to update the uri?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Render GeoTiff to on browser with leaflet

How to get chrome logged in user's email id through website

using states in a react-navigation without redux