-
Notifications
You must be signed in to change notification settings - Fork 27
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
Ability to add request headers to GQL request on file upload #61
Comments
I'm having the same issue, I can't figure out why the headers set in |
Actually, this was fixed by 962583d but not released yet ? |
Same problem here. I can see that the gateway sets the headers based on the context via the willSendRequest method but the headers don't propagate to the corresponding service with subgraph. Any solutions pls? Right now I can't authenticate user accessing upload resolver implemeted by the microservice :/ |
@superlevure please have you somehow managed to get it to set the headers? If so could you please provide a workaround? |
For anyone having this issue, my workaround for now is simply constructing the headers object based on context value received via GraphQLDataSourceProcessOptions args. Somehow the request?.http?.headers returns undefined so I relied on the context, where my authenticated user is set. So basically I tweaked the processFiles method like this
|
Ran into this problem too; it seems like the code here is the culprit as it never passes the headers down to the Request constructor. This will cause lots of issues with subgraphs that need access to e.g. Authorization or apollo-require-preflight headers to function correctly. As mentioned above there seems to be a commit that fixes this - can this be released soon? request.http = {
headers,
method: 'POST',
url: this.url,
};
if (this.willSendRequest) {
yield this.willSendRequest(args);
}
const options = Object.assign(Object.assign({}, request.http), {
// Apollo types are not up-to-date, make TS happy
body: form });
const httpRequest = new apollo_server_env_1.Request(request.http.url, options); |
will this be released soon? 💯 |
Any idea, I got stucked on this. |
🚀 Feature Request
Description
Implementation details
Potential caveats
Acceptance criteria
Additional context and visual reference
The text was updated successfully, but these errors were encountered: