Access Response Headers in Apollo Client
How to access response headers in Apollo client. This can be useful for storing the authorization header being sent from the server.
![Access Response Headers in Apollo Client Access Response Headers in Apollo Client](https://substackcdn.com/image/fetch/w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F1cd82513-a834-4213-814e-4304e48f14a2_1076x588.png)
I have a server that sends back a new JWT with each response. There's a simple example on the Apollo docs of setting request headers, but no mention of accessing response headers.
The main reason to do this, was accessing the Authorization
header so that I could update a JWT token that I stored on the client side.
Adding the Link
Go into your Apollo Client…
Keep reading with a 7-day free trial
Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.