-
Notifications
You must be signed in to change notification settings - Fork 975
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
fix: authMiddleware swallows other headers #8470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @russell-dot-js; we'll get this fix out, and we realize the API for configuring the link could be easier to work with. If you have a suggestion we're happy to consider it
Thanks for the fast merge @jtoar!
Second one is gross IMO, first one is simple. Happy to PR whichever you're interested in |
@russell-dot-js exporting the links sounds reasonable. Actually I kind of remember talking about this API at least a year ago, and I think there was a gotcha with exporting some of them because some of them use React Context (specifically the Another idea: instead of passing an array to the Lastly @russell-dot-js, I just released this fix in v5.2.4. |
Thanks @jtoar! I'll check out your concerns and see if exporting the links is a nonstarter. |
RedwoodApolloProvider allows specifying a
graphQLClientConfig
. One of these options allows adding links to those provided with redwood via a function, e.g.The problem is that the "AuthMiddleware" provided by redwood does not forward any other non-auth related headers, so your only option to add headers are static headers that can be defined via httpLinkConfig.
The temporary workaround is:
Since "AuthMiddleware" is not exported nor does it have any static properties that can be used to determine which link it is, knowledge of the ordering of redwood's internal links array needs to be baked into our custom apollo config.
Gross