Skip to content

Allow dynamic headers #296

@LucaFilitz

Description

@LucaFilitz

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions