I have a graphql api and a vue.js frontend with the apollo client for requesting data from the backend. It works fine so far.
The server answers with a new JWT-Token in every response header, which i need. So the solution should be simple .. a afterware which gets the new key from every response and updates the corresponding storage entry. But .. the headers are empty.
Here is the afterware:
apolloClient.networkInterface.useAfter([{
applyAfterware({ response }, next) {
if (process.env.NODE_ENV === 'development') {
console.log('got new response', response);
}
if (response.status === 401) {
store.commit('logout');
store.commit('routeLogin');
}
next();
}
}]);
Here is how the response looks:
And here is what in fact has been sent:
Do i miss something?
UPDATE
I've found a similar case in the issue tracker which has been solved by adding Access-Control-Expose-Headers. So i added them to mine server config. Now the response looks like this, while apollos headers object is still empty:


