-
-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow dynamic headers #296
Comments
Is that a new-ish thing in Apollo that you can do that? For now, you should be able to create the headers each request via a custom Apollo Link: |
I think it is kind of new. But not that new. |
It looks like To be honest I do not know what it does and do not want to touch it. => I will use the middleware for now. |
This worked for me. const httpOptions = {
|
My operation context doesn't have the |
Hello,
when you create a upload link, you can only set the headers once.
This is a problem when you refresh your authentication token.
Apollo allows to pass a function to the connecitonParams so that every time a request is made the token is fetched. This is better.
What is possible:
createUploadLink({ uri: "SOME URI", headers: { Authorization: "Bearer " + get(token) } })
What I need:
createUploadLink({ uri: "SOME URI", headers: () => { return { Authorization: "Bearer " + get(token) } } })
Currently, when I do this no headers are passed.
Could you fix this?
Kind Regards
Luca
The text was updated successfully, but these errors were encountered: