Open M-Zuber opened 6 years ago
Expected Behavior The apollo-link-context link will send my auth headers to the server.
apollo-link-context
Actual Behavior Even following the sample in the documentation, the token was not being passed through.
const setAuthorizationLink = setContext((request, previousContext) => ({ authorization: "1234" }));
A simple reproduction Just the code above in lieu of whatever else is being used in the app.
The fix is to change the above code to instead be:
const setAuthorizationLink = setContext((request, previousContext) => ({ headers: { authorization: "1234" } }));
Is it better to just change the docs, or consider changing the behavior of the link to add the headers property on it's own? Issue Labels
@M-Zuber Thank you for opening the issue! This will be better as a documentation change. Could you make that modification and open a PR?
Expected Behavior The
apollo-link-context
link will send my auth headers to the server.Actual Behavior Even following the sample in the documentation, the token was not being passed through.
A simple reproduction Just the code above in lieu of whatever else is being used in the app.
The fix is to change the above code to instead be:
Is it better to just change the docs, or consider changing the behavior of the link to add the headers property on it's own? Issue Labels