profusion / apollo-federation-file-upload

Add file upload support to Apollo Federated services.
32 stars 27 forks source link

Check why headers are not arriving on the RemoteGraphQLDataSource.process(args) #68

Open g7fernandes opened 1 year ago

g7fernandes commented 1 year ago

Spike/Research Request

Context

Then trying to create tests for custom headers, that can be added by implementing the RemoteGraphQLDataSource.willSendRequest(args) function, I noted that the args.request.http.header was undefined. From the examples in the documentation, one would expect that a request with any header would make request.http.header to be defined and then we could just use .set to add a custom header to be passed to the services.

Knowledge Gap

Goals/Deliverables

The type of .willSendRequest parameter is GraphQLDataSourceProcessOptions

Extra info

You can test sending any request to the test server by commenting/removing these lines

  await runTests();
  await Promise.all([
    stopDownload(),
    chunkedDownloadDownload(),
    gatewayServerStop(),
  ]);

and adding a line with console.log(gatewayService.address.port) to know the gateway on the test/index.ts file. Then run yarn test.

KMoscIszko commented 1 year ago

resolved Check here https://stackoverflow.com/questions/70426637/how-can-i-add-2-buildservice-upload-and-header-to-apollo-federation